using System; using System.Data; using BP.DA; using BP.En; using BP.Port; namespace BP.WF.WeiXin { /// /// 工作人员属性 /// public class EmpAttr : BP.En.EntityNoNameAttr { #region 基本属性 /// /// 部门 /// public const string FK_Dept = "FK_Dept"; /// /// SID /// public const string OpenID = "OpenID"; /// /// 手机号码 /// public const string Tel = "Tel"; #endregion } /// /// Emp 的摘要说明。 /// public class Emp : EntityNoName { #region 扩展属性 public string OpenID { get { return this.GetValStrByKey(EmpAttr.OpenID); } set { this.SetValByKey(EmpAttr.OpenID, value); } } public string DeptNo { get { return this.GetValStrByKey(EmpAttr.FK_Dept); } set { this.SetValByKey(EmpAttr.FK_Dept, value); } } /// /// 手机号码 /// public string Tel { get { return this.GetValStrByKey(EmpAttr.Tel); } set { this.SetValByKey(EmpAttr.Tel, value); } } #endregion /// /// 工作人员 /// public Emp() { } /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenForAppAdmin(); return uac; } } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Port_Emp", "用户"); #region 字段 /*关于字段属性的增加 */ map.AddTBStringPK(EmpAttr.No, null, "编号", true, false, 1, 50, 100); map.AddTBString(EmpAttr.Name, null, "名称", true, false, 0, 100, 100); map.AddTBString(EmpAttr.OpenID, null, "OpenID", true, false, 0, 100, 100); map.AddDDLEntities(EmpAttr.FK_Dept, null, "部门", new BP.Port.Depts(), true); map.AddTBString(EmpAttr.Tel, null, "手机号码", false, false, 0, 11, 30); #endregion 字段 this._enMap = map; return this._enMap; } } public override Entities GetNewEntities { get { return new Emps(); } } } /// /// 工作人员 /// public class Emps : EntitiesNoName { /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new Emp(); } } /// /// 工作人员s /// public Emps() { } #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((Emp)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }