|
|
@@ -2034,31 +2034,36 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void LabelInf_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
|
|
{
|
|
|
- StringBuilder pibid = new StringBuilder();
|
|
|
- string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "盒")
|
|
|
+ if (e.RowIndex > 0)
|
|
|
{
|
|
|
-
|
|
|
- string midbox = LabelInf.Rows[e.RowIndex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pin_madein")
|
|
|
{
|
|
|
- if (midbox == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
+ StringBuilder pibid = new StringBuilder();
|
|
|
+ string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "盒")
|
|
|
{
|
|
|
- LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
- pibid.Append(LabelInf.Rows[i].Cells["pib_id1"].Value + ",");
|
|
|
+ string midbox = LabelInf.Rows[e.RowIndex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
+ for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ if (midbox == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
|
|
|
+ {
|
|
|
+ LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
+ pibid.Append(LabelInf.Rows[i].Cells["pib_id1"].Value + ",");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "全部")
|
|
|
+ {
|
|
|
+ for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
+ pibid.Append(LabelInf.Rows[i].Cells["pib_id1"].Value + ",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pibid.Append("1");
|
|
|
+ sdh.ExecuteSql("update prodiobarcode set pib_madein='" + madein + "' where pib_id in (" + pibid + ")", "update");
|
|
|
}
|
|
|
}
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "全部")
|
|
|
- {
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
- {
|
|
|
- LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
|
|
|
- pibid.Append(LabelInf.Rows[i].Cells["pib_id1"].Value + ",");
|
|
|
- }
|
|
|
- }
|
|
|
- pibid.Append("1");
|
|
|
- sdh.ExecuteSql("update prodiobarcode set pib_madein='" + madein + "' where pib_id in (" + pibid + ")", "update");
|
|
|
}
|
|
|
|
|
|
private void ExportData_Click(object sender, EventArgs e)
|