using BBWY.Client.Models; using BBWY.Controls; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; namespace BBWY.Client.Views.Order { /// /// SD.xaml 的交互逻辑 /// public partial class SD : BWindow { public string OrderId { get; private set; } public bool IsSetStorageType { get; private set; } public decimal SDCommissionAmount { get; private set; } public decimal DeliveryExpressFreight { get; private set; } public SDType? SDType { get; private set; } public string Flag { get; private set; } public string VenderRemark { get; private set; } public SD(string orderId, bool isSetStorageType) { InitializeComponent(); this.OrderId = orderId; this.IsSetStorageType = isSetStorageType; } private void BWindow_Loaded(object sender, RoutedEventArgs e) { cbx_flag.ItemsSource = new List() { new KVModel() {Key="灰色",Value="Gray"}, new KVModel() {Key="红色",Value="Red"}, new KVModel() {Key="黄色",Value="Yellow"}, new KVModel() {Key="绿色",Value="Green"}, new KVModel() {Key="蓝色",Value="Blue"}, new KVModel() {Key="紫色",Value="Purple"} }; } private void btn_Save_Click(object sender, RoutedEventArgs e) { decimal.TryParse(txtSDCommissionAmount.Text, out decimal sdCommissionAmountd); decimal.TryParse(txtDeliveryExpressFreight.Text, out decimal deliveryExpressFreight); SDCommissionAmount = sdCommissionAmountd; DeliveryExpressFreight = deliveryExpressFreight; Flag = (cbx_flag.SelectedItem as KVModel).Value; SDType = (SDType)cbx_sdType.SelectedItem; VenderRemark = txtVenderRemark.Text; this.DialogResult = true; this.Close(); } } }