using System; using BP.DA; using BP.En; namespace BP.CCBill.Template { /// /// 方法类型 /// public class GroupMethodType { /// /// 自定义 /// public const string Self = "Self"; /// /// 基础资料变更 /// public const string FlowBaseData = "FlowBaseData"; /// /// 新创建实体 /// public const string FlowNewEntity = "FlowNewEntity"; /// /// 其他业务组件 /// public const string FlowFlowEtc = "FlowFlowEtc"; } /// /// 分组 - 属性 /// public class GroupMethodAttr : EntityNoNameAttr { /// /// 表单ID /// public const string FrmID = "FrmID"; /// /// 顺序 /// public const string Idx = "Idx"; /// /// 方法类型 /// public const string MethodType = "MethodType"; /// /// 方法ID /// public const string MethodID = "MethodID"; /// /// Icon /// public const string Icon = "Icon"; /// /// 组织编号 /// public const string OrgNo = "OrgNo"; } /// /// 分组 /// public class GroupMethod : EntityNoName { #region 权限控制 /// /// 权限控制. /// public override UAC HisUAC { get { UAC uac = new UAC(); if (BP.Web.WebUser.No.Equals("admin") == true || BP.Web.WebUser.IsAdmin) { uac.IsDelete = true; uac.IsInsert = false; uac.IsUpdate = true; return uac; } uac.Readonly(); uac.IsView = false; return uac; } } #endregion 权限控制 #region 属性 /// /// 表单ID /// public string FrmID { get { return this.GetValStrByKey(GroupMethodAttr.FrmID); } set { this.SetValByKey(GroupMethodAttr.FrmID, value); } } public string OrgNo { get { return this.GetValStrByKey(GroupMethodAttr.OrgNo); } set { this.SetValByKey(GroupMethodAttr.OrgNo, value); } } public string MethodType { get { return this.GetValStrByKey(GroupMethodAttr.MethodType); } set { this.SetValByKey(GroupMethodAttr.MethodType, value); } } /// /// 顺序号 /// public int Idx { get { return this.GetValIntByKey(GroupMethodAttr.Idx); } set { this.SetValByKey(GroupMethodAttr.Idx, value); } } /// /// 图标 /// public string Icon { get { return this.GetValStrByKey(GroupMethodAttr.Icon); } set { this.SetValByKey(GroupMethodAttr.Icon, value); } } public string MethodID { get { return this.GetValStrByKey(GroupMethodAttr.MethodID); } set { this.SetValByKey(GroupMethodAttr.MethodID, value); } } #endregion #region 构造方法 /// /// GroupMethod /// public GroupMethod() { } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Frm_GroupMethod", "方法分组"); #region 字段. map.AddTBStringPK(GroupMethodAttr.No, null, "编号", true, true, 0, 150, 20); map.AddTBString(GroupMethodAttr.FrmID, null, "表单ID", true, true, 0, 200, 20); map.AddTBString(GroupMethodAttr.Name, null, "标签", true, false, 0, 500, 20, true); map.AddTBString(GroupMethodAttr.Icon, null, "Icon", true, true, 0, 200, 20, true); map.AddTBString(GroupMethodAttr.OrgNo, null, "OrgNo", true, true, 0, 40, 20, true); map.AddTBInt(GroupMethodAttr.Idx, 0, "顺序号", true, false); map.AddTBAtParas(3000); #endregion 字段. this._enMap = map; return this._enMap; } } #endregion #region 方法. protected override bool beforeDelete() { Methods ens = new Methods(); ens.Retrieve(MethodAttr.GroupID, this.No); if (ens.Count != 0) throw new Exception("err@该目录下有数据,您不能删除目录。"); return base.beforeDelete(); } protected override bool beforeUpdate() { return base.beforeUpdate(); } public string DoDown() { this.DoOrderDown(GroupMethodAttr.FrmID, this.FrmID, GroupMethodAttr.Idx); return "执行成功"; } public string DoUp() { this.DoOrderUp(GroupMethodAttr.FrmID, this.FrmID, GroupMethodAttr.Idx); return "执行成功"; } protected override bool beforeInsert() { //设置主键. if (DataType.IsNullOrEmpty(this.No) == true) this.No = DBAccess.GenerGUID(); this.OrgNo = BP.Web.WebUser.OrgNo; return base.beforeInsert(); } #endregion 方法. } /// /// 分组-集合 /// public class GroupMethods : EntitiesNoName { #region 构造 /// /// 分组s /// public GroupMethods() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new GroupMethod(); } } #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((GroupMethod)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }