public void QueryLendRequest(LendRequestQueryVM model, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback) { LendRequestQueryFilter filter; filter = model.ConvertVM <LendRequestQueryVM, LendRequestQueryFilter>(); filter.PagingInfo = new PagingInfo { PageSize = PageSize, PageIndex = PageIndex, SortBy = SortField }; string relativeUrl = "/InventoryService/LendRequest/QueryLendRequest"; 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 void QueryLendRequest(LendRequestQueryVM model, Action <int, List <dynamic> > callback) { LendRequestQueryFilter filter; model.CompanyCode = CPApplication.Current.CompanyCode; filter = model.ConvertVM <LendRequestQueryVM, LendRequestQueryFilter>(); string relativeUrl = "/InventoryService/LendRequest/QueryLendRequest"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (!args.FaultsHandle()) { List <dynamic> result = null; int totalCount = 0; if (!(args.Result == null || args.Result.Rows == null)) { result = args.Result.Rows.ToList(); totalCount = args.Result.TotalCount; } if (callback != null) { callback(totalCount, result); } } }); }
private void dgLendRequestQueryResult_ExportAllClick(object sender, EventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Inventory_LendRequestQuery_ExportExcell)) { Window.Alert("对不起,你没有权限进行此操作!"); return; } if (this.dgLendRequestQueryResult == null || this.dgLendRequestQueryResult.TotalCount == 0) { Window.Alert("没有可供导出的数据!"); return; } //导出全部: if (null != PageView.QueryInfo) { LendRequestQueryVM exportQueryRequest = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <LendRequestQueryVM>(PageView.QueryInfo); exportQueryRequest.PagingInfo = new QueryFilter.Common.PagingInfo() { PageIndex = 0, PageSize = ConstValue.MaxRowCountLimit }; ColumnSet columnSet = new ColumnSet() .Add("RequestID", ResLendRequestQuery.Grid_RequestID, 40) .Add("RequestStatus", ResLendRequestQuery.Grid_RequestStatus, 20) .Add("LendUserName", ResLendRequestQuery.Grid_RequestLendUser, 40) .Add("LendTotalCost", ResLendRequestQuery.Grid_LendUnitCost, 30) .Add("LendTotalAmount", ResLendRequestQuery.Grid_LendTotalAmount, 30) .Add("CreateDate", ResLendRequestQuery.Grid_RequestCreateDate, 30) .Add("AuditDate", ResLendRequestQuery.Grid_RequestAuditDate, 30) .Add("OutStockDate", ResLendRequestQuery.Grid_RequestOutStockDate, 30); new LendRequestQueryFacade(this).ExportExcelForLendRequest(exportQueryRequest, new ColumnSet[] { columnSet }); } }
private void btnStatByPM_Click(object sender, RoutedEventArgs e) { if (this.dgLendRequestQueryResult == null || this.dgLendRequestQueryResult.TotalCount == 0) { Window.Alert("没有可供导出的数据!"); return; } //按照PM导出全部: if (null != PageView.QueryInfo) { LendRequestQueryVM exportQueryRequest = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <LendRequestQueryVM>(PageView.QueryInfo); exportQueryRequest.PagingInfo = new QueryFilter.Common.PagingInfo() { PageIndex = 0, PageSize = ConstValue.MaxRowCountLimit, SortBy = "" }; ColumnSet columnSet = new ColumnSet() .Add("ProductCode", ResLendRequestQuery.Grid_ProductID, 40) .Add("ProductName", ResLendRequestQuery.Grid_ProductName, 20) .Add("LendCode", ResLendRequestQuery.Grid_RequestID, 40) .Add("LendUserName", ResLendRequestQuery.Grid_RequestLendUser, 40) .Add("LendTime", ResLendRequestQuery.Grid_RequestCreateDate, 30) .Add("LendQty", ResLendRequestQuery.Grid_LendQty, 30) .Add("LendCost", ResLendRequestQuery.Grid_LendUnitCost, 30) .Add("TotalLendCost", ResLendRequestQuery.Grid_LendUnitCostAll, 30) .Add("PMName", ResLendRequestQuery.Grid_PMName, 40); new LendRequestQueryFacade(this).ExportExcelForLendRequestByPM(exportQueryRequest, new ColumnSet[] { columnSet }); } }
/// <summary> /// 按照PM导出查询结果 /// </summary> /// <param name="model"></param> /// <param name="columns"></param> public void ExportExcelForLendRequestByPM(LendRequestQueryVM model, ColumnSet[] columns) { LendRequestQueryFilter queryFilter; model.CompanyCode = CPApplication.Current.CompanyCode; queryFilter = model.ConvertVM <LendRequestQueryVM, LendRequestQueryFilter>(); string relativeUrl = "/InventoryService/LendRequest/ExportAllByPM"; restClient.ExportFile(relativeUrl, queryFilter, columns); }