using BP.DA; using BP.Web; using BP.En; using BP.Sys; namespace BP.CCOA.KnowledgeManagement { /// /// 知识树 属性 /// public class KMTreeAttr : EntityTreeAttr { /// /// 组织编号 /// public const string OrgNo = "OrgNo"; /// /// /// 文件类型 /// public const string FileType = "FileType"; /// /// 记录人 /// public const string Rec = "Rec"; /// /// 记录人名称 /// public const string RecName = "RecName"; /// /// 记录日期 /// public const string RDT = "RDT"; /// /// 知识编号 /// public const string KnowledgeNo = "KnowledgeNo"; /// /// 是否删除. /// public const string IsDel = "IsDel"; } /// /// 知识树 /// public class KMTree : EntityTree { #region 基本属性 /// /// 组织编号 /// public string OrgNo { get { return this.GetValStrByKey(KMTreeAttr.OrgNo); } set { this.SetValByKey(KMTreeAttr.OrgNo, value); } } public string Rec { get { return this.GetValStrByKey(KMTreeAttr.Rec); } set { this.SetValByKey(KMTreeAttr.Rec, value); } } public string RecName { get { return this.GetValStrByKey(KMTreeAttr.RecName); } set { this.SetValByKey(KMTreeAttr.RecName, value); } } public string RDT { get { return this.GetValStrByKey(KMTreeAttr.RDT); } set { this.SetValByKey(KMTreeAttr.RDT, value); } } public string KnowledgeNo { get { return this.GetValStrByKey(KMTreeAttr.KnowledgeNo); } set { this.SetValByKey(KMTreeAttr.KnowledgeNo, value); } } #endregion #region 构造方法 /// /// 权限控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); if (WebUser.IsAdmin) { uac.IsUpdate = true; return uac; } return base.HisUAC; } } /// /// 知识树 /// public KMTree() { } public KMTree(string mypk) { this.Retrieve(); } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("OA_KMTree", "知识树"); map.AddTBStringPK(KMTreeAttr.No, null, "编号", false, false, 0, 50, 10); map.AddTBString(KMTreeAttr.Name, null, "名称", false, false, 0, 500, 10); map.AddTBString(KMTreeAttr.ParentNo, null, "父节点编号", false, false, 0, 50, 10); map.AddTBString(KMTreeAttr.KnowledgeNo, null, "知识编号", false, false, 0, 50, 10); map.AddTBInt(KMTreeAttr.FileType, 1, "文件类型", false, false); map.AddTBInt(KMTreeAttr.Idx, 0, "Idx", false, false); map.AddTBString(KMTreeAttr.OrgNo, null, "组织编号", false, false, 0, 100, 10); map.AddTBString(KMTreeAttr.Rec, null, "记录人", false, false, 0, 100, 10); map.AddTBString(KMTreeAttr.RecName, null, "记录人名称", false, false, 0, 100, 10, true); map.AddTBDateTime(KMTreeAttr.RDT, null, "记录时间", false, false); map.AddTBInt(KMTreeAttr.IsDel, 0, "IsDel", false, false); this._enMap = map; return this._enMap; } } #endregion #region 执行方法. protected override bool beforeInsert() { this.No = DBAccess.GenerGUID(); this.Rec = WebUser.No; this.RecName = WebUser.Name; if (BP.Difference.SystemConfig.CCBPMRunModel != CCBPMRunModel.Single) this.OrgNo = WebUser.OrgNo; return base.beforeInsert(); } protected override bool beforeUpdate() { return base.beforeUpdate(); } #endregion 执行方法. } /// /// 知识树 s /// public class KMTrees : EntitiesTree { #region 查询. #endregion 重写. #region 重写. /// /// 知识树 /// public KMTrees() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new KMTree(); } } #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((KMTree)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }