//加载数据 private void dgQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { if (string.IsNullOrEmpty(queryVM.ProductID)) { queryVM.ProductSysNo = null; } queryFilter = EntityConverter <ExperienceHallInventoryInfoQueryVM, ExperienceHallInventoryInfoQueryFilter> .Convert(queryVM); this.queryFilter.PagingInfo = new QueryFilter.Common.PagingInfo(); this.queryFilter.PagingInfo.PageIndex = e.PageIndex; this.queryFilter.PagingInfo.PageSize = e.PageSize; this.queryFilter.PagingInfo.SortBy = e.SortField; serviceFacade.QueryExperienceHallInventory(queryFilter, (innerObj, innerArgs) => { if (innerArgs.FaultsHandle()) { return; } int totalCount = innerArgs.Result.TotalCount; this.dgQueryResult.ItemsSource = innerArgs.Result.Rows; this.dgQueryResult.TotalCount = totalCount; }); }
private void dgProductCostResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { queryFilter = EntityConverter <ProductCostQueryVM, ProductCostQueryFilter> .Convert(queryVM); this.queryFilter.PagingInfo = new QueryFilter.Common.PagingInfo(); this.queryFilter.PagingInfo.PageIndex = e.PageIndex; this.queryFilter.PagingInfo.PageSize = e.PageSize; this.queryFilter.PagingInfo.SortBy = e.SortField; #region 获取自己能访问到的PM //queryFilter.UserSysNo = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.LoginUser.UserSysNo; queryFilter.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; serviceFacade.QueryProductCostInList(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } dgProductCostQueryResult.TotalCount = args.Result.TotalCount; dgProductCostQueryResult.ItemsSource = args.Result.Rows.ToList("IsCheck", false); }); #endregion }
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 QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { filter = vm.ConvertVM <RmaPolicySettingQueryVM, DefaultRMAPolicyFilter>(); filter.RMAPolicySysNo = ucRmaPolicyComboxList.SelectValue; facade.GetDefaultRMAPolicy(filter, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { vms = DynamicConverter <RmaPolicySettingQueryVM> .ConvertToVMList <List <RmaPolicySettingQueryVM> >(args.Result.Rows); this.QueryResultGrid.ItemsSource = vms; this.QueryResultGrid.TotalCount = args.Result.TotalCount; }); }
private void QueryResultGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { Filter = model.ConvertVM <ProductBrandWarrantyQueryVM, ProductBrandWarrantyQueryFilter>(); facade.GetProductBrandWarrantyByQuery(Filter, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { vms = DynamicConverter <ProductBrandWarrantyQueryVM> .ConvertToVMList <List <ProductBrandWarrantyQueryVM> >(args.Result.Rows); this.QueryResultGrid.ItemsSource = vms; this.QueryResultGrid.TotalCount = args.Result.TotalCount; }); }
private void dataCommissionTypeList_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { this.QueryVM.PagingInfo.PageIndex = e.PageIndex; this.QueryVM.PagingInfo.PageSize = e.PageSize; this.QueryVM.PagingInfo.SortBy = e.SortField; new CommissionTypeQueryFacade(this).SocietyCommissionQuery(this.QueryVM, (obj, args) => { this.dataCommissionTypeList.ItemsSource = args.Result.Rows; this.dataCommissionTypeList.TotalCount = args.Result.TotalCount; }); }
private void dgShiftRequestMemoQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { PageView.QueryInfo.PagingInfo = new QueryFilter.Common.PagingInfo { PageIndex = e.PageIndex, PageSize = e.PageSize, SortBy = e.SortField }; QueryFacade.QueryShiftRequestMemo(PageView.QueryInfo, (totalCount, vmList) => { PageView.TotalCount = totalCount; PageView.Result = vmList; dgShiftRequestMemoQueryResult.ItemsSource = PageView.Result; dgShiftRequestMemoQueryResult.TotalCount = PageView.TotalCount; }); }
private void DataGrid_Result_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { CustomerQueryFacade facade = new CustomerQueryFacade(this); filter.PagingInfo = new PagingInfo { PageSize = e.PageSize, PageIndex = e.PageIndex, SortBy = e.SortField }; facade.QueryCustomer(filter, (obj, args) => { if (args.FaultsHandle()) { return; } if (!(args == null || args.Result == null || args.Result.Rows == null)) { #region 拼接头像地址 foreach (var item in args.Result.Rows) { item.IsChecked = false; CustomerRank rank = item.Rank ?? CustomerRank.Ferrum; string AvtarImage = item.AvtarImage; if (!string.IsNullOrEmpty(AvtarImage)) { item.AvtarImage = string.Format("{0}{1}", viewModel.AvtarImgBasePath, AvtarImage); } else { item.AvtarImage = string.Format("/Images/Customer/CustomerRankImage/P48Rank{0}.jpg", (int)rank); } } #endregion this.dataGrid1.ItemsSource = args.Result.Rows.ToList(); this.dataGrid1.TotalCount = args.Result.TotalCount; } }); }
private void dgVirtualRequestMemoQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { PageView.QueryInfo.PagingInfo = new PagingInfo() { PageIndex = e.PageIndex, PageSize = e.PageSize, SortBy = e.SortField }; if (!PageView.QueryInfo.ProductSysNo.HasValue || !PageView.QueryInfo.StartDate.HasValue) { Window.Alert("商品编号和申请时间不能为空!"); return; } QueryFacade.QueryVirtualRequestMemo(PageView.QueryInfo, (totalCount, vmList) => { PageView.TotalCount = totalCount; PageView.Result = vmList; dgVirtualRequestMemoQueryResult.ItemsSource = PageView.Result; dgVirtualRequestMemoQueryResult.TotalCount = PageView.TotalCount; }); }
private void dgLendRequestQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { PageView.QueryInfo.PagingInfo = new QueryFilter.Common.PagingInfo { PageIndex = e.PageIndex, PageSize = e.PageSize, SortBy = e.SortField }; PageView.QueryInfo.UserSysNo = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.LoginUser.UserSysNo; if (AuthMgr.HasFunctionAbsolute(AuthKeyConst.IM_SeniorPM_Query)) { PageView.QueryInfo.PMQueryRightType = BizEntity.Common.PMQueryType.AllValid; } else if (AuthMgr.HasFunctionAbsolute(AuthKeyConst.IM_IntermediatePM_Query)) { PageView.QueryInfo.PMQueryRightType = BizEntity.Common.PMQueryType.Team; } else if (AuthMgr.HasFunctionAbsolute(AuthKeyConst.IM_JuniorPM_Query)) { PageView.QueryInfo.PMQueryRightType = BizEntity.Common.PMQueryType.Self; } else { PageView.QueryInfo.PMQueryRightType = null; } QueryFacade.QueryLendRequest(PageView.QueryInfo, (totalCount, vmList) => { PageView.TotalCount = totalCount; PageView.Result = vmList; this.dgLendRequestQueryResult.ItemsSource = PageView.Result; this.dgLendRequestQueryResult.TotalCount = PageView.TotalCount; #region 当前条件下总计 QueryFacade.QueryLendCostbyStatus(PageView.QueryInfo, allCostInfo => { decimal AllPageOriginalCostTotal = 0.00M; decimal AllPageAbandonCostTotal = 0.00M; if (allCostInfo.Count > 0) { var tempAllPageOriginalCostTotalEntity = allCostInfo.SingleOrDefault(x => { return(x.Status == 1); }); var tempAllPageAbandonCostTotalEntity = allCostInfo.SingleOrDefault(x => { return(x.Status == -1); }); if (tempAllPageOriginalCostTotalEntity != null) { AllPageOriginalCostTotal = Math.Round(tempAllPageOriginalCostTotalEntity.Amount, 2); } if (tempAllPageAbandonCostTotalEntity != null) { AllPageAbandonCostTotal = Math.Round(tempAllPageAbandonCostTotalEntity.Amount, 2); } } tbStatisticAllCostInfo.Text = string.Format("当前条件下总计:初始/作废 状态下的借货单成本金额总计分别是: 初始: ¥{0} 作废: ¥{1}。", AllPageOriginalCostTotal, AllPageAbandonCostTotal); }); #endregion #region 当前页统计成本 svStatisticInfo.Visibility = Visibility.Visible; decimal currentPageOriginalCostTotal = 0.00M; decimal currentPageAbandonCostTotal = 0.00M; if (vmList != null && vmList.Count > 0) { var currentPageOriginalInfoList = vmList.ToList().Where(x => { return(x.RequestStatus == LendRequestStatus.Origin); }); foreach (var item in currentPageOriginalInfoList) { currentPageOriginalCostTotal += item.LendTotalCost; } var currentPageAbandonList = vmList.ToList().Where(x => { return(x.RequestStatus == LendRequestStatus.Abandon); }); foreach (var item in currentPageAbandonList) { currentPageAbandonCostTotal += item.LendTotalCost; } } tbStatisticInfo.Text = string.Format("当前页中 :初始/作废 状态下的借货单成本金额总计分别是: 初始: ¥{0} 作废: ¥{1}。", currentPageOriginalCostTotal, currentPageAbandonCostTotal); #endregion }); }
private void dgInventoryQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { queryFilter = EntityConverter <InventoryQueryVM, InventoryQueryFilter> .Convert(queryVM); this.queryFilter.PagingInfo = new QueryFilter.Common.PagingInfo(); this.queryFilter.PagingInfo.PageIndex = e.PageIndex; this.queryFilter.PagingInfo.PageSize = e.PageSize; this.queryFilter.PagingInfo.SortBy = e.SortField; //如果查询总库存,则调用QueryInventory的service,否则调用QueryInventoryStock: //if (this.queryFilter.IsShowTotalInventory != null && this.queryFilter.IsShowTotalInventory.Value) //{ #region 获取自己能访问到的PM queryFilter.UserSysNo = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.LoginUser.UserSysNo; queryFilter.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; if (!AuthMgr.HasFunctionAbsolute(AuthKeyConst.IM_SeniorPM_Query)) { if (queryFilter == null || !queryFilter.ProductSysNo.HasValue) { Window.Alert("请先选择商品!"); return; } serviceFacade.CheckOperateRightForCurrentUser(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result) { serviceFacade.QueryInventoryList(queryFilter, (innerObj, innerArgs) => { if (innerArgs.FaultsHandle()) { return; } var getList = innerArgs.Result.Rows; foreach (var x in getList) { x["ActivedQty"] = x["ActivedQty"] == null || x["ActivedQty"].ToString() == "" ? "--" : x["ActivedQty"]; x["InactiveQty"] = x["InactiveQty"] == null || x["InactiveQty"].ToString() == "" ? "--" : x["InactiveQty"]; x["InvalidQty"] = x["InvalidQty"] == null || x["InvalidQty"].ToString() == "" ? "--" : x["InvalidQty"]; } int totalCount = innerArgs.Result.TotalCount; this.dgInventoryQueryResult.ItemsSource = getList; this.dgInventoryQueryResult.TotalCount = totalCount; }); //} //else //{ // serviceFacade.QueryInventoryStockList(queryFilter, (obj, args) => // { // if (args.FaultsHandle()) // { // return; // } // var getList = args.Result.Rows; // int totalCount = args.Result.TotalCount; // this.dgInventoryQueryResult.ItemsSource = getList; // this.dgInventoryQueryResult.TotalCount = totalCount; // }); //} this.UnPayOrderQtyColumn.Visibility = queryVM.IsUnPayShow ? Visibility.Visible : Visibility.Collapsed; this.StockNameColumn.Visibility = queryVM.IsShowTotalInventory ? Visibility.Collapsed : Visibility.Visible; } else { Window.Alert(string.Format("你没有权限查询该商品库存")); } }); } else { serviceFacade.QueryInventoryList(queryFilter, (innerObj, innerArgs) => { if (innerArgs.FaultsHandle()) { return; } var getList = innerArgs.Result.Rows; foreach (var x in getList) { x["ActivedQty"] = x["ActivedQty"] == null || x["ActivedQty"].ToString() == "" ? "--" : x["ActivedQty"]; x["InactiveQty"] = x["InactiveQty"] == null || x["InactiveQty"].ToString() == "" ? "--" : x["InactiveQty"]; x["InvalidQty"] = x["InvalidQty"] == null || x["InvalidQty"].ToString() == "" ? "--" : x["InvalidQty"]; } int totalCount = innerArgs.Result.TotalCount; this.dgInventoryQueryResult.ItemsSource = getList; this.dgInventoryQueryResult.TotalCount = totalCount; this.UnPayOrderQtyColumn.Visibility = queryVM.IsUnPayShow ? Visibility.Visible : Visibility.Collapsed; this.StockNameColumn.Visibility = queryVM.IsShowTotalInventory ? Visibility.Collapsed : Visibility.Visible; }); } #endregion }
private void dgCategoryExtendBrandQueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { CategoryExtendWarrantyQueryFacade facade = new CategoryExtendWarrantyQueryFacade(this); modelBrand = (CategoryExtendWarrantyDisuseBrandQueryVM)this.expander2.DataContext; facade.QueryCategoryExtendWarrantyDisuseBrand(modelBrand, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { this.dgCategoryExtendBrandQueryResult.ItemsSource = args.Result.Rows; this.dgCategoryExtendBrandQueryResult.TotalCount = args.Result.TotalCount; }); }