public void BindDataGrid(int totalCount, dynamic rows) { this.DataGrid.TotalCount = totalCount; _vmList = DynamicConverter <ProductERPCategoryVM> .ConvertToVMList <List <ProductERPCategoryVM> >(rows); this.DataGrid.ItemsSource = _vmList; }
/// <summary> /// 请求服务,并将查询结果绑定到DataGrid /// </summary> void DataGrid_LoadingDataSource(object sender, LoadingDataEventArgs e) { filter = viewModel.ConvertVM <CustomerGiftQueryVM, CustomerGiftQueryFilter>(); filter.PagingInfo = new PagingInfo { PageIndex = e.PageIndex, PageSize = e.PageSize, SortBy = e.SortField }; _facade.Query(filter, (s, args) => { if (args.FaultsHandle()) { return; } this.DataGrid.TotalCount = args.Result.TotalCount; _rows = DynamicConverter <CustomerGiftListVM> .ConvertToVMList(args.Result.Rows); this.DataGrid.ItemsSource = _rows; if (_checkBoxAll != null) { //重新查询后,将全选CheckBox置为false _checkBoxAll.IsChecked = false; } }); }
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { cbDemo.IsChecked = false; facade.QueryProductReviewScore(QueryResultGrid.QueryCriteria as ReviewScoreItemQueryFilter, e.PageSize, e.PageIndex, e.SortField, (s, args) => { if (args.FaultsHandle()) { return; } gridVM = DynamicConverter <ReviewScoreItemVM> .ConvertToVMList <List <ReviewScoreItemVM> >(args.Result.Rows); QueryResultGrid.ItemsSource = gridVM; QueryResultGrid.TotalCount = args.Result.TotalCount; if (gridVM != null) { btnInvalidItem.IsEnabled = true; btnValidItem.IsEnabled = true; } else { btnInvalidItem.IsEnabled = false; btnValidItem.IsEnabled = false; } }); }
private void Hyperlink_Abandon_Click(object sender, RoutedEventArgs e) { //作废操作: DynamicXml getSelectedItem = this.QueryResultGrid.SelectedItem as DynamicXml; if (null != getSelectedItem) { ConsignSettlementRulesInfoVM editInfo = DynamicConverter <ConsignSettlementRulesInfoVM> .ConvertToVM(getSelectedItem); if (null != editInfo) { Window.Confirm(ResSettledProductsRuleQuery.AlertMsg_ConfirmAbandon, (obj, args) => { if (args.DialogResult == DialogResultType.OK) { ConsignSettlementRulesInfo info = EntityConverter <ConsignSettlementRulesInfoVM, ConsignSettlementRulesInfo> .Convert(editInfo); serviceFacade.AbandonConsignSettleRule(info, (obj2, args2) => { if (args2.FaultsHandle()) { return; } Window.Alert(ResSettledProductsRuleQuery.AlertMsg_AlertTitle, ResSettledProductsRuleQuery.AlertMsg_OprSuc, MessageType.Information, (obj3, args3) => { if (args3.DialogResult == DialogResultType.Cancel) { QueryResultGrid.Bind(); } }); }); } }); } } }
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { facade.QueryAdvertiser(QueryResultGrid.QueryCriteria as AdvertiserQueryFilter, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { if (args.FaultsHandle()) { return; } gridVM = DynamicConverter <AdvertisersVM> .ConvertToVMList <List <AdvertisersVM> >(args.Result.Rows); QueryResultGrid.ItemsSource = gridVM; //QueryResultGrid.ItemsSource = args.Result.Rows; QueryResultGrid.TotalCount = args.Result.TotalCount; btnNewItem.Visibility = System.Windows.Visibility.Visible; if (gridVM != null) { btnBathchSetValid.Visibility = Visibility.Visible; btnBathchSetInvalid.Visibility = Visibility.Visible; } else { btnBathchSetValid.Visibility = Visibility.Collapsed; btnBathchSetInvalid.Visibility = Visibility.Collapsed; } }); }
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { facade.QueryHotKeywords(QueryResultGrid.QueryCriteria as HotKeywordsQueryFilter, e.PageSize, e.PageIndex, e.SortField, (s, args) => { if (args.FaultsHandle()) { return; } gridVM = DynamicConverter <HotKeywordsVM> .ConvertToVMList <List <HotKeywordsVM> >(args.Result.Rows); QueryResultGrid.ItemsSource = gridVM; QueryResultGrid.TotalCount = args.Result.TotalCount; if (gridVM != null) { btnVoidItem.IsEnabled = true; btnAvailableItem.IsEnabled = true; } else { btnVoidItem.IsEnabled = false; btnAvailableItem.IsEnabled = false; } }); }
private void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { facade.QueryGiftCardInfo(DataGrid.QueryCriteria as ECCentral.QueryFilter.IM.GiftCardFilter, e.PageSize, e.PageIndex, e.SortField, (s, args) => { if (args.FaultsHandle()) { return; } gridVM = DynamicConverter <GiftCardVM> .ConvertToVMList <List <GiftCardVM> >(args.Result.Rows); DataGrid.ItemsSource = gridVM; DataGrid.TotalCount = args.Result.TotalCount; if (gridVM != null) { //btnBatchLock.Visibility = System.Windows.Visibility.Visible; //btnBatchUnLock.Visibility = System.Windows.Visibility.Visible; //btnInvalid.Visibility = System.Windows.Visibility.Visible; //hlEdit.IsEnabled = AuthMgr.HasFunctionPoint(AuthKeyConst.MKT_Invalid_InvalidGiftCard); } else { //btnBatchLock.Visibility = System.Windows.Visibility.Collapsed; //btnBatchUnLock.Visibility = System.Windows.Visibility.Collapsed; //btnInvalid.Visibility = System.Windows.Visibility.Collapsed; } }); }
private void hlbtnEdit_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Inventory_ShiftConfigInfoQuery_Modify)) { Window.Alert("对不起,你没有权限进行此操作!"); return; } HyperlinkButton btn = sender as HyperlinkButton; dynamic data = btn.DataContext; StockShiftConfigVM vm = DynamicConverter <StockShiftConfigVM> .ConvertToVM(btn.DataContext); ECCentral.Portal.UI.Inventory.UserControls.StockShiftConfig content = new UserControls.StockShiftConfig(); vm.ShiftShippingTypeList = (from item in PageView.QueryInfo.ShiftShippingTypeList where item.Code != null select item).ToList(); content.ConfigVM = vm; content.Page = this; content.Dialog = Window.ShowDialog("修改移仓配置信息", content, (obj, args) => { if (args.DialogResult == DialogResultType.OK) { StockShiftConfigVM tvm = args.Data as StockShiftConfigVM; data.ShipInterval = tvm.ShipInterval; data.SPLInterval = tvm.SPLInterval; dgStockShiftConfig.Bind(); } }); }
void lstChannel_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.lstChannel.SelectedValue == null) { return; } //如果已经加载了对应渠道的帮助分类列表,直接返回 if (this.lstHelpCategory.Tag == this.lstChannel.SelectedValue) { return; } HelpCenterFacade helpCenterFacade = new HelpCenterFacade(this); helpCenterFacade.QueryCategory(CPApplication.Current.CompanyCode, this.lstChannel.SelectedValue.ToString(), (s, args) => { if (args.FaultsHandle()) { return; } List <HelpCenterCategoryVM> helpCategoryList = DynamicConverter <HelpCenterCategoryVM> .ConvertToVMList(args.Result.Rows); if (helpCategoryList != null) { helpCategoryList.Insert(0, new HelpCenterCategoryVM { SysNo = null, Name = ResCommonEnum.Enum_Select }); } this.lstHelpCategory.ItemsSource = helpCategoryList; this.lstHelpCategory.Tag = this.lstChannel.SelectedValue; }); }
private void dgInvoiceQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { facade.QueryReconciliation(queryVM, e.PageSize, e.PageIndex, e.SortField, (s, args) => { if (args.FaultsHandle()) { return; } var gridVM = DynamicConverter <ReconciliationVM> .ConvertToVMList <List <ReconciliationVM> >(args.Result.Rows); foreach (ReconciliationVM temp in gridVM) { if (temp.IncomeAmt.HasValue) { temp.IncomeAmt = decimal.Round(temp.IncomeAmt.Value, 2); } if (temp.TotalAmount.HasValue) { temp.TotalAmount = decimal.Round(temp.TotalAmount.Value, 2); } if (temp.OrderAmt.HasValue) { temp.OrderAmt = decimal.Round(temp.OrderAmt.Value, 2); } } dgInvoiceQueryResult.ItemsSource = gridVM; dgInvoiceQueryResult.TotalCount = args.Result.TotalCount; }); }
private void dgQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { m_queryRequest.PagingInfo = new PagingInfo() { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; SOQueryFacade facade = new SOQueryFacade(this); facade.QuerySOWHUpdate(m_queryRequest, (obj, args) => { if (args.FaultsHandle()) { return; } this.dgQueryResult.TotalCount = args.Result.TotalCount; soWHUpdatelist = DynamicConverter <SOWHUpdateInfoVM> .ConvertToVMList(args.Result.Rows); soWHUpdatelist.ForEach(p => { p.StockList = m_stockData; }); this.dgQueryResult.ItemsSource = soWHUpdatelist; }); }
private void dgQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { m_queryRequest.PagingInfo = new PagingInfo() { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; m_queryRequest.PagingInfo.SortBy = e.SortField; ReceivedReportFacade facade = new ReceivedReportFacade(this); facade.ARReceiveQuery(m_queryRequest, (obj, args) => { if (args.FaultsHandle()) { return; } this.dgQueryResult.TotalCount = args.Result.TotalCount; ArReceiveList = DynamicConverter <ARReceiveByInvoiceVM> .ConvertToVMList(args.Result.Rows); this.dgQueryResult.ItemsSource = ArReceiveList; this.myFooter.Visibility = ((ArReceiveList != null && ArReceiveList.Count != 0)) ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed; ARReceiveSumVM sumVm = GetSumARReceive(ArReceiveList); this.myFooter.DataContext = sumVm; }); }
public void Query(NetPayQueryVM req, int pageSize, int pageIndex, string sortField, Action <NetPayQueryResultVM> callback) { NetPayQueryFilter filter = req.ConvertVM <NetPayQueryVM, NetPayQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/NetPay/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } NetPayQueryResultVM result = new NetPayQueryResultVM(); result.ResultList = DynamicConverter <NetPayVM> .ConvertToVMList(args.Result.Rows); result.TotalCount = args.Result.TotalCount; callback(result); }); }
private void OnLoadStockByID(object sender, RestClientEventArgs <dynamic> args) { dynamic totalCount = args.Result.TotalCount; if (totalCount == 0) { //渠道库存ID不存在 CurrentWindow.Alert(string.Format(ResStockPicker.Tip_StockIDNotExists, this.txtStockID.Text.Trim()), MessageType.Warning); } else if (totalCount > 1) { //同一渠道库存ID存在多个 UCStockSearch ucStockSearch = new UCStockSearch(); ucStockSearch.SelectionMode = SelectionMode.Single; ucStockSearch.BindDataGrid(totalCount, args.Result.Rows); ucStockSearch.DialogHandle = CurrentWindow.ShowDialog(ResStockPicker.Dialog_Title, ucStockSearch, OnDialogResult); } else { //渠道库存ID只存在一个 StockVM selectedStock = DynamicConverter <StockVM> .ConvertToVM(args.Result.Rows[0]); this.StockSysNo = selectedStock.SysNo; OnStockSelected(selectedStock); } }
private void btnEdit_Click(object sender, RoutedEventArgs e) { HyperlinkButton btn = sender as HyperlinkButton; dynamic d = btn.DataContext as dynamic; ProductDomainVM vm = DynamicConverter <ProductDomainVM> .ConvertToVM(d); string listStr = d.DepartmentMerchandiserSysNoListStr; List <int?> sysNoList = new List <int?>(); if (!string.IsNullOrEmpty(listStr)) { var list = listStr.Split(new char[] { ';' }).ToList(); list.ForEach(p => { sysNoList.Add(int.Parse(p)); }); } vm.DepartmentMerchandiserSysNoList = sysNoList; UCProductDomainDetail uc = new UCProductDomainDetail(vm); IDialog dialog = CPApplication.Current.CurrentPage.Context.Window.ShowDialog("修改Domain信息", uc, (obj, args) => { if (args.DialogResult == DialogResultType.OK) { this.BindData(this.dataProductDomainList.QueryCriteria); } }); uc.Dialog = dialog; }
private void OnLoadCustomerByID(object sender, RestClientEventArgs <dynamic> args) { if (args.Result == null || args.Result.TotalCount == 0) { //顾客帐号不存在 this.txtCustomerID.Text = string.Empty; this.txtCustomerSysNo.Text = string.Empty; OnCustomerSelected(null); } else if (args.Result.TotalCount > 1) { //同一顾客帐号存在多个 UCCustomerSearch ucCustomerSearch = new UCCustomerSearch(); ucCustomerSearch.SelectionMode = SelectionMode.Single; ucCustomerSearch.DialogHandle = CurrentWindow.ShowDialog(ResCustomerPicker.Dialog_Title, ucCustomerSearch, OnDialogResult); ucCustomerSearch._viewModel.CustomerID = this.txtCustomerID.Text; ucCustomerSearch.BindDataGrid(1, null); } else { //顾客帐号只存在一个 CustomerVM selectedCustomer = DynamicConverter <CustomerVM> .ConvertToVM(args.Result.Rows[0]); this.txtCustomerSysNo.Text = selectedCustomer.SysNo.ToString(); this.txtCustomerID.Focus(); OnCustomerSelected(selectedCustomer); } }
private void ProductDiscussReplyList_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { facade.QueryProductDiscussReply(ProductDiscussReplyList.QueryCriteria as ProductDiscussReplyQueryFilter, e.PageSize, e.PageIndex, e.SortField, (s, args) => { if (args.FaultsHandle()) { return; } gridVMReply = DynamicConverter <ProductDiscussReplyQueryVM> .ConvertToVMList <List <ProductDiscussReplyQueryVM> >(args.Result.Rows); ProductDiscussReplyList.ItemsSource = gridVMReply; ProductDiscussReplyList.TotalCount = args.Result.TotalCount; if (gridVMReply != null) { btnBatchInvalid2.Visibility = System.Windows.Visibility.Visible; btnBatchVerify2.Visibility = System.Windows.Visibility.Visible; btnBatchRead2.Visibility = System.Windows.Visibility.Visible; } else { btnBatchInvalid2.Visibility = System.Windows.Visibility.Collapsed; btnBatchVerify2.Visibility = System.Windows.Visibility.Collapsed; btnBatchRead2.Visibility = System.Windows.Visibility.Collapsed; } }); }
/// <summary> /// 查询-逾期未收款订单 /// </summary> /// <param name="query"></param> /// <param name="pageSize"></param> /// <param name="pageIndex"></param> /// <param name="sortField"></param> /// <param name="callback"></param> public void QueryTrackingInfo(TrackingInfoQueryVM query, int pageSize, int pageIndex, string sortField, Action <TrackingInfoQueryResultVM> callback) { TrackingInfoQueryFilter filter = query.ConvertVM <TrackingInfoQueryVM, TrackingInfoQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/TrackingInfo/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } TrackingInfoQueryResultVM result = new TrackingInfoQueryResultVM(); if (args.Result[0] != null && args.Result[0].Rows != null) { Action <dynamic, TrackingInfoVM> manualMap = new Action <dynamic, TrackingInfoVM>(TrackingInfoMapper); result.ResultList = DynamicConverter <TrackingInfoVM> .ConvertToVMList(args.Result[0].Rows, manualMap, "LossType"); result.TotalCount = args.Result[0].TotalCount; } if (args.Result[1] != null && args.Result[1].Rows != null && !(args.Result[1].Rows is DynamicXml.EmptyList)) { result.Statistic = DynamicConverter <TrackingInfoQueryStatisticVM> .ConvertToVM(args.Result[1].Rows[0]); } callback(result); }); }
/// <summary> /// 查询 /// </summary> /// <param name="query"></param> /// <param name="pageSize"></param> /// <param name="pageIndex"></param> /// <param name="sortField"></param> /// <param name="callback"></param> public void Query(AuditRefundQueryVM query, int pageSize, int pageIndex, string sortField, Action <AuditRefundQueryResultVM> callback) { AuditRefundQueryFilter filter = query.ConvertVM <AuditRefundQueryVM, AuditRefundQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/SOIncomeRefund/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } AuditRefundQueryResultVM result = new AuditRefundQueryResultVM(); result.ResultList = DynamicConverter <AuditRefundVM> .ConvertToVMList(args.Result.Rows); result.TotalCount = args.Result.TotalCount; callback(result); }); }
private void gridLogQuery_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { this.queryFilterVM.PagingInfo.PageIndex = e.PageIndex; this.queryFilterVM.PagingInfo.PageSize = e.PageSize; this.queryFilterVM.PagingInfo.SortBy = e.SortField; if (!string.IsNullOrWhiteSpace(this.queryFilterVM.TicketSysNo)) { int ticketSysNo = 0; if (!int.TryParse(this.queryFilterVM.TicketSysNo, out ticketSysNo)) { Window.Alert("无效的TicketSysNo!"); return; } } facade.QueryLogList(this.queryFilterVM, (obj, args) => { if (args.FaultsHandle()) { return; } List <LogQueryResultVM> logList = DynamicConverter <LogQueryResultVM> .ConvertToVMList(args.Result.Rows); gridLogQuery.ItemsSource = logList; gridLogQuery.TotalCount = args.Result.TotalCount; }); }
public void Query(PostIncomeQueryVM query, int pageSize, int pageIndex, string sortField, Action <PostIncomeQueryResultVM> callback) { PostIncomeQueryFilter queryFilter = query.ConvertVM <PostIncomeQueryVM, PostIncomeQueryFilter>(); queryFilter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; queryFilter.CompanyCode = CPApplication.Current.CompanyCode; string relativeUrl = "/InvoiceService/PostIncome/Query"; restClient.QueryDynamicData(relativeUrl, queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } var result = new PostIncomeQueryResultVM(); result.ResultList = DynamicConverter <PostIncomeVM> .ConvertToVMList(args.Result.Rows); result.TotalCount = args.Result.TotalCount; callback(result); }); }
private void LoadVendorStore() { new ExternalServiceFacade(this).QueryVendorStoreList(this._viewModel.GroupBuyingVendorSysNo, (se, a) => { if (a.FaultsHandle()) { return; } List <VendorStoreVM> list = DynamicConverter <VendorStoreVM> .ConvertToVMList(a.Result.Rows); _viewModel.VendorStoreList.Clear(); list.ForEach(p => { _viewModel.VendorStoreList.Add(p); }); foreach (var item in _viewModel.VendorStoreList) { if (_viewModel.VendorStoreSysNoList != null) { var re = _viewModel.VendorStoreSysNoList.FirstOrDefault(p => p == item.SysNo.Value); if (re > 0) { item.IsChecked = true; } } } }); }
private void DataGrid_Result_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { OrderCheckItemQueryFilter queryFilter = new OrderCheckItemQueryFilter(); queryFilter.PagingInfo = new PagingInfo { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; if (rbtnProductSysNo1.IsChecked.Value) { viewModel.ReferenceType = "PID"; } else if (rbtnProductType1.IsChecked.Value) { viewModel.ReferenceType = "PC3"; } queryFilter.ReferenceType = viewModel.ReferenceType; queryFilter.Status = viewModel.Status; queryFilter.ReferenceContent = viewModel.ProductID; queryFilter.Description = (viewModel.Category3No.HasValue ? viewModel.Category3No.ToString() : string.Empty); OrderCheckItemFacade facade = new OrderCheckItemFacade(this); facade.QueryOrderCheckItem(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } List <OrderCheckItemVM> list = DynamicConverter <OrderCheckItemVM> .ConvertToVMList(args.Result.Rows); this.DataGrid_ResultList.ItemsSource = list; DataGrid_ResultList.TotalCount = args.Result.TotalCount; }); }
private void DataGrid_QueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { ValidationManager.Validate(this.QueryBuilder); if (queryVM.HasValidationErrors) { return; } facade.QueryInvoiceInput(lastQueryVM, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { list = DynamicConverter <InvoiceInputVM> .ConvertToVMList(args.Result.Rows); this.DataGrid_QueryResult.ItemsSource = list; this.DataGrid_QueryResult.TotalCount = args.Result.TotalCount; if (list != null && list.Count > 0) { decimal totlePOAmtSum = 0; decimal totleInvoiceAmt = 0; list.ForEach(p => { totlePOAmtSum += p.POAmtSum ?? 0; totleInvoiceAmt += p.InvoiceAmt ?? 0; }); Text_Statistic.Visibility = Visibility.Visible; Text_Statistic.Text = string.Format(ResInvoiceInputQuery.Msg_Statistic, decimal.Round(totlePOAmtSum, 2), decimal.Round(totleInvoiceAmt, 2)); } else { Text_Statistic.Visibility = Visibility.Collapsed; } }); }
/// <summary> /// 查询销售收款单 /// </summary> /// <param name="query">查询条件</param> /// <param name="pageSize">分页大小</param> /// <param name="pageIndex">页索引</param> /// <param name="sortField">排序字段(带asc或desc)</param> /// <param name="callback">查询结果返回回调</param> public void Query(SaleIncomeQueryVM query, int pageSize, int pageIndex, string sortField, Action <SaleIncomeQueryResultVM> callback) { SOIncomeQueryFilter filter = query.ConvertVM <SaleIncomeQueryVM, SOIncomeQueryFilter>(); filter.PagingInfo = new PagingInfo() { PageIndex = pageIndex, PageSize = pageSize, SortBy = sortField }; string relativeUrl = "/InvoiceService/SOIncome/Query"; restClient.QueryDynamicData(relativeUrl, filter, (obj, args) => { if (args.FaultsHandle()) { return; } SaleIncomeQueryResultVM result = new SaleIncomeQueryResultVM(); if (args.Result[0] != null && args.Result[0].Rows != null) { result.ResultList = DynamicConverter <SaleIncomeVM> .ConvertToVMList(args.Result[0].Rows); result.TotalCount = args.Result[0].TotalCount; } if (args.Result[1] != null && args.Result[1].Rows != null) { result.Statistic = DynamicConverter <SaleIncomeQueryStatisticVM> .ConvertToVMList <StatisticCollection <SaleIncomeQueryStatisticVM> >(args.Result[1].Rows); } callback(result); }); }
/// <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); }); }
private void DataGrid_Result_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { OrderCheckItemQueryFilter queryFilter = new OrderCheckItemQueryFilter(); queryFilter.PagingInfo = new PagingInfo { PageSize = int.MaxValue, PageIndex = 0, SortBy = "" }; queryFilter.ReferenceType = "PC"; queryFilter.CompanyCode = CPApplication.Current.CompanyCode; OrderCheckItemFacade facade = new OrderCheckItemFacade(this); facade.QueryOrderCheckItem(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } List <OrderCheckItemVM> list = DynamicConverter <OrderCheckItemVM> .ConvertToVMList(args.Result.Rows); dataGridOrderCheckList.ItemsSource = list; dataGridOrderCheckList.TotalCount = list.Count(); }); }
private void OnLoadProductByID(object sender, RestClientEventArgs <dynamic> args) { if (args.Result != null) { dynamic totalCount = args.Result.TotalCount; if (totalCount == 0) { //商品ID不存在 this.txtProductID.Text = string.Empty; this.txtProductSysNo.Text = string.Empty; } else if (totalCount > 1) { //同一商品ID存在多个 UCProductSearch ucProductSearch = new UCProductSearch(); ucProductSearch.SelectionMode = SelectionMode.Single; ucProductSearch._viewModel.ProductID = this.txtProductID.Text.Trim(); ucProductSearch.BindDataGrid(totalCount, args.Result.Rows); ucProductSearch.DialogHandler = CurrentWindow.ShowDialog(ResProductPicker.Dialog_Title, ucProductSearch, OnDialogResult); } else { //商品ID只存在一个 ProductVM selectedProduct = DynamicConverter <ProductVM> .ConvertToVM(args.Result.Rows[0]); this.txtProductID.Text = selectedProduct.ProductID; this.txtProductSysNo.Text = selectedProduct.SysNo.ToString(); this.m_selectedProductInfo = selectedProduct; OnProductSelected(selectedProduct); this.txtProductID.Focus(); } } }
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); }); }
/// <summary> /// 非按供应商汇总查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { m_queryRequest.PagingInfo = new PagingInfo() { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; svStatisticInfo.Visibility = System.Windows.Visibility.Collapsed; facade.QueryFinance(m_queryRequest, (obj, args) => { if (args.FaultsHandle()) { return; } this.dgQueryResult.TotalCount = args.Result[0].TotalCount; viewList = DynamicConverter <FinanceVM> .ConvertToVMList(args.Result[0].Rows); this.dgQueryResult.ItemsSource = viewList; if (this.dgQueryResult.TotalCount > 0) { svStatisticInfo.Visibility = System.Windows.Visibility.Visible; tbStatisticInfo.Text = string.Format(ResFinanceQuery.Message_TotalInfo, double.Parse((string)args.Result[1].Rows[0]["Amt"]).ToString("###,###,###0.00")); } }); }