using System; using System.Collections; using BP.DA; using BP.En; namespace BP.Sys { /// /// 属性 /// public class DefValAttr : EntityMyPKAttr { /// /// 父节点编号 /// public const string ParentNo = "ParentNo"; /// /// 是否父节点 /// public const string IsParent = "IsParent"; /// /// 类别 /// public const string WordsSort = "WordsSort"; /// /// 节点表编号 /// public const string FK_MapData = "FK_MapData"; /// /// 节点对应字段 /// public const string AttrKey = "AttrKey"; /// /// 历史词汇 /// public const string LB = "LB"; /// /// 人员编号 /// public const string FK_Emp = "FK_Emp"; /// /// 节点文本 /// public const string CurValue = "CurValue"; } /// /// 默认值 /// public class DefVal : EntityMyPK { #region 基本属性 /// /// 父节点编号 /// public string ParentNo { get { return this.GetValStringByKey(DefValAttr.ParentNo); } set { this.SetValByKey(DefValAttr.ParentNo, value); } } /// /// 是否父节点 /// public string IsParent { get { return this.GetValStringByKey(DefValAttr.IsParent); } set { this.SetValByKey(DefValAttr.IsParent, value); } } /// /// 词汇类别 /// public string WordsSort { get { return this.GetValStringByKey(DefValAttr.WordsSort); } set { this.SetValByKey(DefValAttr.WordsSort, value); } } /// /// 节点编号 /// public string FK_MapData { get { return this.GetValStringByKey(DefValAttr.FK_MapData); } set { this.SetValByKey(DefValAttr.FK_MapData, value); } } /// /// 节点对应字段 /// public string AttrKey { get { return this.GetValStringByKey(DefValAttr.AttrKey); } set { this.SetValByKey(DefValAttr.AttrKey, value); } } /// /// 是否历史词汇 /// public string LB { get { return this.GetValStringByKey(DefValAttr.LB); } set { this.SetValByKey(DefValAttr.LB, value); } } /// /// 人员编号 /// public string FK_Emp { get { return this.GetValStringByKey(DefValAttr.FK_Emp); } set { this.SetValByKey(DefValAttr.FK_Emp, value); } } /// /// 节点文本 /// public string CurValue { get { return this.GetValStringByKey(DefValAttr.CurValue); } set { this.SetValByKey(DefValAttr.CurValue, value); } } #endregion #region 构造方法 /// /// 默认值 /// public DefVal() { } /// /// map /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Sys_UserRegedit", "选择词汇"); map.CodeStruct = "2"; //设置PK. map.AddMyPK(); //秦2015-1-10 根据公司需求改动 以下是源码 //map.AddTBStringPK(DefValAttr.No, null, "编号", true, true, 1, 50, 20); //map.AddTBString(DefValAttr.EnsName, null, "类名称", false, true, 0, 100, 10); //map.AddTBString(DefValAttr.EnsDesc, null, "类描述", false, true, 0, 100, 10); //map.AddTBString(DefValAttr.AttrKey, null, "属性", false, true, 0, 100, 10); //map.AddTBString(DefValAttr.AttrDesc, null, "属性描述", false, false, 0, 100, 10); //map.AddTBString(DefValAttr.FK_Emp, null, "人员", false, true, 0, 100, 10); //map.AddTBString(DefValAttr.Val, null, "值", true, false, 0, 1000, 10); //map.AddTBString(DefValAttr.ParentNo, null, "父节点编号", false, false, 0, 50, 20); //map.AddTBInt(DefValAttr.IsParent, 0, "是否父节点", false, false); //map.AddTBString(DefValAttr.HistoryWords, null, "历史词汇", false, false, 0, 2000, 20); map.AddTBString(DefValAttr.FK_MapData, null, "实体", false, false, 0, 100, 20); map.AddTBString(DefValAttr.FK_Emp, null, "人员", false, true, 0, 100, 10); map.AddTBString(DefValAttr.AttrKey, null, "节点对应字段", false, false, 0, 50, 20); //map.AddTBInt(DefValAttr.WordsSort, 0, "词汇类型", false, false);//1,2,3... 退回-移交-表单...(暂时) map.AddTBInt(DefValAttr.LB, 0, "类别", false, false);//我的,历史,系统, map.AddTBString(DefValAttr.CurValue, null, "文本", false, true, 0, 4000, 10); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeInsert() { //设置主键. this.setMyPK(DBAccess.GenerGUID()); return base.beforeInsert(); } } /// /// 默认值s /// public class DefVals : EntitiesMyPK { /// /// 默认值 /// public DefVals() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new DefVal(); } } } }