Exemplo n.º 1
0
        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);
            });
        }
Exemplo n.º 2
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            bool flag = ValidationManager.Validate(this.SeachBuilder);

            if (flag)
            {
                this.lastQueryVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <InvoiceQueryVM>(queryVM);

                this.dgInvoiceQueryResult.Bind();
            }
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 private void InitData()
 {
     queryVM = new InvoiceQueryVM();
     SeachBuilder.DataContext = lastQueryVM = queryVM;
 }