using System; using System.Data; using System.Collections; using BP.DA; using BP.En; namespace BP.Sys { /// /// 通用OID实体 /// public class GEEntityMyPK : Entity { #region 构造函数 /// /// 设置或者获取主键值. /// public string MyPK { get { return this.GetValStrByKey("MyPK"); } set { this.SetValByKey("MyPK", value); } } public void setMyPK(string val) { this.SetValByKey("MyPK", val); } /// /// 主键值 /// public override string PK { get { return "MyPK"; } } /// /// 主键字段 /// public override string PKField { get { return "MyPK"; } } /// /// 转化为类. /// /// public override string ToString() { return this.FK_MapData; } public override string ClassID { get { return this.FK_MapData; } } /// /// 主键 /// public string FK_MapData = null; /// /// 通用OID实体 /// public GEEntityMyPK() { } /// /// 通用OID实体 /// /// 节点ID public GEEntityMyPK(string frmID) { this.FK_MapData = frmID; } public GEEntityMyPK(string frmID, string pk) { this.FK_MapData = frmID; this.PKVal = pk; this.Retrieve(); } #endregion #region 构造映射. /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; if (this.FK_MapData == null) throw new Exception("没有给" + this.FK_MapData + "值,您不能获取它的Map。"); this._enMap = BP.Sys.MapData.GenerHisMap(this.FK_MapData); return this._enMap; } } /// /// GEEntityMyPKs /// public override Entities GetNewEntities { get { if (this.FK_MapData == null) return new GEEntityMyPKs(); return new GEEntityMyPKs(this.FK_MapData); } } #endregion } /// /// 通用OID实体s /// public class GEEntityMyPKs : Entities { #region 重载基类方法 public override string ToString() { //if (this.FK_MapData == null) // throw new Exception("@没有能 FK_MapData 给值。"); return this.FK_MapData; } /// /// 主键 /// public string FK_MapData = null; #endregion #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { if (this.FK_MapData == null) return new GEEntityMyPK(); return new GEEntityMyPK(this.FK_MapData); } } /// /// 通用OID实体ID /// public GEEntityMyPKs() { } public GEEntityMyPKs(string frmID) { this.FK_MapData = frmID; } #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((GEEntityMyPK)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }