|
|
@@ -89,30 +89,17 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
//窗口关闭的时候
|
|
|
}
|
|
|
-
|
|
|
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
|
|
|
+ private void radioButton_CheckedChange(object sender, EventArgs e)
|
|
|
{
|
|
|
- //切换打印类型,清除输入值、工单代码、产品编号,名称、打印模板、核对第一次输入的SN
|
|
|
- if (giftBox.Checked)
|
|
|
+ RadioButton btn = sender as RadioButton;
|
|
|
+ if ((btn.Name == "giftBox" || btn.Name == "fuselagel") && btn.Checked)
|
|
|
{
|
|
|
//如果是切换成彩盒或者机身标提示用户 输入SN
|
|
|
OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
clearAll();
|
|
|
- }
|
|
|
- }
|
|
|
- private void CartonBox_CheckedChanged(object sender, EventArgs e)
|
|
|
- {
|
|
|
- if (CartonBox.Checked) {
|
|
|
- OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
|
|
|
- clearAll();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void fuselagel_CheckedChanged(object sender, EventArgs e)
|
|
|
- {
|
|
|
- if (fuselagel.Checked)
|
|
|
+ } else if (btn.Name == "CartonBox" || btn.Checked)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
+ OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
|
|
|
clearAll();
|
|
|
}
|
|
|
}
|
|
|
@@ -204,23 +191,24 @@ namespace UAS_MES.Make
|
|
|
indate[i] = Convert.ToDateTime(listA.Rows[i]["pl_indate"].ToString());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- private void normalButton1_Click(object sender, EventArgs e)
|
|
|
+ private void print_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
//输入值字段值不为空,打印不为空,有选中打印模板,才可以进行打印,打印前再次判断
|
|
|
- if (inputValue.Text=="") {
|
|
|
+ if (inputValue.Text == "")
|
|
|
+ {
|
|
|
OperateResult.AppendText("<<无箱号或者序列号\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
- if (PrintLabel.Text=="") {
|
|
|
+ if (PrintLabel.Text == "")
|
|
|
+ {
|
|
|
OperateResult.AppendText("<<无打印模板\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
//打印类型 彩盒或者标签,再次判断是否已装箱,未转号
|
|
|
if (giftBox.Checked || fuselagel.Checked)
|
|
|
{
|
|
|
- mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='"+ms_id+"' and ms_sncode='"+ inputValue.Text+"'", "select");
|
|
|
- if (mapB.Rows.Count==0)
|
|
|
+ mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
|
|
|
+ if (mapB.Rows.Count == 0)
|
|
|
{
|
|
|
//无值提示用户序列号错误,不存在或者已经发生转号
|
|
|
OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
|
|
|
@@ -237,23 +225,24 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText("<<打印成功\n", Color.Green);
|
|
|
Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
|
|
|
//打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked?"彩盒标补打印":"机身标补打印", "补打印成功", inputValue.Text, "");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
|
|
|
//如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
|
|
|
- if (mapB.Rows[0]["ms_downstatus"].ToString()=="0")
|
|
|
+ if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
|
|
|
{
|
|
|
- dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='"+ms_id+"'","update");
|
|
|
+ dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
|
|
|
//插入数据
|
|
|
putInfo2MakeDown();
|
|
|
}
|
|
|
}
|
|
|
//打印类型为卡通箱标签
|
|
|
- else if(CartonBox.Checked)
|
|
|
+ else if (CartonBox.Checked)
|
|
|
{
|
|
|
//select pa_downstatus from package where pa_outboxcode=? 输入值code
|
|
|
- mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='"+inputValue.Text+"'", "select");
|
|
|
+ mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
|
|
|
//无值提示用户箱号错误,不存在。
|
|
|
- if (mapB.Rows.Count==0) {
|
|
|
- OperateResult.AppendText("<<箱号:"+inputValue.Text+"错误,不存在\n", Color.Red);
|
|
|
+ if (mapB.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<箱号:" + inputValue.Text + "错误,不存在\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
//判断通过,打印
|
|
|
@@ -265,10 +254,11 @@ namespace UAS_MES.Make
|
|
|
sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
|
|
|
sql.Append("cl_result,cl_sncode,cl_code) values (commandlog_seq.nextval,:inman,sysdate,:linecode,:sourcecode,:makecode,");
|
|
|
sql.Append(":operate,:result,'','')");
|
|
|
- dh.ExecuteSql(sql.GetString(), "insert",User.UserCode,User.UserLineCode,User.UserSourceCode,ms_makecode.Text,"卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功");
|
|
|
+ dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode, ms_makecode.Text, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功");
|
|
|
//如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
|
|
|
- if (mapB.Rows[0]["pa_downstatus"].ToString()=="0") {
|
|
|
- dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='"+ inputValue.Text+"'", "update");
|
|
|
+ if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
|
|
|
//插入MakeDown表
|
|
|
putInfo2MakeDown();
|
|
|
}
|