Frm_TaskInfo.xaml.cs
3.18 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using HHWCS.Bll;
using HHWCS.Model;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
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 HHWCSHost.View
{
/// <summary>
/// Frm_TaskInfo.xaml 的交互逻辑
/// </summary>
public partial class Frm_TaskInfo : Window
{
public Frm_TaskInfo()
{
InitializeComponent();
InitControl();
}
private void InitControl()
{
endTime.SelectedDate = DateTime.Now.AddDays(1);
beginTime.SelectedDate = DateTime.Now.AddDays(-7);
cbx_TaskStatus.ItemsSource = AppCommon.GetTaskStatus();
cbx_TaskStatus.DisplayMemberPath = "Value";
cbx_TaskStatus.SelectedValuePath = "Key";
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
this.Hide();
}
private void btn_Query_Click(object sender, RoutedEventArgs e)
{
dgv_1.ItemsSource = AppCommon.Bll.GetTasks((String)cbx_TaskStatus.SelectedValue, txt_TaskNo.Text, txt_Pallet.Text, beginTime.SelectedDate, endTime.SelectedDate).Data;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Frm_TaskAdd frm_TaskAdd = new Frm_TaskAdd();
frm_TaskAdd.ShowDialog();
btn_Query_Click(null, null);
}
private void btn_Delete_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("删除功能在当前版本下不可用");
return;
if (dgv_1.SelectedItems == null || dgv_1.SelectedItems.Count == 0)
{
MessageBox.Show("未选中数据");
}
foreach (TaskEntity item in dgv_1.SelectedItems)
{
var a = AppCommon.Bll.DeleteTask(item.Id);
AppCommon.Bll.UpdateLocationStatus(item.DestinationLocation, item.WarehouseId, "empty", AppCommon.ConnectionString);
if (!a.Success)
{
MessageBox.Show("删除出现问题,操作中止:" + a.Msg);
return;
}
}
MessageBox.Show("删除成功");
btn_Query_Click(null, null);
}
private void btn_SendToWCS_Click(object sender, RoutedEventArgs e)
{
if (dgv_1.SelectedItems == null || dgv_1.SelectedItems.Count == 0)
{
MessageBox.Show("未选中数据");
}
foreach (TaskEntity item in dgv_1.SelectedItems)
{
var a = AppCommon.Bll.SendTaskToWCS(item.Id);
if (!a.Success)
{
MessageBox.Show("下发出现问题,操作中止:" + a.Msg);
return;
}
}
MessageBox.Show("下发成功");
}
}
}