public static void ys_AssetsStatus_GridLookUpEdit(DevExpress.XtraEditors.GridLookUpEdit Control) { #region 列名 DevExpress.XtraGrid.Columns.GridColumn ID = new DevExpress.XtraGrid.Columns.GridColumn(); ID.Name = "Id"; ID.Visible = true; ID.FieldName = "Id"; ID.Caption = "编号"; ID.VisibleIndex = -1; DevExpress.XtraGrid.Columns.GridColumn Name = new DevExpress.XtraGrid.Columns.GridColumn(); Name.Name = "StatusName"; Name.FieldName = "StatusName"; Name.Caption = "名称"; Name.VisibleIndex = 0; Name.Width = 100; Name.Visible = true; Control.Properties.PopupView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { ID, Name }); #endregion Control.Properties.ImmediatePopup = true; Control.Properties.NullText = ""; Control.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; Control.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; Control.Properties.DisplayMember = "StatusName"; Control.Properties.ValueMember = "Id"; Control.Properties.View.OptionsView.ColumnAutoWidth = false; Control.Properties.DataSource = InitalControlHelper.GetAllAssetsStatus(); }
/// <summary> ///获取指定状态的资产集合 /// </summary> /// <param name="enums">状态集合</param> /// <returns></returns> public static List <Models.ys_Assets> GetAssetListByStatus(params Utils.clsEnum.AssetsStatus[] enums) { if (enums == null) { return(InitalControlHelper.GetAssetsAllList()); } string[] subs = new string[enums.Length]; for (int i = 0; i < enums.Length; i++) { subs[i] = enums[i].ToString(); } return(InitalControlHelper.GetAssetsAllList().FindAll(a => (subs).Contains(a.StatusId))); }
public static void ACL_User_GridLookUpEdit(DevExpress.XtraEditors.GridLookUpEdit Control, bool IsBindingData = true) { #region 列名 DevExpress.XtraGrid.Columns.GridColumn ID = new DevExpress.XtraGrid.Columns.GridColumn(); ID.Name = "Id"; ID.Visible = false; ID.FieldName = "Id"; ID.Caption = "编号"; ID.VisibleIndex = -1; DevExpress.XtraGrid.Columns.GridColumn StaffCode = new DevExpress.XtraGrid.Columns.GridColumn(); StaffCode.Name = "SimpleCode"; StaffCode.FieldName = "SimpleCode"; StaffCode.Caption = "简码"; StaffCode.VisibleIndex = 0; StaffCode.Width = 60; StaffCode.Visible = true; DevExpress.XtraGrid.Columns.GridColumn Name = new DevExpress.XtraGrid.Columns.GridColumn(); Name.Name = "FullName"; Name.FieldName = "FullName"; Name.Caption = "职员"; Name.VisibleIndex = 1; Name.Visible = true; DevExpress.XtraGrid.Columns.GridColumn DeptNAME = new DevExpress.XtraGrid.Columns.GridColumn(); DeptNAME.Name = "DepartmentName"; DeptNAME.FieldName = "DepartmentName"; DeptNAME.VisibleIndex = 2; DeptNAME.Caption = "部门"; DeptNAME.Visible = true; Control.Properties.PopupView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { ID, StaffCode, Name, DeptNAME }); #endregion Control.Properties.DisplayMember = "FullName"; Control.Properties.ValueMember = "Id"; Control.Properties.ImmediatePopup = true; Control.Properties.NullText = ""; Control.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; Control.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; Control.Properties.View.OptionsView.ColumnAutoWidth = false; if (IsBindingData) { Control.Properties.DataSource = InitalControlHelper.GetAllUser(); } }
public static void ys_AssetsCategory_TreeListLookUpEdit(DevExpress.XtraEditors.TreeListLookUpEdit Control) { #region 列名 DevExpress.XtraTreeList.Columns.TreeListColumn ID = new DevExpress.XtraTreeList.Columns.TreeListColumn(); ID.Name = "Id"; ID.FieldName = "Id"; ID.Caption = "编号"; ID.VisibleIndex = -1; ID.Visible = false; DevExpress.XtraTreeList.Columns.TreeListColumn Name = new DevExpress.XtraTreeList.Columns.TreeListColumn(); Name.Name = "CategoryName"; Name.FieldName = "CategoryName"; Name.Caption = "类别"; Name.VisibleIndex = 1; Name.Width = 100; Name.Visible = true; DevExpress.XtraTreeList.Columns.TreeListColumn Code = new DevExpress.XtraTreeList.Columns.TreeListColumn(); Code.Name = "SimpleCode"; Code.FieldName = "SimpleCode"; Code.Caption = "简码"; Code.VisibleIndex = 2; Code.Width = 100; Code.Visible = true; Control.Properties.TreeList.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] { ID, Name, Code }); #endregion Control.Properties.DisplayMember = "CategoryName"; Control.Properties.ValueMember = "Id"; Control.Properties.TreeList.KeyFieldName = "Id"; Control.Properties.TreeList.ParentFieldName = "ParentId"; Control.Properties.ImmediatePopup = true; Control.Properties.NullText = ""; Control.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; Control.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; Control.Properties.DataSource = InitalControlHelper.GetAllAssetsCategory(); }
public static void Assets_GridLookUpEdit(DevExpress.XtraEditors.GridLookUpEdit Control, AssetsStatus[] statuses = null, bool IsBindingData = true) { #region 列名 DevExpress.XtraGrid.Columns.GridColumn StatusName = new DevExpress.XtraGrid.Columns.GridColumn(); StatusName.Name = "StatusName"; StatusName.Visible = true; StatusName.FieldName = "StatusName"; StatusName.Caption = "状态"; StatusName.VisibleIndex = 0; StatusName.Width = 40; DevExpress.XtraGrid.Columns.GridColumn ID = new DevExpress.XtraGrid.Columns.GridColumn(); ID.Name = "Id"; ID.Visible = false; ID.FieldName = "Id"; ID.Caption = "编号"; ID.VisibleIndex = -1; ID.Width = 40; DevExpress.XtraGrid.Columns.GridColumn Name = new DevExpress.XtraGrid.Columns.GridColumn(); Name.Name = "Name"; Name.FieldName = "Name"; Name.Caption = "名称"; Name.VisibleIndex = 2; Name.Width = 80; Name.Visible = true; DevExpress.XtraGrid.Columns.GridColumn code = new DevExpress.XtraGrid.Columns.GridColumn(); code.Name = "Barcode"; code.FieldName = "Barcode"; code.Caption = "编码"; code.VisibleIndex = 3; code.Width = 120; code.Visible = true; DevExpress.XtraGrid.Columns.GridColumn model = new DevExpress.XtraGrid.Columns.GridColumn(); model.Name = "Model"; model.Visible = true; model.FieldName = "Model"; model.Caption = "型号"; model.VisibleIndex = 4; DevExpress.XtraGrid.Columns.GridColumn Dept = new DevExpress.XtraGrid.Columns.GridColumn(); Dept.Name = "DepartmentName"; Dept.FieldName = "DepartmentName"; Dept.Caption = "部门"; Dept.VisibleIndex = 5; Dept.Visible = true; DevExpress.XtraGrid.Columns.GridColumn staff = new DevExpress.XtraGrid.Columns.GridColumn(); staff.Name = "UserName"; staff.FieldName = "UserName"; staff.Caption = "人员"; staff.VisibleIndex = 6; staff.Visible = true; DevExpress.XtraGrid.Columns.GridColumn stock = new DevExpress.XtraGrid.Columns.GridColumn(); stock.Name = "StockName"; stock.FieldName = "StockName"; stock.Caption = "仓库"; stock.VisibleIndex = 7; stock.Visible = true; Control.Properties.PopupView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { StatusName, ID, Name, code, model, Dept, staff, stock }); #endregion Control.Properties.ImmediatePopup = true; Control.Properties.NullText = ""; Control.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; Control.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; Control.Properties.DisplayMember = "Name"; Control.Properties.ValueMember = "Id"; Control.Properties.View.OptionsView.ColumnAutoWidth = false; if (IsBindingData) { Control.Properties.DataSource = InitalControlHelper.GetAssetListByStatus(statuses); } }