private void btnClose_Click(object sender, RoutedEventArgs e) { int totalOperateCount = 0; string closeCommissionSysNoList = string.Empty; if (QueryResultGrid.ItemsSource != null) { foreach (object ovj in QueryResultGrid.ItemsSource) { CommissionMasterVM item = ovj as CommissionMasterVM; if (item.IsChecked) { totalOperateCount++; closeCommissionSysNoList += string.Format("{0};", item.SysNo.Value.ToString()); } } } if (string.IsNullOrEmpty(closeCommissionSysNoList)) { Window.Alert(ResCommissionQuery.InfoMsg_Title, ResCommissionQuery.ErrorMsg_Close, MessageType.Error); return; } //关闭佣金操作: serviceFacade.BatchCloseCommissions(closeCommissionSysNoList, (obj, args) => { if (args.FaultsHandle()) { Window.Alert(args.Error.Faults[0].ErrorDescription); return; } int totalSuccCount = args.Result; Window.Alert(string.Format(ResCommissionQuery.InfoMsg_Opertion, totalSuccCount, totalOperateCount - totalSuccCount)); Window.Refresh(); }); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); m_serviceFacade = new VendorCommissionFacade(this); this.DataContext = m_masterVM = new CommissionMasterVM(); InitComboBoxData(); SetAccessControl(); }
public void CreateCommission(CommissionMasterVM req, EventHandler <RestClientEventArgs <CommissionMaster> > callback) { string relativeUrl = "/POService/Commission/CreateSettleCommission"; var info = req.ConvertVM <CommissionMasterVM, CommissionMaster>(); info.CompanyCode = CPApplication.Current.CompanyCode; restClient.Update <CommissionMaster>(relativeUrl, info, callback); }
public void GetManualCommissionMaster(CommissionMasterVM queryFilter, EventHandler <RestClientEventArgs <CommissionMaster> > callback) { string relativeUrl = "/POService/Commission/GetManualCommissionMaster"; var info = queryFilter.ConvertVM <CommissionMasterVM, CommissionMaster>(); info.CompanyCode = CPApplication.Current.CompanyCode; restClient.Query(relativeUrl, info, callback); }
private void hpSysNo_Click(object sender, RoutedEventArgs e) { CommissionMasterVM vm = this.QueryResultGrid.SelectedItem as CommissionMasterVM; if (null != vm) { //结算编号链接: Window.Navigate(string.Format(ConstValue.PO_CommissionItemView, vm.SysNo.Value), null, true); } }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); masterVM = new CommissionMasterVM(); serviceFacade = new VendorCommissionFacade(this); CommissionSysNo = this.Request.Param; if (!string.IsNullOrEmpty(CommissionSysNo)) { BindCommissionItems(); } SetAccessControl(); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { if (ValidInput()) { //加载佣金信息: m_serviceFacade.GetManualCommissionMaster(m_masterVM, (obj, args) => { if (args.FaultsHandle()) { return; } m_masterVM = args.Result.Convert <CommissionMaster, CommissionMasterVM>(); this.DataContext = m_masterVM; if (this.m_masterVM.ItemList.Count > 0) { this.m_masterVM.ItemList.ForEach(x => { if (x.SaleRule != null) { x.SaleRuleDisplayString = string.Format(ResCommissionItemView.Label_SaleRuleDisplayString, x.SaleRule.MinCommissionAmt.Value.ToString("f2")); x.SaleRule.StagedSaleRuleItems.ForEach(j => { if (j.StartAmt == 0.00m && j.EndAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString2, j.Percentage.Value.ToString("f2")); } else if (j.StartAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString3, j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } else if (j.EndAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString4, j.StartAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } else { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString5, j.StartAmt.Value.ToString("f2"), j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } }); } }); btnCreate.IsEnabled = true; } BindItemGrid(); }); } }
private void BindCommissionItems() { //加载佣金信息: serviceFacade.GetCommissionInfoBySysNo(CommissionSysNo, (obj, args) => { if (args.FaultsHandle()) { return; } this.masterVM = EntityConverter <CommissionMaster, CommissionMasterVM> .Convert(args.Result); this.DataContext = masterVM; if (null != this.masterVM.ItemList) { this.masterVM.ItemList.ForEach(x => { if (x.SaleRule != null) { x.SaleRuleDisplayString = string.Format(ResCommissionItemView.Label_SaleRuleDisplayString, x.SaleRule.MinCommissionAmt.Value.ToString("f2")); x.SaleRule.StagedSaleRuleItems.ForEach(j => { if (j.StartAmt == 0.00m && j.EndAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString2, j.Percentage.Value.ToString("f2")); } else if (j.StartAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString3, j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } else if (j.EndAmt == 0.00m) { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString4, j.StartAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } else { x.SaleRuleDisplayString += "\r\n" + string.Format(ResCommissionItemView.Label_SaleRuleDisplayString5, j.StartAmt.Value.ToString("f2"), j.EndAmt.Value.ToString("f2"), j.Percentage.Value.ToString("f2")); } }); } }); } BindItemGrid(); }); }