private void IniPageData() { QueryVM = new ResSalesCouponUsedReportQueryVM(); facade = new CouponUsedReportFacade(this); ResultModel = new SalesCouponUsedReportQueryView(); gridQueryBuilder.DataContext = QueryVM; dgdResult.DataContext = ResultModel; }
public void ExportCouponUsedReport(ResSalesCouponUsedReportQueryVM queryVM, ColumnSet[] columnSet) { var filter = queryVM.ConvertVM <ResSalesCouponUsedReportQueryVM, CouponUsedReportFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = 0, PageSize = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit, SortBy = null }; const string relativeUrl = "/InvoiceService/CouponUseedReport/Export"; restClient.ExportFile(relativeUrl, filter, columnSet); }
public void QueryCouponUsedReport(ResSalesCouponUsedReportQueryVM queryVM, int pageSize, int pageIndex, string sortField, Action <SalesCouponUsedReportQueryView> callback) { var filter = queryVM.ConvertVM <ResSalesCouponUsedReportQueryVM, CouponUsedReportFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; const string relativeUrl = "/InvoiceService/CouponUseedReport/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } var result = new SalesCouponUsedReportQueryView(); if (args.Result[0] != null && args.Result[0].Rows != null) { result.Result = DynamicConverter <SalesCouponUsedReportDataVM> .ConvertToVMList(args.Result[0].Rows); result.TotalCount = args.Result[0].TotalCount; //result.TxtAllStatisticInfo = "总 计:--优惠券折扣金额:¥" + args.Result[1].Rows[0]["TotalAmount"].ToString("#0.00"); //result.TxtCurrentPageStatisticInfo = "本页小计:--优惠券折扣金额:¥" + args.Result[1].Rows[0]["CurrentPageAmount"].ToString("#0.00"); } if (args.Result[1] != null && args.Result[1].Rows != null) { result.Staticsticinfo = DynamicConverter <StaticsticInfo> .ConvertToVMList(args.Result[1].Rows); } if (result.Staticsticinfo == null) { result.Staticsticinfo = DynamicConverter <StaticsticInfo> .ConvertToVMList(args.Result[0].Rows); } callback(result); }); }