|
|
@@ -9,6 +9,7 @@ using UAS_MES_NEW.Entity;
|
|
|
using LabelManager2;
|
|
|
using System.Threading;
|
|
|
using UAS_MES_NEW.PublicForm;
|
|
|
+using System.Web.UI.WebControls;
|
|
|
|
|
|
namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
@@ -90,7 +91,7 @@ namespace UAS_MES_NEW.Make
|
|
|
lbl = new ApplicationClass();
|
|
|
BaseUtil.WriteLbl();
|
|
|
}
|
|
|
- catch (Exception )
|
|
|
+ catch (Exception)
|
|
|
{
|
|
|
OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
|
|
|
}
|
|
|
@@ -135,7 +136,7 @@ namespace UAS_MES_NEW.Make
|
|
|
if (CheckTSN.Checked == true && ms_id != null)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '"+sncode.Text+"'");
|
|
|
+ sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '" + sncode.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -157,7 +158,7 @@ namespace UAS_MES_NEW.Make
|
|
|
//判断界面工单是否为空时的序列号是否自动归属工单
|
|
|
// 获取工单归属工单下一工序是否正确
|
|
|
string status = "";
|
|
|
- LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out status,out ErrorMessage);
|
|
|
+ LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out status, out ErrorMessage);
|
|
|
if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
|
|
|
{
|
|
|
//获取工单的其他信息
|
|
|
@@ -225,14 +226,18 @@ namespace UAS_MES_NEW.Make
|
|
|
if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
// doc = lbl.Documents.Open(PrintLabel.Text);
|
|
|
- if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
|
|
|
- {
|
|
|
- //提示用户打印成功
|
|
|
- OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
|
|
|
- }
|
|
|
- else
|
|
|
+
|
|
|
+ for (int i = 0; i < _dt.Rows.Count; i++)
|
|
|
{
|
|
|
- OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
|
|
|
+ if (Print.CodeSoft(Tag.ToString(), ref lbl, _dt.Rows[i]["la_url"].ToString(), _dt.Rows[i]["la_id"].ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
|
|
|
+ {
|
|
|
+ //提示用户打印成功
|
|
|
+ OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
|
|
|
+ }
|
|
|
}
|
|
|
if (CollectRemark.Checked && Remark.Text != "")
|
|
|
{
|
|
|
@@ -292,11 +297,11 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ DataTable _dt;
|
|
|
//根据产品编号获取打印模板
|
|
|
private void pr_code_TextChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
- DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
|
|
|
+ _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
|
|
|
PrintLabel.DataSource = _dt;
|
|
|
PrintLabel.DisplayMember = "la_url";
|
|
|
PrintLabel.ValueMember = "la_id";
|