|
|
@@ -767,14 +767,6 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (!MidLabelAutoPrint.Checked)
|
|
|
- {
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1='" + MidOutBoxCodeIndex[i] + "'", "select");
|
|
|
- if (dt.Rows.Count < 10)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
MidBoxCodePrint(la_id, MidOutBoxCodeIndex[i]);
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
@@ -909,12 +901,23 @@ namespace UAS_LabelMachine
|
|
|
//名称相等的时候,取SQL进行值的查询
|
|
|
string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
|
|
|
string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
|
|
|
- MidReport.RegisterData(dt, "prodiomidinfo_view");
|
|
|
- MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
|
|
|
- MidReport.PrintSettings.ShowDialog = false;
|
|
|
- MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
|
|
|
- MidReport.Print();
|
|
|
+ DataTable dt;
|
|
|
+ if (MidLabelAutoPrint.Checked)
|
|
|
+ {
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "' and 中盒数量=10", "select");
|
|
|
+ }
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ MidReport.RegisterData(dt, "prodiomidinfo_view");
|
|
|
+ MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
|
|
|
+ MidReport.PrintSettings.ShowDialog = false;
|
|
|
+ MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
|
|
|
+ MidReport.Print();
|
|
|
+ }
|
|
|
Properties.Settings.Default.MPrinter = MidLabelPrinter.Text;
|
|
|
Properties.Settings.Default.Save();
|
|
|
}
|