步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.3 KiB

2 years ago
using BBWY.Client.APIServices;
using BBWY.Client.Models.FallWare;
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WebSocketSharp;
namespace BBWY.Client.Views.FallWare
{
/// <summary>
/// SetCloudWareBoxWindow.xaml 的交互逻辑
/// </summary>
public partial class SetCloudWareBoxWindow : BWindow
{
public SetCloudWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true)
{
if (SealBoxService == null) this.SealBoxService = sealBoxService;
WareType = wareType;
ReflashWindow = reflashWindow;
JDWareBoxModel = model;
InitializeComponent();
this.DataContext =this ;
2 years ago
if (!isEnabled)
{
//this.jd_box.IsEnabled = isEnabled;
//this.btn_save.Visibility = Visibility.Collapsed;
2 years ago
}
}
public JDWareBoxModel JDWareBoxModel { get; set; }
private SealBoxService SealBoxService { get; set; }
private Action ReflashWindow { get; set; }
public WareType WareType { get; set; }
2 years ago
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty())
{
MessageBox.Show("采购单号不能为空");
return;
}
if (JDWareBoxModel.PrewOrder.IsNullOrEmpty() && WareType == WareType.)
{
MessageBox.Show("预约单号不能为空");
return;
}
var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo);
if (res != null && res.Success)
{
if (ReflashWindow != null) ReflashWindow();
this.Close();
return;
}
if (res != null) MessageBox.Show(res.Msg);
}
}
}