using System; using System.Collections; using BP.DA; using BP.En; namespace BP.GPM { /// /// 个人设置 /// public class PerSettingAttr : EntityNoNameAttr { /// /// 系统 /// public const string FK_App = "FK_App"; /// /// 人员 /// public const string FK_Emp = "FK_Emp"; /// /// UserNo /// public const string UserNo = "UserNo"; /// /// 密码 /// public const string UserPass = "UserPass"; /// /// Idx /// public const string Idx = "Idx"; } /// /// 个人设置 /// public class PerSetting : EntityMyPK { #region 属性 /// /// 系统 /// public string FK_App { get { return this.GetValStringByKey(PerSettingAttr.FK_App); } set { this.SetValByKey(PerSettingAttr.FK_App, value); } } public string FK_Emp { get { return this.GetValStringByKey(PerSettingAttr.FK_Emp); } set { this.SetValByKey(PerSettingAttr.FK_Emp, value); } } public string UserNo { get { return this.GetValStringByKey(PerSettingAttr.UserNo); } set { this.SetValByKey(PerSettingAttr.UserNo, value); } } public string UserPass { get { return this.GetValStringByKey(PerSettingAttr.UserPass); } set { this.SetValByKey(PerSettingAttr.UserPass, value); } } public int Idx { get { return this.GetValIntByKey(PerSettingAttr.Idx); } set { this.SetValByKey(PerSettingAttr.Idx, value); } } #endregion #region 构造方法 /// /// 个人设置 /// public PerSetting() { } /// /// 个人设置 /// /// public PerSetting(string no) { this.setMyPK(no); this.Retrieve(); } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("GPM_PerSetting", "个人设置"); map.setEnType(EnType.Sys); map.AddMyPK(); map.AddTBString(PerSettingAttr.FK_Emp, null, "人员", true, false, 0, 200, 20); map.AddTBString(PerSettingAttr.FK_App, null, "系统", true, false, 0, 200, 20); map.AddTBString(PerSettingAttr.UserNo, null, "UserNo", true, false, 0, 200, 20, true); map.AddTBString(PerSettingAttr.UserPass, null, "UserPass", true, false, 0, 200, 20, true); map.AddTBInt(PerSettingAttr.Idx, 0, "显示顺序", false, true); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeUpdateInsertAction() { this.setMyPK(this.FK_Emp + "_" + this.FK_App); return base.beforeUpdateInsertAction(); } } /// /// 个人设置s /// public class PerSettings : EntitiesMyPK { #region 构造 /// /// 个人设置s /// public PerSettings() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new PerSetting(); } } #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((PerSetting)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }