Example #1
0
        public void IncomeCostReportExportExcelFile(IncomeCostReportQueryVM queryVM, ColumnSet[] columnSets)
        {
            var filter = queryVM.ConvertVM <IncomeCostReportQueryVM, IncomeCostReportQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = 0,
                PageSize  = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit,
                SortBy    = null
            };

            const string relativeUrl = "/InvoiceService/IncomeCostReport/Export";

            restClient.ExportFile(relativeUrl, filter, columnSets);
        }
Example #2
0
        public void IncomeCostReportQuery(IncomeCostReportQueryVM queryVM,
                                          int pageSize,
                                          int pageIndex,
                                          string sortField,
                                          Action <IncomeCostReportQueryResultVM> callback)
        {
            var filter = queryVM.ConvertVM <IncomeCostReportQueryVM, IncomeCostReportQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                SortBy    = sortField
            };

            const string relativeUrl = "/InvoiceService/IncomeCostReport/Query";

            restClient.QueryDynamicData(relativeUrl, filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                var result = new IncomeCostReportQueryResultVM();
                if (args.Result[0] != null && args.Result[0].Rows != null)
                {
                    result.ResultList = DynamicConverter <IncomeCostReportVM> .ConvertToVMList(args.Result[0].Rows);
                    result.TotalCount = args.Result[0].TotalCount;
                }

                if (args.Result[0] != null && args.Result[1].Rows != null)
                {
                    result.StatisticList =
                        DynamicConverter <IncomeCostReportStatisticVM>
                        .ConvertToVMList <StatisticCollection <IncomeCostReportStatisticVM> >(args.Result[1].Rows);
                    if (result.StatisticList.Count > 0)
                    {
                        result.StatisticList[0].StatisticType = StatisticType.Page;
                        result.StatisticList[1].StatisticType = StatisticType.Total;
                    }
                }
                callback(result);
            });
        }