public void Query(InvoiceQueryVM queryVM, int pageSize, int pageIndex, string sortField, Action<InvoiceQueryResultVM> callback) { InvoiceQueryFilter filter = queryVM.ConvertVM<InvoiceQueryVM, InvoiceQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/Invoice/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } InvoiceQueryResultVM result = new InvoiceQueryResultVM(); if (args.Result[0] != null && args.Result[0].Rows != null) { result.ResultList = DynamicConverter<InvoiceVM>.ConvertToVMList(args.Result[0].Rows); result.TotalCount = args.Result[0].TotalCount; } if (args.Result[1] != null && args.Result[1].Rows != null && !(args.Result[1].Rows is DynamicXml.EmptyList)) { result.InvoiceAmt = DynamicConverter<InvoiceAmtVM>.ConvertToVM(args.Result[1].Rows[0]); } callback(result); }); }
public void ExportExcelFile(InvoiceQueryVM queryVM, ColumnSet[] columnSet) { InvoiceQueryFilter queryFilter = queryVM.ConvertVM<InvoiceQueryVM, InvoiceQueryFilter>(); queryFilter.PagingInfo = new PagingInfo { PageSize = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit, PageIndex = 0, SortBy = "SysNo desc" }; queryFilter.CompanyCode = CPApplication.Current.CompanyCode; string relativeUrl = "/InvoiceService/Invoice/Export"; restClient.ExportFile(relativeUrl, queryFilter, columnSet); }
public QueryResultList InvoiceQuery(InvoiceQueryFilter filter) { int totalCount = 0; var dataSet = ObjectFactory <IInvoiceQueryDA> .Instance.Qeury(filter, out totalCount); return(new QueryResultList() { new QueryResult() { Data = dataSet.Tables["ResultTable"], TotalCount = totalCount }, new QueryResult() { Data = dataSet.Tables["InvoiceAmtTable"] } }); }
public QueryResult InvoiceExport(InvoiceQueryFilter filter) { int totalCount = 0; var dataSet = ObjectFactory <IInvoiceQueryDA> .Instance.Qeury(filter, out totalCount); var dataTable = dataSet.Tables["ResultTable"]; foreach (DataRow row in dataTable.Rows.AsParallel()) { if (row["OrderType"].ToString() == "4") { row["OrderSysNo"] = row["NewOrderSysNo"]; } } return(new QueryResult() { Data = dataTable, TotalCount = totalCount }); }