|
@@ -398,41 +398,9 @@ namespace UAS_LabelMachine
|
|
|
string pib_outboxcode2 = "";
|
|
|
|
|
|
int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
|
|
|
- if (BoxNum + CodeCount > OutboxCapacity.Value && AutoSetOutBox.Checked)
|
|
|
+ if (ConnectToMachine)
|
|
|
{
|
|
|
- string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
-
|
|
|
- if (maxoutbox == "")
|
|
|
- {
|
|
|
- pib_outboxcode2 = "1";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
|
|
|
- }
|
|
|
- OutBoxNum.Items.Clear();
|
|
|
-
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
|
|
|
- ItemObject io = new ItemObject("新增", "新增");
|
|
|
- OutBoxNum.Items.Add(io);
|
|
|
- io = new ItemObject("全部", "全部");
|
|
|
- OutBoxNum.Items.Add(io);
|
|
|
- io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
|
|
|
- PassSixTenCount = 1;
|
|
|
- OutBoxNum.Items.Add(io);
|
|
|
-
|
|
|
- for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
- {
|
|
|
- string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
|
|
|
- io = new ItemObject(piboutboxcode2, piboutboxcode2);
|
|
|
- OutBoxNum.Items.Add(io);
|
|
|
- }
|
|
|
- if (OutBoxNum.Items.Count > 2)
|
|
|
- OutBoxNum.SelectedIndex = 2;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (OutBoxNum.Text == "新增")
|
|
|
+ if (BoxNum + CodeCount > OutboxCapacity.Value && AutoSetOutBox.Checked)
|
|
|
{
|
|
|
string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
|
|
@@ -445,14 +413,16 @@ namespace UAS_LabelMachine
|
|
|
pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
|
|
|
}
|
|
|
OutBoxNum.Items.Clear();
|
|
|
- PassSixTenCount = 1;
|
|
|
+
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
|
|
|
ItemObject io = new ItemObject("新增", "新增");
|
|
|
OutBoxNum.Items.Add(io);
|
|
|
io = new ItemObject("全部", "全部");
|
|
|
OutBoxNum.Items.Add(io);
|
|
|
io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
|
|
|
+ PassSixTenCount = 1;
|
|
|
OutBoxNum.Items.Add(io);
|
|
|
+
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
|
|
@@ -464,7 +434,52 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pib_outboxcode2 = OutBoxNum.Text;
|
|
|
+ if (OutBoxNum.Text == "新增")
|
|
|
+ {
|
|
|
+ string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
+
|
|
|
+ if (maxoutbox == "")
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = (int.Parse(maxoutbox) + 1).ToString();
|
|
|
+ }
|
|
|
+ OutBoxNum.Items.Clear();
|
|
|
+ PassSixTenCount = 1;
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2) desc", "select");
|
|
|
+ ItemObject io = new ItemObject("新增", "新增");
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ io = new ItemObject("全部", "全部");
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ string piboutboxcode2 = dt.Rows[i]["pib_outboxcode2"].ToString();
|
|
|
+ io = new ItemObject(piboutboxcode2, piboutboxcode2);
|
|
|
+ OutBoxNum.Items.Add(io);
|
|
|
+ }
|
|
|
+ if (OutBoxNum.Items.Count > 2)
|
|
|
+ OutBoxNum.SelectedIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pib_outboxcode2 = OutBoxNum.Text;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (BoxNum + CodeCount > OutboxCapacity.Value)
|
|
|
+ {
|
|
|
+ string close = MessageBox.Show(this.ParentForm, "箱号【" + OutBoxNum.Text + "】后超数量为" + (BoxNum + CodeCount) + ",超出容量" + OutboxCapacity.Value + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
+ if (close != "Yes")
|
|
|
+ {
|
|
|
+ Input.SelectAll();
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (OutBoxNum.Text == "全部")
|
|
@@ -590,7 +605,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (CollectQty / double.Parse(CurrentZXBZ) % double.Parse(MidboxCapacity.Value.ToString()) == 0)
|
|
|
{
|
|
|
- LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
|
|
|
+ if (LabelInf.Rows.Count > 0)
|
|
|
+ LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
|
|
|
if (AutoPrintMidBox.Checked)
|
|
|
MidLabelPrint.PerformClick();
|
|
|
}
|
|
@@ -1260,7 +1276,6 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
|
|
|
MidReport.Load(MidLabelCombox.SelectedValue.ToString());
|
|
|
-
|
|
|
for (int j = 0; j < MidReport.Parameters.Count; j++)
|
|
|
{
|
|
|
MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
|
|
@@ -2562,6 +2577,10 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void Connect_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
+ SingleLabelAutoPrint.Checked = true;
|
|
|
+ MidLabelAutoPrint.Checked = true;
|
|
|
+ CurrentRowOnly.Checked = true;
|
|
|
+ AutoPrintMidBox.Checked = true;
|
|
|
receiveClient = new TcpClient();
|
|
|
sendClient = new TcpClient();
|
|
|
resetClient = new TcpClient();
|