Exemple #1
0
 private void InitData()
 {
     queryVM = new IncomeCostReportQueryVM();
     gridQueryBuilder.DataContext = lastQueryVM = queryVM;
     queryVM.SOStatusListOptions.ForEach(option => option.PropertyChanged += OnSOStatusCheck);
     SetSOStatusText();
 }
Exemple #2
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            bool flag = ValidationManager.Validate(this.gridQueryBuilder);

            if (flag)
            {
                this.lastQueryVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone(queryVM);
                this.dgdResult.Bind();
            }
        }
        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);
        }
        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);
            });
        }