/// <summary> /// 查询付款单 /// </summary> public void QueryPayItem(PayItemQueryVM query, int pageSize, int pageIndex, string sortField, Action <PayItemQueryResultVM> callback) { PayItemQueryFilter filter = query.ConvertVM <PayItemQueryVM, PayItemQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/PayItem/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } PayItemQueryResultVM result = new PayItemQueryResultVM(); if (args.Result[0] != null && args.Result[0].Rows != null) { result.ResultList = DynamicConverter <PayItemVM> .ConvertToVMList(args.Result[0].Rows); result.TotalCount = args.Result[0].TotalCount; } if (args.Result[1] != null && args.Result[1].Rows != null) { result.Statistic = DynamicConverter <PayItemQueryStatisticVM> .ConvertToVM(args.Result[1].Rows[0]); result.Statistic.PagePayAmt = result.ResultList.Sum(s => s.PayAmt ?? 0M); } callback(result); }); }
public virtual QueryResult ExportPayItemList(PayItemQueryFilter filter) { int totalCount; var dataSet = ObjectFactory <IPayItemQueryDA> .Instance.Query(filter, out totalCount); var dataTable = dataSet.Tables["DataResult"]; dataTable.Columns.Add("InvoiceUpdate"); foreach (DataRow row in dataTable.Rows.AsParallel()) { string batchnum = ""; if (!row.IsNull("BatchNumber") && !string.IsNullOrWhiteSpace(row["BatchNumber"].ToString())) { batchnum = "-" + row["BatchNumber"].ToString().PadLeft(2, '0'); } if (row["OrderType"].ToString() == "5") { row["OrderID"] = row["OrderID"] + "A"; } else if (row["OrderType"].ToString() == "0" || row["OrderType"].ToString() == "7") { row["OrderID"] = row["OrderID"] + batchnum; } if (string.IsNullOrWhiteSpace(row["ReferenceID"].ToString())) { row["ReferenceID"] = "N/A"; } if (!row.IsNull("CreateTime")) { if ((DateTime)row["CreateTime"] == DateTime.MinValue) { row["CreateTime"] = DBNull.Value; } row["CreateTime"] = ((DateTime)row["CreateTime"]).ToString(InvoiceConst.StringFormat.LongDateFormat); } if (!row.IsNull("InvoiceUpdateTime")) { row["InvoiceUpdate"] = row["UpdateInvoiceUserName"] + " " + ((DateTime)row["InvoiceUpdateTime"]).ToString(InvoiceConst.StringFormat.ShortDateFormat); } else { row["InvoiceUpdate"] = row["UpdateInvoiceUserName"]; } } return(new QueryResult() { Data = dataTable , TotalCount = dataTable.Rows.Count }); }
public void ExportExcelFile(PayItemQueryVM queryVM, ColumnSet[] columnSet) { PayItemQueryFilter queryFilter = queryVM.ConvertVM <PayItemQueryVM, PayItemQueryFilter>(); queryFilter.PagingInfo = new PagingInfo { PageSize = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit, PageIndex = 0, SortBy = "" }; queryFilter.CompanyCode = CPApplication.Current.CompanyCode; string relativeUrl = "/InvoiceService/PayItem/Export"; restClient.ExportFile(relativeUrl, queryFilter, columnSet); }
public virtual QueryResultList QueryPayItemList(PayItemQueryFilter filter) { int totalCount; var dataSet = ObjectFactory <IPayItemQueryDA> .Instance.Query(filter, out totalCount); return(new QueryResultList() { new QueryResult() { Data = dataSet.Tables["DataResult"], TotalCount = totalCount }, new QueryResult() { Data = dataSet.Tables["StatisticResult"] } }); }