private void cmbVendorPayTermsType_SelectionChanged(object sender, SelectionChangedEventArgs e) { //账期类型下拉框改变,更新计算公式TextBlock: VendorPayTermsItemInfo info = this.cmbVendorPayTermsType.SelectedItem as VendorPayTermsItemInfo; if (null != info && !string.IsNullOrEmpty(info.DiscribComputer)) { this.txtPayTypeComputeText.Text = info.DiscribComputer.ToString().Replace("</br>", Environment.NewLine); //自动审核: if (info.PayTermsNo == 29 || info.PayTermsNo == 30 || info.PayTermsNo == 31) { vendorInfoVM.VendorFinanceInfo.IsAutoAudit = true; } else { vendorInfoVM.VendorFinanceInfo.IsAutoAudit = null; } } else { this.txtPayTypeComputeText.Text = string.Empty; } }
private void cmbPayPeriodType_SelectionChanged(object sender, SelectionChangedEventArgs e) { VendorPayTermsItemInfo getSelectedPayTerms = this.cmbPayPeriodType.SelectedItem as VendorPayTermsItemInfo; if (null != getSelectedPayTerms) { this.lblSettlePeriodTypeDesc.Text = getSelectedPayTerms.DiscribComputer.Replace("</br>", Environment.NewLine); if (getSelectedPayTerms.PayTermsNo == 29 || getSelectedPayTerms.PayTermsNo == 30 || getSelectedPayTerms.PayTermsNo == 31) { if (isNewFinanceInfo) { this.chkAutoAudit.IsEnabled = true; } } else { if (isNewFinanceInfo) { this.chkAutoAudit.IsEnabled = false; this.editVM.VendorFinanceInfo.IsAutoAudit = false; } } } }
private void btnCreate_Click(object sender, RoutedEventArgs e) { #region [UI 验证] if (!ValidationManager.Validate(this.Root)) { return; } this.tabVendorAdvancedInfo.SelectedIndex = 1; this.UpdateLayout(); if (!ValidationManager.Validate(this.tabVendorAdvancedInfo)) { return; } VendorPayTermsItemInfo getSelectedItem = this.cmbVendorPayTermsType.SelectedItem as VendorPayTermsItemInfo; if (getSelectedItem.PayTermsNo == null) { Window.Alert(ResVendorNew.Msg_PayTermsNull); return; } if (string.IsNullOrEmpty(vendorInfoVM.VendorBasicInfo.EmailAddress)) { Window.Alert(ResVendorNew.Msg_VendorMailAddressNull); return; } this.tabVendorAdvancedInfo.SelectedIndex = 2; this.UpdateLayout(); if (!ValidationManager.Validate(this.tabVendorAdvancedInfo)) { return; } this.tabVendorAdvancedInfo.SelectedIndex = 0; #endregion //新建供应商信息: //默认分仓: this.vendorInfoVM.VendorBasicInfo.ExtendedInfo.DefaultStock = (this.cmbDefaultStock.Visibility == Visibility.Collapsed ? (int?)null : this.vendorInfoVM.VendorBasicInfo.ExtendedInfo.DefaultStock); this.vendorInfoVM.VendorFinanceInfo.PayPeriodType.PayTermsNo = int.Parse(this.cmbVendorPayTermsType.SelectedValue.ToString()); this.vendorInfoVM.VendorFinanceInfo.SettlePeriodType = cmbSettlePeriodType.Visibility == Visibility.Collapsed ? null : ((KeyValuePair <Nullable <VendorSettlePeriodType>, string>) this.cmbSettlePeriodType.SelectedItem).Key; this.vendorInfoVM.VendorBasicInfo.VendorIsCooperate = VendorIsCooperate.Yes; this.vendorInfoVM.VendorBasicInfo.BuyWeekDayVendor = BuildSelectVendorBuyWeekDayString(); this.vendorInfoVM.VendorBasicInfo.ExtendedInfo.CurrencyCode = VendorCurrencyCode.CNY.ToString(); this.vendorInfoVM.VendorBasicInfo.ConsignFlag = VendorConsignFlag.Sell; serviceFacade.CreateVendor(this.vendorInfoVM, (obj, args) => { if (args.FaultsHandle()) { return; } string getCreatedVendorSysNo = args.Result.SysNo.Value.ToString(); Window.Alert(ResVendorNew.AlertMsg_AlertTitle, ResVendorNew.AlertMsg_CreateVendorSuc, MessageType.Information, (obj2, args2) => { if (args2.DialogResult == DialogResultType.Cancel) { Window.Navigate(string.Format("/ECCentral.Portal.UI.PO/VendorMaintain/{0}", getCreatedVendorSysNo), null, false); } }); }); }