//used by ubf.. public void FromEntityData(CheckBarCodeData data, IDictionary dict) { if (data == null) { return; } bool m_isNeedPersistable = this.NeedPersistable; this.NeedPersistable = false; //this.innerData.ChangeEventEnabled = false; //this.innerRelation.RelationEventEnabled = false; if (dict == null) { dict = new Hashtable(); } dict[data] = this; this.SysState = data.SysState; DeSerializeKey(data); #region 组件外属性 //ID与系统字段不处理 --Sysversion需要处理。 //ID与系统字段不处理 --Sysversion需要处理。 //ID与系统字段不处理 --Sysversion需要处理。 //ID与系统字段不处理 --Sysversion需要处理。 //ID与系统字段不处理 --Sysversion需要处理。 this.SetTypeValue("SysVersion", data.SysVersion); this.SetTypeValue("Org", data.Org); this.SetTypeValue("BarCode", data.BarCode); this.SetTypeValue("Item", data.Item); this.SetTypeValue("ActualLength", data.ActualLength); this.SetTypeValue("CheckedOn", data.CheckedOn); this.SetTypeValue("CheckedBy", data.CheckedBy); #endregion #region 组件内属性 #endregion this.NeedPersistable = m_isNeedPersistable; dict[data] = this; }
public override void FromEntityData(UFSoft.UBF.Business.DataTransObjectBase dto) { CheckBarCodeData data = dto as CheckBarCodeData; if (data == null) { return; } this.FromEntityData(data); }
//反序化Key到Data的ID中 --由FromEntityData自动调用一次。实际可以分离,由跨组织服务去调用. private void DeSerializeKey(CheckBarCodeData data) { if (data.Org == -1 && data.Org_SKey != null) { data.Org = data.Org_SKey.GetEntity().ID; } if (data.Item == -1 && data.Item_SKey != null) { data.Item = data.Item_SKey.GetEntity().ID; } //Entity中没有EntityKey集合,不用处理。 }
/// <summary> /// Create EntityData From Entity - used by ubf /// </summary> public CheckBarCodeData ToEntityData(CheckBarCodeData data, IDictionary dict) { if (data == null) { data = new CheckBarCodeData(); } if (dict == null) { dict = new Hashtable(); } //就直接用ID,如果不同实体会出现相同ID,则到时候要改进。? ID一定要有。 dict["UFIDA.U9.Cust.JSDY.BarCode.CheckBarCode" + this.ID.ToString()] = data; data.SysState = this.SysState; #region 组件外属性 -BusinessEntity,"简单值对象",简单类型,多语言.不可能存在一对多.没有集合可能. { object obj = this.GetValue("ID"); if (obj != null) { data.ID = (System.Int64)obj; } } { object obj = this.GetValue("CreatedOn"); if (obj != null) { data.CreatedOn = (System.DateTime)obj; } } { object obj = this.GetValue("CreatedBy"); if (obj != null) { data.CreatedBy = (System.String)obj; } } { object obj = this.GetValue("ModifiedOn"); if (obj != null) { data.ModifiedOn = (System.DateTime)obj; } } { object obj = this.GetValue("ModifiedBy"); if (obj != null) { data.ModifiedBy = (System.String)obj; } } { object obj = this.GetValue("SysVersion"); if (obj != null) { data.SysVersion = (System.Int64)obj; } } { object obj = this.GetValue("Org"); if (obj != null) { data.Org = (System.Int64)obj; } } { object obj = this.GetValue("BarCode"); if (obj != null) { data.BarCode = (System.String)obj; } } { object obj = this.GetValue("Item"); if (obj != null) { data.Item = (System.Int64)obj; } } { object obj = this.GetValue("ActualLength"); if (obj != null) { data.ActualLength = (System.Int32)obj; } } { object obj = this.GetValue("CheckedOn"); if (obj != null) { data.CheckedOn = (System.DateTime)obj; } } { object obj = this.GetValue("CheckedBy"); if (obj != null) { data.CheckedBy = (System.String)obj; } } #endregion #region 组件内属性 -Entity,"复杂值对象",枚举,实体集合. #endregion return(data); }
/// <summary> /// Copy Entity From EntityData /// </summary> public void FromEntityData(CheckBarCodeData data) { this.FromEntityData(data, new Hashtable()); }