using System;
using System.Data;
using System.Collections;
using BP.DA;
namespace BP.En
{
///
/// 通用编号名称实体
///
public class TSEntityTree : EntityTree
{
#region 构造函数
///
/// 主键
///
public override string PK
{
get
{
return "No";
}
}
public override string PKField
{
get
{
return "No";
}
}
///
/// 转化为类.
///
///
public override string ToString()
{
return this._TSclassID;
}
///
/// 主键ID
///
public override string ClassID
{
get
{
return this._TSclassID;
}
}
public TSEntityTree()
{
//构造.
BP.Port.StationType en = new Port.StationType();
this._enMap = en.EnMap;
}
///
/// 主键
///
public string _TSclassID = null;
///
/// 通用编号名称实体
///
/// 类ID
public TSEntityTree(string _TSclassID)
{
this._TSclassID = _TSclassID;
this._enMap = BP.EnTS.Glo.GenerMap(_TSclassID);
// this._enMap = map as Map;
// this._enMap = BP.EnTS.Glo.GenerMap(_TSclassID);
}
///
/// 通用编号名称实体
///
/// 表单ID
///
public TSEntityTree(string classID, string pk)
{
this._TSclassID = classID;
this._enMap = BP.EnTS.Glo.GenerMap(_TSclassID);
this.No = pk;
this.Retrieve();
}
#endregion
#region 构造映射.
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
if (this._TSclassID == null)
throw new Exception("没有给 _TSclassID 值,您不能获取它的Map。");
this._enMap = BP.EnTS.Glo.GenerMap(this._TSclassID);
return this._enMap;
}
}
///
/// TSEntityTrees
///
public override Entities GetNewEntities
{
get
{
if (this._TSclassID == null)
throw new Exception("没有给 _TSclassID 值,您不能获取它的 Entities。");
return new TSEntitiesTree(this._TSclassID);
}
}
#endregion
}
///
/// 实体类
///
public class TSEntitiesTree : EntitiesTree
{
#region 重载基类方法
public override string ToString()
{
return this._TSclassID;
}
///
/// 类名
///
public string _TSclassID = null;
#endregion
#region 方法
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
if (this._TSclassID == null)
return new BP.Port.StationType();
//throw new Exception("没有给 _TSclassID 值,您不能获取它的 Entities。");
return new TSEntityTree(this._TSclassID);
}
}
public TSEntitiesTree()
{
}
public TSEntitiesTree(string tsClassID)
{
this._TSclassID = tsClassID;
}
#endregion
#region 为了适应自动翻译成java的需要,把实体转换成List.
///
/// 转化成 java list,C#不能调用.
///
/// List
public System.Collections.Generic.IList ToJavaList()
{
return (System.Collections.Generic.IList)this;
}
///
/// 转化成list
///
/// List
public System.Collections.Generic.List Tolist()
{
System.Collections.Generic.List list = new System.Collections.Generic.List();
for (int i = 0; i < this.Count; i++)
{
list.Add((TSEntityTree)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}