Files
WCS_YongFeng_CP/WCS_YongFeng_CP/Page/HandView/HandTask.xaml.cs
T
2025-06-06 22:10:47 +08:00

61 lines
1.8 KiB
C#

using System.Windows;
namespace WCS_YongFeng
{
/// <summary>
/// HandTask.xaml 的交互逻辑
/// </summary>
public partial class HandTask
{
private BaseBll baseBll = new BaseBll();
public HandTask()
{
InitializeComponent();
}
private void DMSkinWindow_Loaded(object sender, RoutedEventArgs e)
{
}
/// <summary>
/// WCS创建任务/下发任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
var fromplace = from.Text.Trim().ToString();
var toplace = to.Text.Trim().ToString();
var pall = pallet.Text.Trim().ToString();
string type = "";
if (string.IsNullOrWhiteSpace(fromplace) && !string.IsNullOrWhiteSpace(toplace))
{
fromplace = "EntranceStationA01";
type = E_TaskType.入库.GetIndexString();
}
else if (!string.IsNullOrWhiteSpace(fromplace) && string.IsNullOrWhiteSpace(toplace))
{
toplace = "ExitStationA01";
type = E_TaskType.出库.GetIndexString();
}
else
{
MessageBox.Show("起点终点不允许都为空!");
return;
}
BllResult<I_Task> result = baseBll.CreateTask("", type, pall, fromplace, toplace, "WCS手动");
if (result.Success)
{
MessageBox.Show($"手动下发任务成功,任务号:{result.Data.tNo}");
}
else
{
MessageBox.Show($"手动下发任务失败,错误原因:【{result.Msg}】");
}
}
}
}