public static DataTable ToDataTable(this IEnumerable en, JQGrid grid) { DataTable result = new DataTable(); DataView dataView = en as DataView; if (dataView != null) { result = dataView.ToTable(); } else { if (en != null) { result = IEnumerableExtensions.ObtainDataTableFromIEnumerable(en, grid); } } return result; }
internal static List<string> GetListOfColumns(JQGrid grid) { List<string> result = new List<string>(); grid.Columns.FindAll((JQGridColumn c) => c.EditType == EditType.DatePicker || c.EditType == EditType.AutoComplete).ForEach(delegate(JQGridColumn c) { result.Add(c.EditType.ToString().ToLower() + ":" + c.DataField); }); return result; }
internal static List<string> GetListOfSearchEditors(JQGrid grid) { List<string> result = new List<string>(); grid.Columns.FindAll((JQGridColumn c) => c.SearchType == SearchType.DatePicker || c.SearchType == SearchType.AutoComplete).ForEach(delegate(JQGridColumn c) { result.Add(c.SearchControlID); } ); return result; }
internal static string GetAttachEditorsFunction(JQGrid grid, string editorType, string editorControlID) { GridUtil.GetListOfColumns(grid); GridUtil.GetListOfEditors(grid); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("function(el) {"); stringBuilder.Append("setTimeout(function() {"); stringBuilder.AppendFormat("var ec = '{0}';", editorControlID); if (editorType == "datepicker") { stringBuilder.Append("if (typeof($(el).datepicker) !== 'function')"); stringBuilder.Append("alert('JQDatePicker javascript not present on the page. Please, include jquery.jqDatePicker.min.js');"); stringBuilder.Append("$(el).datepicker( eval(ec + '_dpid') );"); } if (editorType == "autocomplete") { stringBuilder.Append("if (typeof($(el).autocomplete) !== 'function')"); stringBuilder.Append("alert('JQAutoComplete javascript not present on the page. Please, include jquery.jqAutoComplete.min.js');"); stringBuilder.Append("$(el).autocomplete( eval(ec + '_acid') );"); } stringBuilder.Append("},200);"); stringBuilder.Append("}"); return stringBuilder.ToString(); }
public LowStockGridModel() { LowStockGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "LowStock", HeaderText = "最低库存量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Num", HeaderText = "可用量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "DifNum", HeaderText = "短缺量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, } }; LowStockGrid.AppearanceSettings.ShowRowNumbers = true; }
public LocatorBookGridModel() { LocatorBookGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "Code", HeaderText = "月份", DataType = typeof(string), }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), }, new JQGridColumn() { DataField = "LocatorName", HeaderText = "货位", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "InNum", HeaderText = "收入数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "OutNum", HeaderText = "发出数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Num", HeaderText = "结存数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, } }; LocatorBookGrid.ToolBarSettings.ShowRefreshButton = true; LocatorBookGrid.ToolBarSettings.ShowSearchButton = true; LocatorBookGrid.ToolBarSettings.ShowColumnChooser = true; LocatorBookGrid.ToolBarSettings.ShowExcelButton = true; LocatorBookGrid.SearchDialogSettings.MultipleSearch = true; LocatorBookGrid.AppearanceSettings.ShowRowNumbers = true; }
private static DataTable ObtainDataTableFromIEnumerable(IEnumerable ien, JQGrid grid) { DataTable dataTable = new DataTable(); foreach (object current in ien) { if (current is DbDataRecord) { DbDataRecord dbDataRecord = current as DbDataRecord; if (dataTable.Columns.Count == 0) { foreach (JQGridColumn jQGridColumn in grid.Columns) { dataTable.Columns.Add(jQGridColumn.DataField); } } DataRow dataRow = dataTable.NewRow(); foreach (JQGridColumn jQGridColumn2 in grid.Columns) { dataRow[jQGridColumn2.DataField] = dbDataRecord[jQGridColumn2.DataField]; } dataTable.Rows.Add(dataRow); } else { if (current is DataRow) { DataRow dataRow2 = current as DataRow; if (dataTable.Columns.Count == 0) { foreach (JQGridColumn jQGridColumn3 in grid.Columns) { dataTable.Columns.Add(jQGridColumn3.DataField); } } DataRow dataRow3 = dataTable.NewRow(); foreach (JQGridColumn jQGridColumn4 in grid.Columns) { dataRow3[jQGridColumn4.DataField] = dataRow2[jQGridColumn4.DataField]; } dataTable.Rows.Add(dataRow3); } else { Type type = current.GetType(); PropertyInfo[] properties = type.GetProperties(); if (dataTable.Columns.Count == 0) { PropertyInfo[] array = properties; for (int i = 0; i < array.Length; i++) { PropertyInfo propertyInfo = array[i]; Type type2 = propertyInfo.PropertyType; if (type2.IsGenericType && type2.GetGenericTypeDefinition() == typeof(Nullable <>)) { type2 = Nullable.GetUnderlyingType(type2); } dataTable.Columns.Add(propertyInfo.Name, type2); } } DataRow dataRow4 = dataTable.NewRow(); PropertyInfo[] array2 = properties; for (int j = 0; j < array2.Length; j++) { PropertyInfo propertyInfo2 = array2[j]; object value = propertyInfo2.GetValue(current, null); if (value != null) { dataRow4[propertyInfo2.Name] = value; } else { dataRow4[propertyInfo2.Name] = DBNull.Value; } } dataTable.Rows.Add(dataRow4); } } } return(dataTable); }
public MvcHtmlString JQGridPartial(JQGrid grid) { //JQGridRenderer jQGridRenderer = new JQGridRenderer(); return MvcHtmlString.Create(JQGridRenderer.RenderHtml(grid, JQGridRenderMode.Partial)); }
public MvcHtmlString JQGridScript(JQGrid grid) { //JQGridRenderer jQGridRenderer = new JQGridRenderer(); return MvcHtmlString.Create(JQGridRenderer.RenderHtml(grid, JQGridRenderMode.Script)); }
public CardDonateInventoryGrid() { CardGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", PrimaryKey = true, DataType = typeof(Guid), Visible = false, Searchable = false }, new JQGridColumn() { DataField = "CardNo", HeaderText = "卡号", DataType = typeof(string) }, new JQGridColumn() { DataField = "MemberName", HeaderText = "会员名", DataType = typeof(string) }, new JQGridColumn() { DataField = "Balance", HeaderText = "余额", DataType = typeof(decimal) }, new JQGridColumn() { DataField = "Recharge", HeaderText = "充值", DataType = typeof(decimal) }, new JQGridColumn() { DataField = "Points", HeaderText = "积分", DataType = typeof(decimal) }, new JQGridColumn() { DataField = "IdCard", HeaderText = "证件号", DataType = typeof(string) }, new JQGridColumn() { DataField = "LinkPhone", HeaderText = "联系电话", DataType = typeof(string) }, new JQGridColumn() { DataField = "LinkAddress", HeaderText = "联系地址", DataType = typeof(string) }, new JQGridColumn() { DataField = "Email", HeaderText = "Email", DataType = typeof(DateTime) }, new JQGridColumn() { DataField = "CardType", HeaderText = "卡类型", DataType = typeof(string) }, new JQGridColumn() { DataField = "CardLevel", HeaderText = "卡级别", DataType = typeof(string) }, new JQGridColumn() { DataField = "Status", HeaderText = "状态", DataType = typeof(string) }, new JQGridColumn() { DataField = "CreateDate", HeaderText = "发卡日期", DataType = typeof(string), Editable = false, }, new JQGridColumn() { DataField = "FullName", HeaderText = "发卡操作员", DataType = typeof(string) }, new JQGridColumn() { DataField = "DeptName", HeaderText = "发卡部门", DataType = typeof(string) } } }; CardGrid.ToolBarSettings.ShowSearchButton = true; CardGrid.SearchDialogSettings.MultipleSearch = true; CardGrid.HierarchySettings.HierarchyMode = HierarchyMode.Parent; CardGrid.ClientSideEvents.SubGridRowExpanded = "showInventorySubGrid"; CardGrid.MultiSelect = true; CardGrid.MultiSelectKey = MultiSelectKey.None; CardGrid.MultiSelectMode = MultiSelectMode.SelectOnCheckBoxClickOnly; CardGrid.ToolBarSettings.CustomButtons = new List <JQGridToolBarButton>() { new JQGridToolBarButton() { Position = ToolBarButtonPosition.Last, ToolTip = "批量设置商品赠送", Text = "批量设置商品赠送", OnClick = "customButtonClicked", ButtonIcon = "ui-icon-extlink" } }; InventoryGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings() { ShowEditIcon = true, ShowDeleteIcon = false }, }, new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "Code", HeaderText = "编码", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "Name", HeaderText = "名称", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "CategoryName", HeaderText = "存货分类", DataType = typeof(string), Editable = false, }, new JQGridColumn() { DataField = "UnitName", HeaderText = "计量单位", DataType = typeof(string), Editable = false, }, new JQGridColumn() { DataField = "SalePrice", HeaderText = "默认单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice0", HeaderText = "大杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice1", HeaderText = "中杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice2", HeaderText = "小杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint", HeaderText = "默认积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint0", HeaderText = "大杯积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint1", HeaderText = "中杯积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint2", HeaderText = "小杯积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "IsValidate", HeaderText = "是否赠送", DataType = typeof(bool), Editable = true, }, new JQGridColumn() { DataField = "InvalideDate", HeaderText = "有效期", DataType = typeof(DateTime), Editable = true } } }; InventoryGrid.AppearanceSettings.Caption = "存货档案"; InventoryGrid.ToolBarSettings.ShowSearchButton = true; InventoryGrid.ToolBarSettings.ShowEditButton = true; InventoryGrid.ToolBarSettings.ShowRefreshButton = true; InventoryGrid.SearchDialogSettings.MultipleSearch = true; InventoryGrid.HierarchySettings.HierarchyMode = HierarchyMode.Child; InventoryGrid.AutoWidth = false; InventoryGrid2 = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { DataField = "Code", HeaderText = "编码", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "Name", HeaderText = "名称", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "CategoryName", HeaderText = "存货分类", DataType = typeof(string), Editable = false, }, new JQGridColumn() { DataField = "UnitName", HeaderText = "计量单位", DataType = typeof(string), Editable = false, }, new JQGridColumn() { DataField = "SalePrice", HeaderText = "默认单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice0", HeaderText = "大杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice1", HeaderText = "中杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePrice2", HeaderText = "小杯单价", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint", HeaderText = "默认积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint0", HeaderText = "大杯积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint1", HeaderText = "中杯积分", DataType = typeof(decimal), Editable = false }, new JQGridColumn() { DataField = "SalePoint2", HeaderText = "小杯积分", DataType = typeof(decimal), Editable = false }, } }; //InventoryGrid2.AppearanceSettings.Caption = "赠送商品"; InventoryGrid2.SearchDialogSettings.MultipleSearch = true; InventoryGrid2.MultiSelect = true; InventoryGrid2.MultiSelectKey = MultiSelectKey.None; InventoryGrid2.MultiSelectMode = MultiSelectMode.SelectOnRowClick; }
public JsonDelDialog(JQGrid grid) { this._jsonValues = new Hashtable(); this._grid = grid; }
public LinesGridModel() { LinesGrid = new JQGrid() { AutoWidth = true, Height = Unit.Percentage(100), Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", PrimaryKey = true, Visible = false }, new JQGridColumn() { DataField = "Code", DataType = typeof(string), HeaderText = "编码", Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator() }, }, new JQGridColumn() { DataField = "Name", DataType = typeof(string), HeaderText = "名称", Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator() }, }, new JQGridColumn() { DataField = "Mileage", DataType = typeof(decimal), HeaderText = "里程(公里)", Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator(), new Trirand.Web.Mvc.NumberValidator() }, }, new JQGridColumn() { DataField = "Comment", DataType = typeof(string), Editable = true, HeaderText = "描述", EditType = EditType.TextArea }, } }; LinesGrid.ToolBarSettings.ShowAddButton = true; LinesGrid.ToolBarSettings.ShowEditButton = true; LinesGrid.ToolBarSettings.ShowRefreshButton = true; LinesGrid.ToolBarSettings.ShowSearchButton = true; LinesGrid.AppearanceSettings.Caption = "运输线路"; LinesGrid.SearchDialogSettings.MultipleSearch = true; LinesGrid.SortSettings.InitialSortColumn = "Code"; }
public ConsItemGridModel() { ConsItemGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "iSerial", HeaderText = "流水", DataType = typeof(Int64), PrimaryKey = true, }, new JQGridColumn() { DataField = "vcAssName", HeaderText = "会员名称", DataType = typeof(string), }, new JQGridColumn() { DataField = "vcAssType", HeaderText = "会员类型", DataType = typeof(string), }, new JQGridColumn() { DataField = "vcCardID", HeaderText = "会员卡号", DataType = typeof(string), }, new JQGridColumn() { DataField = "vcGoodsName", HeaderText = "商品名称", DataType = typeof(string), }, new JQGridColumn() { DataField = "nPrice", HeaderText = "单价", DataType = typeof(decimal), }, new JQGridColumn() { DataField = "iCount", HeaderText = "数量", DataType = typeof(int), }, new JQGridColumn() { DataField = "nFee", HeaderText = "合计", DataType = typeof(decimal), }, new JQGridColumn() { DataField = "vcConsType", HeaderText = "付款类型", DataType = typeof(string), }, new JQGridColumn() { DataField = "vcComments", HeaderText = "备注", DataType = typeof(string), }, new JQGridColumn() { DataField = "cFlag", HeaderText = "有效状态", DataType = typeof(string), }, new JQGridColumn() { DataField = "dtConsDate", HeaderText = "消费日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "vcOperName", HeaderText = "操作员", DataType = typeof(string), }, new JQGridColumn() { DataField = "vcDeptID", HeaderText = "门店", DataType = typeof(string), }, } }; }
public CategoryDeptGridModel() { CategoryGrid = new JQGrid() { Width = 900, Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { DataField = "Code", HeaderText = "编码", DataType = typeof(string), }, new JQGridColumn() { DataField = "Name", HeaderText = "名称", DataType = typeof(string), }, new JQGridColumn() { DataField = "Comment", HeaderText = "备注", DataType = typeof(string), }, new JQGridColumn() { DataField = "CategoryType", DataType = typeof(int), Visible = false, Searchable = false, SearchToolBarOperation = SearchOperation.IsEqualTo, }, } }; CategoryGrid.ToolBarSettings.ShowSearchButton = true; CategoryGrid.ToolBarSettings.ShowRefreshButton = true; CategoryGrid.SearchDialogSettings.MultipleSearch = true; CategoryGrid.MultiSelect = true; CategoryGrid.MultiSelectKey = MultiSelectKey.None; CategoryGrid.MultiSelectMode = MultiSelectMode.SelectOnCheckBoxClickOnly; CategoryGrid.HierarchySettings.HierarchyMode = HierarchyMode.Parent; CategoryGrid.ToolBarSettings.CustomButtons = new List <JQGridToolBarButton>() { new JQGridToolBarButton() { Position = ToolBarButtonPosition.Last, ToolTip = "批量设置分类门店", Text = "<span class='ui-pg-button-text'>批量设置分类门店</span>", OnClick = "customButtonClicked", ButtonIcon = "ui-icon-extlink" } }; DeptGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings() { ShowDeleteIcon = false }, }, new JQGridColumn() { DataField = "DeptId", PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { HeaderText = "选择", DataField = "IsSelected", DataType = typeof(bool), Editable = true, }, new JQGridColumn() { HeaderText = "编码", DataField = "DeptCode", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "名称", DataField = "DeptName", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "地址", DataField = "Address", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "描述", DataField = "Comment", DataType = typeof(string), }, new JQGridColumn() { DataField = "DeptType", DataType = typeof(int), Visible = false, Searchable = false, SearchToolBarOperation = SearchOperation.IsEqualTo, }, } }; DeptGrid.AppearanceSettings.Caption = "门店"; DeptGrid.ToolBarSettings.ShowRefreshButton = true; DeptGrid.ToolBarSettings.ShowSearchButton = true; DeptGrid.ToolBarSettings.ShowEditButton = true; DeptGrid.AutoWidth = false; DeptGrid.Width = 700; DeptGrid.Height = Unit.Percentage(100); DeptGrid.HierarchySettings.HierarchyMode = HierarchyMode.Child; Dept2Grid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "DeptId", PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { HeaderText = "编码", DataField = "DeptCode", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "名称", DataField = "DeptName", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "地址", DataField = "Address", DataType = typeof(string), }, new JQGridColumn() { HeaderText = "描述", DataField = "Comment", DataType = typeof(string), }, new JQGridColumn() { DataField = "DeptType", DataType = typeof(int), Visible = false, Searchable = false, SearchToolBarOperation = SearchOperation.IsEqualTo, }, } }; Dept2Grid.ToolBarSettings.ShowRefreshButton = true; Dept2Grid.ToolBarSettings.ShowSearchButton = true; Dept2Grid.AutoWidth = false; Dept2Grid.Width = 600; Dept2Grid.Height = Unit.Percentage(100); Dept2Grid.MultiSelect = true; Dept2Grid.MultiSelectKey = MultiSelectKey.None; Dept2Grid.MultiSelectMode = MultiSelectMode.SelectOnCheckBoxClickOnly; }
public ManageCardsGridModel() { CardsGrid = new JQGrid() { AutoWidth = true, Height = Unit.Percentage(100), Columns = new List <JQGridColumn>() { //new JQGridColumn() //{ // DataField="Id", // DataType = typeof(Guid), // PrimaryKey=true, // Visible=false //}, new JQGridColumn() { DataField = "CardNo", HeaderText = "卡号", PrimaryKey = true, DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "Status", HeaderText = "状态", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "PlateNo", HeaderText = "车牌号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "BrandModel", HeaderText = "品牌型号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "MotorNo", HeaderText = "发动机号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "OwnerName", HeaderText = "车主", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "DeptName", HeaderText = "部门", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "IssueOper", HeaderText = "发卡操作员", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "CreateDate", HeaderText = "发卡日期", DataType = typeof(DateTime), Editable = false }, new JQGridColumn() { DataField = "LossOper", HeaderText = "挂失操作员", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "LossDate", HeaderText = "挂失日期", DataType = typeof(DateTime), Editable = false }, new JQGridColumn() { DataField = "FoundOper", HeaderText = "解挂操作员", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "FoundDate", HeaderText = "解挂日期", DataType = typeof(DateTime), Editable = false }, new JQGridColumn() { DataField = "SecondCardNo", HeaderText = "补卡卡号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "AddOper", HeaderText = "补卡操作员", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "AddDate", HeaderText = "补卡日期", DataType = typeof(DateTime), Editable = false }, new JQGridColumn() { DataField = "AddReason", HeaderText = "补卡原因", DataType = typeof(string), Editable = false } } }; CardsGrid.AppearanceSettings.Caption = "IC卡清单"; CardsGrid.ToolBarSettings.ShowSearchButton = true; CardsGrid.ToolBarSettings.ShowEditButton = false; CardsGrid.ToolBarSettings.ShowRefreshButton = true; CardsGrid.SearchDialogSettings.MultipleSearch = true; CardsGrid.ToolBarSettings.CustomButtons = new List <JQGridToolBarButton>() { new JQGridToolBarButton() { Position = ToolBarButtonPosition.Last, ToolTip = "导出EXCEL", Text = "导出", OnClick = "customButtonClicked", ButtonIcon = "ui-icon-extlink" } }; }
public AddCardsGridModel() { CardsGrid = new JQGrid() { AutoWidth = true, Height = Unit.Percentage(100), Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false }, new JQGridColumn() { DataField = "IsInUser", DataType = typeof(bool), HeaderText = "已挂失", Editable = false, EditType = EditType.CheckBox, SearchType = SearchType.DropDown, Formatter = new CheckBoxFormatter() }, new JQGridColumn() { DataField = "CardNo", HeaderText = "卡号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "SecondCardNo", HeaderText = "补卡卡号", DataType = typeof(string), Editable = true, //EditType = EditType.Custom, //EditTypeCustomCreateElement="createCardElement", //EditTypeCustomGetValue = "getCardElementValue" EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator(), new NumberValidator(), new Trirand.Web.Mvc.CustomValidator() { ValidationFunction = "validateCard", } } }, new JQGridColumn() { DataField = "AddReason", HeaderText = "补卡原因", DataType = typeof(string), Editable = true }, new JQGridColumn() { DataField = "PlateNo", HeaderText = "车牌号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "BrandModel", HeaderText = "品牌型号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "MotorNo", HeaderText = "发动机号", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "FullName", HeaderText = "操作员", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "DeptName", HeaderText = "部门", DataType = typeof(string), Editable = false }, new JQGridColumn() { DataField = "LossDate", HeaderText = "挂失日期", DataType = typeof(DateTime), Editable = false } } }; CardsGrid.AppearanceSettings.Caption = "补卡"; CardsGrid.ToolBarSettings.ShowSearchButton = true; CardsGrid.ToolBarSettings.ShowEditButton = true; CardsGrid.ToolBarSettings.ShowRefreshButton = true; CardsGrid.SearchDialogSettings.MultipleSearch = true; }
public JQGrid GetJQGrid(DataTable dataTable, int totalRecords) { if (dataTable.Columns.Contains("PageNumber")) dataTable.Columns.Remove("PageNumber"); JQGrid jqg = new JQGrid { page = page, records = totalRecords, total = Convert.ToInt32(Math.Ceiling((double)totalRecords / rows)) }; jqg.AddRows(dataTable); return jqg; }
public JsonSearchToolBar(JQGrid grid) { this._jsonValues = new Hashtable(); this._grid = grid; }
public ShelfLifeWarningGridModel() { ShelfLifeWarningGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "Num", HeaderText = "数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Batch", HeaderText = "批号", DataType = typeof(string), }, new JQGridColumn() { DataField = "MadeDate", HeaderText = "生产日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "ShelfLife", HeaderText = "保质期", DataType = typeof(int), }, new JQGridColumn() { DataField = "ShelfLifeTypeName", HeaderText = "保质期单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvalidDate", HeaderText = "失效日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "LocatorName", HeaderText = "货位", DataType = typeof(string), }, } }; ShelfLifeWarningGrid.AppearanceSettings.ShowRowNumbers = true; }
public DriversGridModel() { DriversGrid = new JQGrid() { AutoWidth = true, Height = Unit.Percentage(100), Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), Visible = false, PrimaryKey = true }, new JQGridColumn() { DataField = "Code", DataType = typeof(string), HeaderText = "编码", Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator() }, }, new JQGridColumn() { DataField = "Name", DataType = typeof(string), HeaderText = "姓名", Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator() }, }, new JQGridColumn() { DataField = "DriverNo", DataType = typeof(string), HeaderText = "驾驶证号", Editable = true }, new JQGridColumn() { DataField = "Telephone", DataType = typeof(string), HeaderText = "电话", Editable = true }, new JQGridColumn() { DataField = "Address", DataType = typeof(string), HeaderText = "地址", Editable = true }, new JQGridColumn() { DataField = "IdCardNo", DataType = typeof(string), HeaderText = "身份证号", Editable = true }, new JQGridColumn() { DataField = "Comment", DataType = typeof(string), HeaderText = "描述", Editable = true } } }; DriversGrid.AppearanceSettings.Caption = "驾驶员信息"; DriversGrid.ToolBarSettings.ShowSearchButton = true; DriversGrid.ToolBarSettings.ShowAddButton = true; //DriversGrid.ToolBarSettings.ShowDeleteButton = true; DriversGrid.ToolBarSettings.ShowEditButton = true; DriversGrid.ToolBarSettings.ShowRefreshButton = true; }
public JsonColModel(JQGrid grid) { this._jsonValues = new Hashtable(); this._grid = grid; }
public JsonColModel(JQGridColumn column, JQGrid grid) : this(grid) { this.FromColumn(column); }
public static string RemoveQuotesForJavaScriptMethods(string input, JQGrid grid) { string text = input; foreach (JQGridColumn jQGridColumn in grid.Columns) { if (jQGridColumn.Formatter != null && jQGridColumn.Formatter.Count > 0 && jQGridColumn.Formatter[0] != null) { JQGridColumnFormatter jQGridColumnFormatter = jQGridColumn.Formatter[0]; if (jQGridColumnFormatter is CustomFormatter) { CustomFormatter customFormatter = (CustomFormatter)jQGridColumnFormatter; string oldValue = string.Format("\"formatter\":\"{0}\"", customFormatter.FormatFunction); string newValue = string.Format("\"formatter\":{0}", customFormatter.FormatFunction); text = text.Replace(oldValue, newValue); oldValue = string.Format("\"unformat\":\"{0}\"", customFormatter.UnFormatFunction); newValue = string.Format("\"unformat\":{0}", customFormatter.UnFormatFunction); text = text.Replace(oldValue, newValue); } } foreach (JQGridEditClientSideValidator jQGridEditClientSideValidator in jQGridColumn.EditClientSideValidators) { if (jQGridEditClientSideValidator is CustomValidator) { CustomValidator customValidator = (CustomValidator)jQGridEditClientSideValidator; string oldValue2 = string.Format("\"custom_func\":\"{0}\"", customValidator.ValidationFunction); string newValue2 = string.Format("\"custom_func\":{0}", customValidator.ValidationFunction); text = text.Replace(oldValue2, newValue2); } } if (jQGridColumn.EditType == EditType.Custom) { string oldValue3 = string.Format("\"custom_element\":\"{0}\"", jQGridColumn.EditTypeCustomCreateElement); string newValue3 = string.Format("\"custom_element\":{0}", jQGridColumn.EditTypeCustomCreateElement); text = text.Replace(oldValue3, newValue3); oldValue3 = string.Format("\"custom_value\":\"{0}\"", jQGridColumn.EditTypeCustomGetValue); newValue3 = string.Format("\"custom_value\":{0}", jQGridColumn.EditTypeCustomGetValue); text = text.Replace(oldValue3, newValue3); } if ((jQGridColumn.Editable && jQGridColumn.EditType == EditType.DatePicker) || jQGridColumn.EditType == EditType.AutoComplete) { string attachEditorsFunction = GridUtil.GetAttachEditorsFunction(grid, jQGridColumn.EditType.ToString().ToLower(), jQGridColumn.EditorControlID); text = text.Replace(string.Concat(new object[] { '"', "attachEditControlsScript", jQGridColumn.DataField, '"' }), attachEditorsFunction); text = text.Replace('"' + "dataInit" + '"', "dataInit"); } if ((jQGridColumn.Searchable && jQGridColumn.SearchType == SearchType.DatePicker) || jQGridColumn.SearchType == SearchType.AutoComplete) { string attachEditorsFunction2 = GridUtil.GetAttachEditorsFunction(grid, jQGridColumn.SearchType.ToString().ToLower(), jQGridColumn.SearchControlID); text = text.Replace(string.Concat(new object[] { '"', "attachSearchControlsScript", jQGridColumn.DataField, '"' }), attachEditorsFunction2); text = text.Replace('"' + "dataInit" + '"', "dataInit"); } } return(text); }
public void SetUpGrid(JQGrid grid) { grid.AppearanceSettings.Caption = this.Title; }
public ComponentJqGridModel() { OrdersGrid = new JQGrid { Columns = new List <JQGridColumn>() { new JQGridColumn { DataField = "ComponentID", PrimaryKey = true, Editable = false, Visible = false }, new JQGridColumn { DataField = "SerialNumber", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "LeaseTag", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "SRNumber", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "StatementName", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "GID", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "Note", Editable = true, EditType = Trirand.Web.Mvc.EditType.TextArea, DataType = typeof(string), Width = 200 }, new JQGridColumn { DataField = "Make", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "ComponentType", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "Model", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "BeginDate", Editable = true, DataType = typeof(DateTime) }, new JQGridColumn { DataField = "EndDate", Editable = true, DataType = typeof(DateTime) }, new JQGridColumn { DataField = "DepartmentName", Editable = true, DataType = typeof(string), Width = 200 }, new JQGridColumn { DataField = "Fund", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "Org", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "Program", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "MonthlyCharge", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "RateLevel", Editable = true, DataType = typeof(string), Width = 100 }, new JQGridColumn { DataField = "Term", Editable = true, DataType = typeof(int), Width = 75 }, new JQGridColumn { DataField = "Phone", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "Building", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "Room", Editable = true, DataType = typeof(string) }, new JQGridColumn { DataField = "ContractNumber", Editable = true, DataType = typeof(string) } } }; OrdersGrid.ToolBarSettings.ShowRefreshButton = true; OrdersGrid.PagerSettings.ScrollBarPaging = true; OrdersGrid.PagerSettings.PageSize = 100; OrdersGrid.Height = 700; OrdersGrid.EditDialogSettings.Width = 700; OrdersGrid.ToolBarSettings.ShowSearchToolBar = true; OrdersGrid.SortSettings.InitialSortColumn = "SRNumber"; OrdersGrid.SortSettings.InitialSortDirection = SortDirection.Desc; OrdersGrid.ToolBarSettings.ShowEditButton = true; OrdersGrid.ToolBarSettings.ShowDeleteButton = true; OrdersGrid.EditDialogSettings.CloseAfterEditing = true; OrdersGrid.ClientSideEvents.GridInitialized = "initGrid"; OrdersGrid.ClientSideEvents.BeforeEditDialogShown = "BeforeEdit"; OrdersGrid.ClientSideEvents.AfterEditDialogShown = "AfterEdit"; }
public MvcHtmlString JQGrid(JQGrid grid, string id) { //JQGridRenderer jQGridRenderer = new JQGridRenderer(); grid.ID = id; return MvcHtmlString.Create(JQGridRenderer.RenderHtml(grid, JQGridRenderMode.Full)); }
private void SetupVirtualScrollingGrid(JQGrid grid) { grid.PagerSettings.ScrollBarPaging = true; grid.PagerSettings.PageSize = 20; grid.Height = System.Web.UI.WebControls.Unit.Pixel(400); }
public StockLocatorGridModel() { StockLocatorGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "Num", HeaderText = "台账结存数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "LocatorNum", HeaderText = "货位结存数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "NumDif", HeaderText = "结存数量差额", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Batch", HeaderText = "批号", DataType = typeof(string), }, new JQGridColumn() { DataField = "MadeDate", HeaderText = "生产日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "ShelfLife", HeaderText = "保质期", DataType = typeof(int), }, new JQGridColumn() { DataField = "ShelfLifeType", HeaderText = "保质期单位", DataType = typeof(int), }, new JQGridColumn() { DataField = "InvalidDate", HeaderText = "失效日期", DataType = typeof(DateTime), }, } }; StockLocatorGrid.ToolBarSettings.ShowRefreshButton = true; StockLocatorGrid.ToolBarSettings.ShowSearchButton = true; StockLocatorGrid.ToolBarSettings.ShowExcelButton = true; StockLocatorGrid.ToolBarSettings.ShowColumnChooser = true; StockLocatorGrid.SearchDialogSettings.MultipleSearch = true; StockLocatorGrid.AppearanceSettings.ShowRowNumbers = true; }
public static string RemoveQuotesForJavaScriptMethods(string input, JQGrid grid) { string text = input; foreach (JQGridColumn current in grid.Columns) { if (current.Formatter != null) { JQGridColumnFormatter formatter = current.Formatter; if (formatter is CustomFormatter) { CustomFormatter customFormatter = (CustomFormatter)formatter; string oldValue = string.Format("\"formatter\":\"{0}\"", customFormatter.FormatFunction); string newValue = string.Format("\"formatter\":{0}", customFormatter.FormatFunction); text = text.Replace(oldValue, newValue); oldValue = string.Format("\"unformat\":\"{0}\"", customFormatter.UnFormatFunction); newValue = string.Format("\"unformat\":{0}", customFormatter.UnFormatFunction); text = text.Replace(oldValue, newValue); } } foreach (JQGridEditClientSideValidator current2 in current.EditClientSideValidators) { if (current2 is CustomValidator) { CustomValidator customValidator = (CustomValidator)current2; string oldValue2 = string.Format("\"custom_func\":\"{0}\"", customValidator.ValidationFunction); string newValue2 = string.Format("\"custom_func\":{0}", customValidator.ValidationFunction); text = text.Replace(oldValue2, newValue2); } } if (current.EditType == EditType.Custom) { string oldValue3 = string.Format("\"custom_element\":\"{0}\"", current.EditTypeCustomCreateElement); string newValue3 = string.Format("\"custom_element\":{0}", current.EditTypeCustomCreateElement); text = text.Replace(oldValue3, newValue3); oldValue3 = string.Format("\"custom_value\":\"{0}\"", current.EditTypeCustomGetValue); newValue3 = string.Format("\"custom_value\":{0}", current.EditTypeCustomGetValue); text = text.Replace(oldValue3, newValue3); } if ((current.Editable && current.EditType == EditType.DatePicker) || current.EditType == EditType.AutoComplete) { string attachEditorsFunction = GridUtil.GetAttachEditorsFunction(grid, current.EditType.ToString().ToLower(), current.EditorControlID); text = text.Replace(string.Concat(new object[] { '"', "attachEditControlsScript", current.DataField, '"' }), attachEditorsFunction); text = text.Replace('"' + "dataInit" + '"', "dataInit"); } if ((current.Searchable && current.SearchType == SearchType.DatePicker) || current.SearchType == SearchType.AutoComplete) { string attachEditorsFunction2 = GridUtil.GetAttachEditorsFunction(grid, current.SearchType.ToString().ToLower(), current.SearchControlID); text = text.Replace(string.Concat(new object[] { '"', "attachSearchControlsScript", current.DataField, '"' }), attachEditorsFunction2); text = text.Replace('"' + "dataInit" + '"', "dataInit"); } } return text; }
public DeptOperManageGridModel() { DeptOperManageGrid = new EntityJQGrid() { Width = 1100, Columns = new List <JQGridColumn>() { new JQGridColumn() { EditActionIconsColumn = true, Viewable = false, Hidedlg = true, }, new JQGridColumn() { DataField = "vcOperID", HeaderText = "客户端操作员编号", DataType = typeof(string), PrimaryKey = true, Editable = true, Width = 200, }, new JQGridColumn() { DataField = "vcOperName", HeaderText = "客户端操作员名称", DataType = typeof(string), Editable = true, Width = 200, }, new JQGridColumn() { DataField = "vcDeptId", HeaderText = "门店", DataType = typeof(string), Editable = true, }, //new JQGridColumn() //{ // DataField="DeptName", // HeaderText="门店", // DataType=typeof(string), // Searchable=false, // Visible=false, // Exportable=true, // Hidedlg=true, //}, new JQGridColumn() { DataField = "vcLimit", HeaderText = "权限", DataType = typeof(string), Editable = true }, new JQGridColumn() { DataField = "vcActiveFlag", HeaderText = "激活标志", DataType = typeof(string), Editable = true }, new JQGridColumn() { DataField = "vcPwdBeginFlag", HeaderText = "密码初始化标志", DataType = typeof(string), Editable = true }, new JQGridColumn() { DataField = "IsDiscount", HeaderText = "是否折扣", DataType = typeof(bool), Editable = true }, } }; DeptOperManageGrid.AddDialogSettings.BottomInfo = "新增客户端操作员时,密码默认为:000000"; DeptOperManageGrid.EditDialogSettings.BottomInfo = "密码初始化将会把客户端操作员登录的密码初始化为:000000"; DeptOperManageGrid.HierarchySettings.HierarchyMode = HierarchyMode.Parent; DeptOperManageGrid.ClientSideEvents.SubGridRowExpanded = "showSubGrid"; DeptOperManageGrid.ClientSideEvents.AfterAddDialogShown = "enableFields"; DeptOperManageGrid.ClientSideEvents.AfterEditDialogShown = "disableFields"; FuncGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { Width = 100, EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings() { ShowEditIcon = true, ShowDeleteIcon = false }, }, //new JQGridColumn() //{ // DataField="cnvcFuncAddress", // DataType=typeof(string), // Visible=false, // PrimaryKey=true, //}, new JQGridColumn() { DataField = "IsInRole", HeaderText = "选择", DataType = typeof(bool), Editable = true, }, new JQGridColumn() { DataField = "cnvcFuncName", HeaderText = "功能名称", DataType = typeof(string), PrimaryKey = true, }, new JQGridColumn() { DataField = "cnvcFuncParentName", HeaderText = "菜单名称", DataType = typeof(string), //EditFieldAttributes=new List<JQGridEditFieldAttribute>() { new JQGridEditFieldAttribute() { Name = "disabled", Value = "disabled" } }, }, } }; FuncGrid.AutoWidth = false; FuncGrid.Width = 600; FuncGrid.ToolBarSettings.ShowEditButton = true; FuncGrid.ToolBarSettings.ShowRefreshButton = true; FuncGrid.ToolBarSettings.ShowSearchButton = true; FuncGrid.HierarchySettings.HierarchyMode = HierarchyMode.Child; }
private void SetupAddGridModel(JQGrid grid) { grid.DataUrl = Url.Action("Add_RequestData"); grid.EditUrl = Url.Action("Add_EditData"); }
private static DataTable ObtainDataTableFromIEnumerable(IEnumerable ien, JQGrid grid) { DataTable dataTable = new DataTable(); foreach (object current in ien) { if (current is DbDataRecord) { DbDataRecord dbDataRecord = current as DbDataRecord; if (dataTable.Columns.Count == 0) { foreach (JQGridColumn current2 in grid.Columns) { dataTable.Columns.Add(current2.DataField); } } DataRow dataRow = dataTable.NewRow(); foreach (JQGridColumn current3 in grid.Columns) { dataRow[current3.DataField] = dbDataRecord[current3.DataField]; } dataTable.Rows.Add(dataRow); } else { if (current is DataRow) { DataRow dataRow2 = current as DataRow; if (dataTable.Columns.Count == 0) { foreach (JQGridColumn current4 in grid.Columns) { dataTable.Columns.Add(current4.DataField); } } DataRow dataRow3 = dataTable.NewRow(); foreach (JQGridColumn current5 in grid.Columns) { dataRow3[current5.DataField] = dataRow2[current5.DataField]; } dataTable.Rows.Add(dataRow3); } else { Type type = current.GetType(); PropertyInfo[] properties = type.GetProperties(); if (dataTable.Columns.Count == 0) { PropertyInfo[] array = properties; for (int i = 0; i < array.Length; i++) { PropertyInfo propertyInfo = array[i]; Type type2 = propertyInfo.PropertyType; if (type2.IsGenericType && type2.GetGenericTypeDefinition() == typeof(Nullable<>)) { type2 = Nullable.GetUnderlyingType(type2); } dataTable.Columns.Add(propertyInfo.Name, type2); } } DataRow dataRow4 = dataTable.NewRow(); PropertyInfo[] array2 = properties; for (int j = 0; j < array2.Length; j++) { PropertyInfo propertyInfo2 = array2[j]; object value = propertyInfo2.GetValue(current, null); if (value != null) { dataRow4[propertyInfo2.Name] = value; } else { dataRow4[propertyInfo2.Name] = DBNull.Value; } } dataTable.Rows.Add(dataRow4); } } } return dataTable; }
private void SetupManageGridModel(JQGrid grid) { grid.DataUrl = Url.Action("Manage_RequestData"); grid.EditUrl = Url.Action("Manage_EditData"); }
public RoleAssignGridModel() { this.RolesGrid = new JQGrid() { ID = "RolesGrid", Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "RoleId", PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "RoleName", HeaderText = "角色名", DataType = typeof(string) }, new JQGridColumn() { DataField = "Description", HeaderText = "角色描述", DataType = typeof(string) } } }; RolesGrid.ToolBarSettings.ShowRefreshButton = true; RolesGrid.ToolBarSettings.ShowSearchButton = true; RolesGrid.HierarchySettings.HierarchyMode = HierarchyMode.Parent; RolesGrid.ClientSideEvents.SubGridRowExpanded = "showUsersSubGrid"; this.UsersGrid = new JQGrid() { ID = "UsersGrid", Columns = new List <JQGridColumn>() { new JQGridColumn() { Width = 100, EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings() { ShowEditIcon = true, ShowDeleteIcon = false }, }, new JQGridColumn() { DataField = "IsInRole", HeaderText = "选择", DataType = typeof(bool), Editable = true, }, new JQGridColumn() { DataField = "UserId", PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "UserName", HeaderText = "用户名", DataType = typeof(string) }, new JQGridColumn() { DataField = "FullName", HeaderText = "姓名", DataType = typeof(string) }, new JQGridColumn() { DataField = "DeptName", HeaderText = "门店", DataType = typeof(string) } } }; UsersGrid.AutoWidth = false; UsersGrid.Width = 600; UsersGrid.ToolBarSettings.ShowEditButton = true; UsersGrid.ToolBarSettings.ShowRefreshButton = true; UsersGrid.ToolBarSettings.ShowSearchButton = true; UsersGrid.HierarchySettings.HierarchyMode = HierarchyMode.Child; }
private void SetupLossGridModel(JQGrid grid) { grid.DataUrl = Url.Action("Loss_RequestData"); grid.EditUrl = Url.Action("Loss_EditData"); }
public AuthorizationGridModel() { this.RolesGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "RoleId", PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "RoleName", HeaderText = "角色名", DataType = typeof(string) }, new JQGridColumn() { DataField = "Description", HeaderText = "角色描述", DataType = typeof(string) } }, }; RolesGrid.ToolBarSettings.ShowRefreshButton = true; RolesGrid.ToolBarSettings.ShowSearchButton = true; this.AuthorizationGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { Width = 100, EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings() { ShowEditIcon = true, ShowDeleteIcon = false }, }, new JQGridColumn() { DataField = "IsInRole", HeaderText = "选择", DataType = typeof(bool), Editable = true, Sortable = false, }, new JQGridColumn() { DataField = "Code", PrimaryKey = true, HeaderText = "功能编码", DataType = typeof(string), Editable = false, Visible = false, Sortable = false, }, new JQGridColumn() { DataField = "Title", HeaderText = "功能描述", DataType = typeof(string), Editable = false, Width = 300, Sortable = false, }, new JQGridColumn() { DataField = "IsClient", HeaderText = "是否客户端", DataType = typeof(bool), Editable = false, Sortable = false, }, new JQGridColumn() { DataField = "Sort", DataType = typeof(string), Editable = false, Visible = false, Searchable = false, Sortable = true, }, }, }; AuthorizationGrid.AutoWidth = false; AuthorizationGrid.Width = 800; AuthorizationGrid.Height = 600; AuthorizationGrid.ToolBarSettings.ShowRefreshButton = true; AuthorizationGrid.ToolBarSettings.ShowSearchButton = true; AuthorizationGrid.TreeGridSettings.Enabled = true; }
public ReceiptGridModel() { ReceiptGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false, }, new JQGridColumn() { DataField = "ReceiptType", DataType = typeof(int), Visible = false, Searchable = false, SearchToolBarOperation = SearchOperation.IsEqualTo, }, new JQGridColumn() { DataField = "MemberName", HeaderText = "姓名", DataType = typeof(string) }, new JQGridColumn() { DataField = "IdCard", HeaderText = "证件号", DataType = typeof(string) }, new JQGridColumn() { DataField = "LinkPhone", HeaderText = "联系电话", DataType = typeof(string) }, new JQGridColumn() { DataField = "LinkAddress", HeaderText = "联系地址", DataType = typeof(string) }, new JQGridColumn() { DataField = "Email", HeaderText = "Email", DataType = typeof(string) }, new JQGridColumn() { DataField = "Content", HeaderText = "内容", DataType = typeof(string) }, new JQGridColumn() { DataField = "Comment", HeaderText = "备注", DataType = typeof(string) }, new JQGridColumn() { DataField = "Status", HeaderText = "状态", DataType = typeof(int), Editable = true, }, new JQGridColumn() { DataField = "StatusName", HeaderText = "状态", DataType = typeof(string), Visible = false, Searchable = false, Exportable = true, }, new JQGridColumn() { DataField = "CreateDate", HeaderText = "创建日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "FullName", HeaderText = "创建操作员", DataType = typeof(string) }, new JQGridColumn() { DataField = "DeptName", HeaderText = "创建部门", DataType = typeof(string), }, new JQGridColumn() { DataField = "ModifyDate", HeaderText = "修改日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "ModifyFullName", HeaderText = "修改操作员", DataType = typeof(string) }, new JQGridColumn() { DataField = "ModifyDeptName", HeaderText = "修改部门", DataType = typeof(string) }, } }; }
public BatchStopGridModel() { BatchStopGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { EditActionIconsColumn = true, EditActionIconsSettings = new EditActionIconsSettings { ShowDeleteIcon = false, SaveOnEnterKeyPress = true }, }, new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "StopFlag", HeaderText = "是否冻结", DataType = typeof(bool), Editable = true, }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "Num", HeaderText = "数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Batch", HeaderText = "批号", DataType = typeof(string), }, new JQGridColumn() { DataField = "MadeDate", HeaderText = "生产日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "ShelfLife", HeaderText = "保质期", DataType = typeof(int), Searchable = false, }, new JQGridColumn() { DataField = "ShelfLifeType", HeaderText = "保质期单位", DataType = typeof(int), Visible = false, Searchable = false, }, new JQGridColumn() { DataField = "ShelfLifeTypeName", HeaderText = "保质期单位", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "InvalidDate", HeaderText = "失效日期", DataType = typeof(DateTime), }, } }; BatchStopGrid.AppearanceSettings.AlternateRowBackground = true; BatchStopGrid.ToolBarSettings.ShowRefreshButton = true; BatchStopGrid.ToolBarSettings.ShowSearchButton = true; BatchStopGrid.SearchDialogSettings.MultipleSearch = true; BatchStopGrid.AppearanceSettings.ShowRowNumbers = true; }
private void SetUpRolesGrid(JQGrid grid) { grid.DataUrl = Url.Action("Roles_RequestData"); grid.EditUrl = Url.Action("Roles_EditData"); SetUpGrid(grid); }
public BatchInventoryGridModel() { BatchInventoryGrid = new JQGrid() { Columns = new List <JQGridColumn>() { //new JQGridColumn() //{ // DataField="Id", // DataType=typeof(Guid), // PrimaryKey=true, // Visible=false, // Searchable=false //}, //new JQGridColumn() //{ // DataField="MVId", // DataType=typeof(Guid), // Visible=false, // Searchable=false //}, new JQGridColumn() { DataField = "InvId", HeaderText = "存货", DataType = typeof(Guid), Visible = false, //EditDialogFieldSuffix="(*)", //EditClientSideValidators = new List<JQGridEditClientSideValidator>() //{ // new RequiredValidator() //}, PrimaryKey = true, Searchable = false, }, new JQGridColumn() { DataField = "WhId", DataType = typeof(Guid), Visible = false, Searchable = false, SearchToolBarOperation = SearchOperation.IsEqualTo, }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), Searchable = true, }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), Searchable = false, }, new JQGridColumn() { DataField = "Num", HeaderText = "数量", DataType = typeof(decimal), Editable = true, EditDialogFieldSuffix = "(*)", EditClientSideValidators = new List <JQGridEditClientSideValidator>() { new RequiredValidator(), new NumberValidator(), }, Formatter = new CustomFormatter() { FormatFunction = "FormatNumber", UnFormatFunction = "UnFormatNumber" } //new NumberFormatter(){ DecimalPlaces=0}, }, new JQGridColumn() { DataField = "Memo", HeaderText = "行备注", DataType = typeof(string), Editable = true, }, } }; BatchInventoryGrid.ToolBarSettings.ShowAddButton = false; BatchInventoryGrid.ToolBarSettings.ShowEditButton = false; BatchInventoryGrid.ToolBarSettings.ShowDeleteButton = false; BatchInventoryGrid.ToolBarSettings.ShowRefreshButton = true; BatchInventoryGrid.ToolBarSettings.ShowSearchButton = true; BatchInventoryGrid.SearchDialogSettings.MultipleSearch = true; BatchInventoryGrid.AppearanceSettings.ShowRowNumbers = true; BatchInventoryGrid.ClientSideEvents.SerializeGridData = "serializeGridData"; BatchInventoryGrid.ClientSideEvents.RowSelect = "editRow"; BatchInventoryGrid.PagerSettings.PageSize = 1000; BatchInventoryGrid.PagerSettings.PageSizeOptions = "[100,200,300,400,1000]"; }
public JsonAddDialog(JQGrid grid) { this._jsonValues = new Hashtable(); this._grid = grid; }
public StockDayBookGridModel() { StockDayBookGrid = new JQGrid() { Columns = new List <JQGridColumn>() { new JQGridColumn() { DataField = "Id", DataType = typeof(Guid), PrimaryKey = true, Visible = false, Searchable = false }, new JQGridColumn() { DataField = "Code", HeaderText = "单据号", DataType = typeof(string), }, new JQGridColumn() { DataField = "RdDate", HeaderText = "单据日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "RdName", HeaderText = "收发类别", DataType = typeof(string), }, new JQGridColumn() { DataField = "WhName", HeaderText = "仓库", DataType = typeof(string), }, new JQGridColumn() { DataField = "SalesmanName", HeaderText = "业务员", DataType = typeof(string), }, new JQGridColumn() { DataField = "IsVerify", HeaderText = "是否审核", DataType = typeof(bool), }, new JQGridColumn() { DataField = "VerifyDate", HeaderText = "审核日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "InvName", HeaderText = "存货", DataType = typeof(string), }, new JQGridColumn() { DataField = "Specs", HeaderText = "规格型号", DataType = typeof(string), }, new JQGridColumn() { DataField = "STUnitName", HeaderText = "计量单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "Num", HeaderText = "数量", DataType = typeof(decimal), Formatter = new DigitFormatter(), }, new JQGridColumn() { DataField = "Batch", HeaderText = "批号", DataType = typeof(string), }, new JQGridColumn() { DataField = "MadeDate", HeaderText = "生产日期", DataType = typeof(DateTime), }, new JQGridColumn() { DataField = "ShelfLife", HeaderText = "保质期", DataType = typeof(int), }, new JQGridColumn() { DataField = "ShelfLifeTypeName", HeaderText = "保质期单位", DataType = typeof(string), }, new JQGridColumn() { DataField = "InvalidDate", HeaderText = "失效日期", DataType = typeof(DateTime), }, } }; StockDayBookGrid.ToolBarSettings.ShowRefreshButton = true; StockDayBookGrid.ToolBarSettings.ShowSearchButton = true; StockDayBookGrid.ToolBarSettings.ShowExcelButton = true; StockDayBookGrid.ToolBarSettings.ShowColumnChooser = true; StockDayBookGrid.SearchDialogSettings.MultipleSearch = true; StockDayBookGrid.AppearanceSettings.ShowRowNumbers = true; }
public JQGridDataResolvedEventArgs(JQGrid gridModel, IQueryable currentData, IQueryable allData) { this._currentData = currentData; this._allData = allData; this._gridModel = gridModel; }