using BBWY.Client.Models; using BBWY.Controls; using System.Collections.Generic; using System.Windows; namespace BBWY.Client.Views.Order { /// /// OutStock.xaml 的交互逻辑 /// public partial class OutStock : BWindow { public string OrderId { get; private set; } public IList LogisticsResponseList { get; private set; } public string WaybillNo { get; private set; } public LogisticsResponse SelectedLogistics { get; private set; } public OutStock(string orderId, IList logisticsResponseList) { InitializeComponent(); this.OrderId = orderId; this.LogisticsResponseList = logisticsResponseList; this.DataContext = this; } private void btn_Save_Click(object sender, RoutedEventArgs e) { if (cbx_Logistics.SelectedItem == null) { MessageBox.Show("请选择快递公司", "出库"); return; } SelectedLogistics = cbx_Logistics.SelectedItem as LogisticsResponse; if (string.IsNullOrEmpty(txt_waybill.Text) && SelectedLogistics.Name != "厂家自送") { MessageBox.Show("非厂家自送需要填写快递单号", "出库"); return; } WaybillNo = txt_waybill.Text; this.DialogResult = true; this.Close(); } } }