WinTaskAdd.xaml.cs
2.55 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
69
70
71
72
73
using HHECS.Bll;
using HHECS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
namespace HHECS.View.TaskInfo
{
/// <summary>
/// TaskAdd.xaml 的交互逻辑
/// </summary>
public partial class WinTaskAdd : Window
{
public TaskEntity TaskEntity { get; set; }
public WinTaskAdd()
{
InitializeComponent();
InitContorl();
}
private void InitContorl()
{
BllResult<Dict> temp = AppSession.Bll.GetDictWithDetails("TaskPriority");//任务优先级
cbx_Priority.ItemsSource = temp.Success ? temp.Data.DictDetails : null;
cbx_Priority.SelectedValuePath = "Value";
cbx_Priority.DisplayMemberPath = "Name";
cbx_Priority.SelectedIndex = 0;
temp = AppSession.Bll.GetDictWithDetails("TaskType");//任务类型
cbx_TaskType.ItemsSource = temp.Success ? temp.Data.DictDetails : null;
cbx_TaskType.SelectedValuePath = "Value";
cbx_TaskType.DisplayMemberPath = "Name";
cbx_TaskType.SelectedIndex = 0;
temp = AppSession.Bll.GetDictWithDetails("Station");//站台
cbx_Station.ItemsSource = temp.Success ? temp.Data.DictDetails : null;
cbx_Station.SelectedValuePath = "Value";
cbx_Station.DisplayMemberPath = "Name";
cbx_Station.SelectedIndex = 0;
}
private void btn_Create_Click(object sender, RoutedEventArgs e)
{
#region
//if (Convert.ToInt32(cbx_TaskType.SelectedValue) != 900)
//{
// MessageBox.Show("注意:现在WCS只支持出库查看任务创建");
// return;
//}
#endregion
BllResult<TaskEntity> BllResult = AppSession.Bll.CreatTask(txt_Pallet.Text, Convert.ToInt32(cbx_Station.SelectedValue), txt_sourceLocation.Text, txt_destinationLocation.Text, 0, Convert.ToInt32(cbx_TaskType.SelectedValue), Convert.ToInt32(cbx_Priority.SelectedValue));
if (BllResult.Success)
{
MessageBox.Show("创建成功");
}
else
{
MessageBox.Show("创建失败:" + BllResult.Msg);
}
}
}
}