public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); newVM = new CollectionPaymentInfoVM() { CurrencyCode = "1", TaxRateData = PurchaseOrderTaxRate.Percent017 }; mergedItemList = new List <CollectionPaymentItemInfoVM>(); serviceFacade = new CollectionPaymentFacade(this); InitializeComboBoxData(); this.DataContext = newVM; CalcSettleProducts(); SetAccessControl(); //供应商附加选择事件 ucVendorPicker.VendorSelected += new EventHandler <VendorSelectedEventArgs>(ucVendorPicker_VendorSelected); }
private void btnReset_Click(object sender, RoutedEventArgs e) { //重置操作: Window.Confirm(ResConsignNew.ConfirmMsg_Reset, (obj, args) => { if (args.DialogResult == DialogResultType.OK) { this.newVM = new CollectionPaymentInfoVM(); this.mergedItemList = new List <CollectionPaymentItemInfoVM>(); this.newVM.TaxRateData = PurchaseOrderTaxRate.Percent017; this.txtPaySettleCompany.Text = string.Empty; this.DataContext = newVM; this.SettleProductsQueryResultGrid.Bind(); CalcSettleProducts(); } }); }
/// <summary> /// 加载代销结算单信息 /// </summary> private void LoadConsignInfo() { serviceFacade.GetConsignSettlementInfo(ConsignSysNo, (obj, args) => { if (args.FaultsHandle()) { return; } consignSettleVM = new CollectionPaymentInfoVM(); consignSettleVM = EntityConverter <CollectionPaymentInfo, CollectionPaymentInfoVM> .Convert(args.Result, (s, t) => { if (s.SourceStockInfo != null) { t.StockSysNo = s.SourceStockInfo.SysNo; t.StockID = s.SourceStockInfo.SysNo.Value.ToString(); t.StockName = s.SourceStockInfo.StockName.ToString(); } t.PMSysNo = s.PMInfo.SysNo.HasValue ? s.PMInfo.SysNo.Value.ToString() : null; t.SettleUserSysNo = s.SettleUser.SysNo; t.SettleUserName = s.SettleUser.UserName; t.SettleItems.ForEach(x => { x.ConsignToAccLogInfo.SettleType = x.SettleType; x.IsSettleCostTextBoxReadOnly = (t.Status != POCollectionPaymentSettleStatus.Origin || x.SettleType != SettleType.O) ? true : false; x.IsSettlePercentageTextBoxReadOnly = (t.Status != POCollectionPaymentSettleStatus.Origin || x.SettleType != SettleType.P) ? true : false; x.SettlePercentageTextBoxVisibility = x.SettleType == SettleType.P ? Visibility.Visible : Visibility.Collapsed; }); txtPaySettleCompany.Text = EnumConverter.GetDescription(t.VendorInfo.VendorBasicInfo.PaySettleCompany); }); CountConsignSettleItems(); this.DataContext = consignSettleVM; this.SettleProductsQueryResultGrid.Bind(); CalcSettleProducts(); ShowActionButton(consignSettleVM.Status.Value); this.consignSettleVM.ValidationErrors.Clear(); }); }