using Sunny.UI;
|
using sunui.forms;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
using WMS.Model;
|
using WMS.Untils;
|
|
namespace WMS.UI.SynthesizeQuery
|
{
|
public partial class FrmHandOutStore : UIForm
|
{
|
private string _sourceStation = string.Empty;
|
private string _materialCode = "";
|
private string _materialName = "";
|
public FrmHandOutStore(string sourceStation, string materialCode, string materialName)
|
{
|
InitializeComponent();
|
_sourceStation = sourceStation;
|
_materialCode = materialCode;
|
_materialName = materialName;
|
this.lbl_SourceStation.Text = sourceStation;
|
|
this.lbl_materialCode.Text = materialCode;
|
this.lbl_materialName.Text = materialName;
|
}
|
|
private void LoadItemType()
|
{
|
List<ListItem> itemList = new List<ListItem>();
|
itemList.Add(new ListItem()
|
{
|
Text = "1-39-1",
|
Value = "1-39-1"
|
});
|
itemList.Add(new ListItem()
|
{
|
Text = "2-39-1",
|
Value = "2-39-1"
|
});
|
itemList.Add(new ListItem()
|
{
|
Text = "1-0-1",
|
Value = "1-0-1"
|
});
|
itemList.Add(new ListItem()
|
{
|
Text = "2-0-1",
|
Value = "2-0-1"
|
});
|
foreach (var item in itemList)
|
{
|
this.cmb_outStorePosition.Items.Add(item);
|
}
|
|
cmb_outStorePosition.SelectedIndex = 0;
|
}
|
|
private void FrmHandOutStore_Load(object sender, EventArgs e)
|
{
|
LoadItemType();
|
}
|
|
private void button_confirm_Click(object sender, EventArgs e)
|
{
|
ListItem selProFlag = null;
|
var outStorePosition = ComboBoxHelper.GetComboxSelectValue(this.cmb_outStorePosition, ref selProFlag);
|
if (string.IsNullOrEmpty(outStorePosition))
|
{
|
ShowErrorTip("请选择出库口!");
|
return;
|
}
|
int flag = this.ck_IsPick.Checked ? 2 : 1;
|
//创建任务
|
var title = this.ck_IsPick.Checked ? "你选择的是分拣出库" : "你选择的是出库";
|
|
if (this.ck_IsPick.Checked)
|
{
|
if (_materialCode == "GT-KTP" || _materialCode == "GG-KTP")
|
{
|
ShowErrorTip("物料是空托盘,不允许被分拣!");
|
return;
|
}
|
}
|
if (_materialCode == "GT-KTP" || _materialCode == "GG-KTP")
|
{
|
flag = 3;
|
}
|
|
DialogResult dr = MessageBox.Show(title + ",确定要新建任务吗", "新建出库任务", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
if (dr == DialogResult.OK)
|
{
|
using (yunneiWCS.IyunneiWcfClient client = new yunneiWCS.IyunneiWcfClient())
|
{
|
var result = client.CreateTaskForHandOutStore(flag, FLogin.user.UserName, _sourceStation, outStorePosition);
|
if (result.result)
|
{
|
ShowSuccessTip("新建人工出库任务成功");
|
this.Close();
|
}
|
else
|
{
|
ShowErrorTip(result.resMsg);
|
}
|
}
|
}
|
}
|
|
private void button_cancel_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
}
|
}
|