|
@@ -18,9 +18,9 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
public partial class SystemSetting_PrinterTest : Form
|
|
public partial class SystemSetting_PrinterTest : Form
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- Engine engine = new Engine();
|
|
|
|
|
|
|
+ public BarTender.Application engine = new BarTender.Application();
|
|
|
|
|
|
|
|
- LabelFormatDocument format;
|
|
|
|
|
|
|
+ BarTender.Format format;
|
|
|
|
|
|
|
|
DataHelper dh = SystemInf.dh;
|
|
DataHelper dh = SystemInf.dh;
|
|
|
|
|
|
|
@@ -63,7 +63,8 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
MessageBox.Show("工单号不存在");
|
|
MessageBox.Show("工单号不存在");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- /*DataTable dt = (DataTable)dh.ExecuteSql("select pr_machinetype from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
|
|
|
|
|
|
|
+ string macode = ma_code.Text.Split('-')[1];
|
|
|
|
|
+ /*DataTable dt = (DataTable)dh.ExecuteSql("select pr_machinetype from make left join product on ma_prodcode=pr_code where ma_code='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
string pr_machinetype = dt.Rows[0]["pr_machinetype"].ToString();
|
|
string pr_machinetype = dt.Rows[0]["pr_machinetype"].ToString();
|
|
@@ -75,37 +76,37 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
}*/
|
|
}*/
|
|
|
if (OneColumn.Checked)
|
|
if (OneColumn.Checked)
|
|
|
{
|
|
{
|
|
|
- format = engine.Documents.Open(Application.StartupPath + "/单排.btw");
|
|
|
|
|
|
|
+ format = engine.Formats.Open(Application.StartupPath + "/单排.btw");
|
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 1)
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 1)
|
|
|
{
|
|
{
|
|
|
int temp = i;
|
|
int temp = i;
|
|
|
- for (int j = 0; j < format.SubStrings.Count; j++)
|
|
|
|
|
|
|
+ for (int j = 0; j < format.NamedSubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
- switch (format.SubStrings[j].Name)
|
|
|
|
|
|
|
+ switch (format.NamedSubStrings.Item(j + 1).Name)
|
|
|
{
|
|
{
|
|
|
case "SN":
|
|
case "SN":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "COLOR":
|
|
case "COLOR":
|
|
|
- format.SubStrings[j].Value = Color.Text;
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = Color.Text;
|
|
|
break;
|
|
break;
|
|
|
case "MACHINE":
|
|
case "MACHINE":
|
|
|
- format.SubStrings[j].Value = MachineType.Text;
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = MachineType.Text;
|
|
|
break;
|
|
break;
|
|
|
case "RAM":
|
|
case "RAM":
|
|
|
- format.SubStrings[j].Value = Ram.Text;
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = Ram.Text;
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- format.PrintSetup.PrinterName = PrinterList.Text;
|
|
|
|
|
|
|
+ format.PrintSetup.Printer = PrinterList.Text;
|
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
|
- format.Print();
|
|
|
|
|
|
|
+ format.PrintOut(false, false);
|
|
|
|
|
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
@@ -117,33 +118,33 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
}
|
|
}
|
|
|
if (TwoColumn.Checked)
|
|
if (TwoColumn.Checked)
|
|
|
{
|
|
{
|
|
|
- format = engine.Documents.Open(Application.StartupPath + "/双排.btw");
|
|
|
|
|
|
|
+ format = engine.Formats.Open(Application.StartupPath + "/双排.btw");
|
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
|
|
|
{
|
|
{
|
|
|
int temp = i;
|
|
int temp = i;
|
|
|
- for (int j = 0; j < format.SubStrings.Count; j++)
|
|
|
|
|
|
|
+ for (int j = 0; j < format.NamedSubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
- switch (format.SubStrings[j].Name)
|
|
|
|
|
|
|
+ switch (format.NamedSubStrings.Item(j + 1).Name)
|
|
|
{
|
|
{
|
|
|
case "SN":
|
|
case "SN":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN2":
|
|
case "SN2":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- format.PrintSetup.PrinterName = PrinterList.Text;
|
|
|
|
|
|
|
+ format.PrintSetup.Printer = PrinterList.Text;
|
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
|
- format.Print();
|
|
|
|
|
|
|
+ format.PrintOut(false, false);
|
|
|
|
|
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
@@ -155,38 +156,38 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
}
|
|
}
|
|
|
if (ThreeColumn.Checked)
|
|
if (ThreeColumn.Checked)
|
|
|
{
|
|
{
|
|
|
- format = engine.Documents.Open(Application.StartupPath + "/Label.btw");
|
|
|
|
|
|
|
+ format = engine.Formats.Open(Application.StartupPath + "/Label.btw");
|
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 3)
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 3)
|
|
|
{
|
|
{
|
|
|
int temp = i;
|
|
int temp = i;
|
|
|
- for (int j = 0; j < format.SubStrings.Count; j++)
|
|
|
|
|
|
|
+ for (int j = 0; j < format.NamedSubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
- switch (format.SubStrings[j].Name)
|
|
|
|
|
|
|
+ switch (format.NamedSubStrings.Item(j + 1).Name)
|
|
|
{
|
|
{
|
|
|
case "SN":
|
|
case "SN":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN2":
|
|
case "SN2":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN3":
|
|
case "SN3":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- format.PrintSetup.PrinterName = PrinterList.Text;
|
|
|
|
|
|
|
+ format.PrintSetup.Printer = PrinterList.Text;
|
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
|
- format.Print();
|
|
|
|
|
|
|
+ format.PrintOut(false, false);
|
|
|
|
|
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
@@ -198,43 +199,43 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
}
|
|
}
|
|
|
if (FourColumn.Checked)
|
|
if (FourColumn.Checked)
|
|
|
{
|
|
{
|
|
|
- format = engine.Documents.Open(Application.StartupPath + "/四排.btw");
|
|
|
|
|
|
|
+ format = engine.Formats.Open(Application.StartupPath + "/四排.btw");
|
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 4)
|
|
for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 4)
|
|
|
{
|
|
{
|
|
|
int temp = i;
|
|
int temp = i;
|
|
|
- for (int j = 0; j < format.SubStrings.Count; j++)
|
|
|
|
|
|
|
+ for (int j = 0; j < format.NamedSubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
- switch (format.SubStrings[j].Name)
|
|
|
|
|
|
|
+ switch (format.NamedSubStrings.Item(j + 1).Name)
|
|
|
{
|
|
{
|
|
|
case "SN":
|
|
case "SN":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN2":
|
|
case "SN2":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN3":
|
|
case "SN3":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
case "SN4":
|
|
case "SN4":
|
|
|
- format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 3).ToString()));
|
|
|
|
|
- if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
|
|
|
|
|
- dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
|
|
|
|
|
|
|
+ format.NamedSubStrings.Item(j + 1).Value = (macode + ";" + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 3).ToString()));
|
|
|
|
|
+ if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.NamedSubStrings.Item(j + 1).Value + "' and msl_makecode='" + macode + "'"))
|
|
|
|
|
+ dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + macode + "','" + format.NamedSubStrings.Item(j + 1).Value + "','before',-1)", "insert");
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- format.PrintSetup.PrinterName = PrinterList.Text;
|
|
|
|
|
|
|
+ format.PrintSetup.Printer = PrinterList.Text;
|
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
format.PrintSetup.IdenticalCopiesOfLabel = 1;
|
|
|
- format.Print();
|
|
|
|
|
|
|
+ format.PrintOut(false, false);
|
|
|
|
|
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
|
|
@@ -258,9 +259,6 @@ namespace UAS_MES_NEW.SystemSetting
|
|
|
|
|
|
|
|
private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
|
|
private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
- engine.Start();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
ma_code.TableName = " make left join product on ma_prodcode=pr_code";
|
|
ma_code.TableName = " make left join product on ma_prodcode=pr_code";
|
|
|
ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
|
|
ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
|
|
|
ma_code.FormName = Name;
|
|
ma_code.FormName = Name;
|