|
|
@@ -117,12 +117,32 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
//select max(ms_id)ms_id from makeserial where ms_sncode=?
|
|
|
ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
|
|
|
- //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
|
|
|
if (ms_id == "")
|
|
|
{
|
|
|
- OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
|
|
|
- OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
- return;
|
|
|
+ //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select max(ms_id) ms_id from makeserial where ms_imei1 ='" + inputText.Text + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
|
|
|
+ {
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select max(ms_id) ms_id from makeserial where ms_imei2 ='" + inputText.Text + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<SN错误,序列号" + inputText.Text + "不存在\n", Color.Red, inputText);
|
|
|
+ OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ms_id = dt.Rows[0]["ms_id"].ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ms_id = dt.Rows[0]["ms_id"].ToString();
|
|
|
+ }
|
|
|
}
|
|
|
////判断是否装箱通过
|
|
|
//if (checkPacked())
|
|
|
@@ -140,6 +160,19 @@ namespace UAS_MES_NEW.Make
|
|
|
else if (CartonBox.Checked)
|
|
|
{
|
|
|
//查询箱号是否存在
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_outboxcode='" + inputText.Text + "' or ms_imei2='" + inputText.Text + "' or ms_imei1='" + inputText.Text + "' order by ms_id desc", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ inputText.Text = dt.Rows[0]["ms_outboxcode"].ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_imei2='" + inputText.Text + "' order by ms_id desc", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ inputText.Text = dt.Rows[0]["ms_outboxcode"].ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
|
|
|
if (dt.Rows.Count == 0)
|
|
|
{
|