public void QueryBrand(BrandQueryVM model, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback) { BrandQueryFilter filter; filter = model.ConvertVM <BrandQueryVM, BrandQueryFilter>(); filter.PagingInfo = new PagingInfo { PageSize = PageSize, PageIndex = PageIndex, SortBy = SortField }; string relativeUrl = "/IMService/Brand/QueryBrand"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } if (!(args == null || args.Result == null || args.Result.Rows == null)) { foreach (var item in args.Result.Rows) { item.IsChecked = false; } } callback(obj, args); } ); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); model = new BrandQueryVM(); this.DataContext = model; if (!String.IsNullOrEmpty(Request.Param)) { manufactureSysNo = Convert.ToInt32(Request.Param); dgBrandQueryResult.Bind(); } }
private void dgBrandQueryResult_LoadingDataSource(object sender, LoadingDataEventArgs e) { BrandQueryFacade facade = new BrandQueryFacade(this); model = (BrandQueryVM)this.DataContext; model.ManufacturerSysNo = manufactureSysNo; if (IsSetTop) { e.SortField = "case when Brand.Priority is null then 1 else 0 end,Brand.Priority"; } IsSetTop = false; facade.QueryBrand(model, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { this.dgBrandQueryResult.ItemsSource = args.Result.Rows.ToList("IsChecked", false);; this.dgBrandQueryResult.TotalCount = args.Result.TotalCount; }); }