using BP.DA; using BP.En; namespace BP.CCBill.Template { /// /// 实体工具栏按钮属性 /// public class ToolbarBtnAttr : EntityMyPKAttr { #region 基本属性. /// /// 表单ID /// public const string FrmID = "FrmID"; /// /// 方法ID /// public const string BtnID = "BtnID"; /// /// 按钮标签 /// public const string BtnLab = "BtnLab"; /// /// 图标 /// public const string Icon = "Icon"; /// /// Idx /// public const string Idx = "Idx"; #endregion 基本属性. #region 外观. /// /// 宽度. /// public const string PopWidth = "PopWidth"; /// /// 高度 /// public const string PopHeight = "PopHeight"; #endregion 外观. public const string IsEnable = "IsEnable"; } /// /// 实体工具栏按钮 /// public class ToolbarBtn : EntityMyPK { #region 基本属性 /// /// 表单ID /// public string FrmID { get { return this.GetValStringByKey(ToolbarBtnAttr.FrmID); } set { this.SetValByKey(ToolbarBtnAttr.FrmID, value); } } public string Icon { get { return this.GetValStringByKey(ToolbarBtnAttr.Icon); } set { this.SetValByKey(ToolbarBtnAttr.Icon, value); } } /// /// 方法ID /// public string BtnID { get { return this.GetValStringByKey(ToolbarBtnAttr.BtnID); } set { this.SetValByKey(ToolbarBtnAttr.BtnID, value); } } public string BtnLab { get { return this.GetValStringByKey(ToolbarBtnAttr.BtnLab); } set { this.SetValByKey(ToolbarBtnAttr.BtnLab, value); } } public bool ItIsEnable { get { return this.GetValBooleanByKey(ToolbarBtnAttr.IsEnable); } set { this.SetValByKey(ToolbarBtnAttr.IsEnable, value); } } #endregion #region 构造方法 /// /// 实体工具栏按钮 /// public ToolbarBtn() { } /// /// 实体工具栏按钮 /// /// public ToolbarBtn(string mypk) { this.MyPK = mypk; this.Retrieve(); } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Frm_ToolbarBtn", "实体工具栏按钮"); map.AddMyPK(); //主键. map.AddTBString(ToolbarBtnAttr.BtnID, null, "按钮ID", true, true, 0, 300, 10); map.AddTBString(ToolbarBtnAttr.BtnLab, null, "标签", true, false, 0, 300, 10); //功能标记. map.AddTBString(ToolbarBtnAttr.FrmID, null, "表单ID", true, true, 0, 300, 10); map.AddTBString(ToolbarBtnAttr.Icon, null, "图标", true, false, 0, 50, 10, true); #region 外观. map.AddTBInt(ToolbarBtnAttr.PopHeight, 0, "弹窗高度", true, false); map.AddTBInt(ToolbarBtnAttr.PopWidth, 0, "弹窗宽度", true, false); #endregion 外观. //是否启用? map.AddBoolean(ToolbarBtnAttr.IsEnable, true, "是否启用?", true, true, true); map.AddTBInt(ToolbarBtnAttr.Idx, 0, "Idx", true, false); this._enMap = map; return this._enMap; } } #endregion #region 移动. public void DoUp() { this.DoOrderUp(ToolbarBtnAttr.FrmID, this.FrmID, ToolbarBtnAttr.Idx); } public void DoDown() { this.DoOrderDown(ToolbarBtnAttr.FrmID, this.FrmID, ToolbarBtnAttr.Idx); } #endregion 移动. protected override bool beforeInsert() { if (DataType.IsNullOrEmpty(this.MyPK) == true) this.MyPK = DBAccess.GenerGUID(); return base.beforeInsert(); } } /// /// 实体工具栏按钮 /// public class ToolbarBtns : EntitiesMyPK { /// /// 实体工具栏按钮 /// public ToolbarBtns() { } /// /// 实体工具栏按钮 /// /// 方法IDID public ToolbarBtns(int nodeid) { QueryObject qo = new QueryObject(this); qo.AddWhere(ToolbarBtnAttr.BtnID, nodeid); qo.DoQuery(); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new ToolbarBtn(); } } #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((ToolbarBtn)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }