HandTask.xaml.cs
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.ComponentModel;
using System.Windows;
namespace HH_WCS_Standard
{
/// <summary>
/// HandTask.xaml 的交互逻辑
/// </summary>
public partial class HandTask
{
private BaseBll baseBll = new BaseBll();
public HandTask()
{
InitializeComponent();
}
private void DMSkinWindow_Loaded(object sender, RoutedEventArgs e)
{
Comm_TaskType.ItemsSource = BindComboxEnumType<E_TaskType>.BindTyps;
Comm_TaskType.DisplayMemberPath = "Name";
Comm_TaskType.SelectedValuePath = "Type";
}
/// <summary>
/// WCS创建任务/下发任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
if (Comm_TaskType.SelectedValue == null)
{
MessageBox.Show("请选择任务类型");
return;
}
var taskType = (E_TaskType)Comm_TaskType.SelectedValue;
if (string.IsNullOrWhiteSpace(pallet.Text))
{
MessageBox.Show("条码不能为空");
return;
}
var Pallet = pallet.Text.Trim().ToString();
if (string.IsNullOrWhiteSpace(from.Text))
{
MessageBox.Show("起点不能为空");
return;
}
var fromPlace = from.Text.Trim().ToString();
if (string.IsNullOrWhiteSpace(to.Text))
{
MessageBox.Show("终点不能为空");
return;
}
var toPlace = to.Text.Trim().ToString();
BllResult<I_Task> result = baseBll.CreateTask("", "",taskType.GetIndexString(), Pallet, fromPlace, toPlace, "WCS");
if (result.Success)
{
MessageBox.Show($"手动下发任务成功,任务号:{result.Data.tNo}");
}
else
{
MessageBox.Show($"手动下发任务失败,错误原因:【{result.Msg}】");
}
}
}
}