public static _MenuItem GetBusinessMenuList(XtraForm FormQL, PhieuType Phieu, DelegationLib.CallFunction_MulIn_SinOut DOData) { List<PhieuType> Phieus = Phieu.CanCreateList; DelegationLib.CallFunction_MulIn_NoOut[] Actions = new DelegationLib.CallFunction_MulIn_NoOut[Phieus.Count]; string[] Titles = new string[Phieus.Count]; string[] ImageNames = new string[Phieus.Count]; PermissionItem[] Permissions = new PermissionItem[Phieus.Count]; for (int i = 0; i < Phieus.Count; i++) { PhieuType PhieuTo = Phieus[i]; Titles[i] = "Tạo " + PhieuTo.GetTitle(); ImageNames[i] = PhieuTo.GetImageName(); Permissions[i] = PhieuTo.AllowAdd; Actions[i] = delegate(List<object> ids) { if (ids != null && ids.Count > 0) { ProtocolForm.ShowModalForm(FormQL, PhieuTo.GetFormClassName(), DOData(ids)); } }; } return new _MenuItem(Titles, ImageNames, Phieu.GetIDField(), Actions, Permissions); }
public ItemInfo(string caption, string image, DelegationLib.CallFunction_MulIn_NoOut delegates, PermissionItem per) { this.caption = caption; this.image = image; this.delegates = delegates; this.per = per; }