Browse Source

格式调整

章政 6 years ago
parent
commit
14880f8e47

+ 1 - 1
UAS-出货标签管理(贸易版)/PublicMethod/Print.cs

@@ -354,7 +354,7 @@ namespace UAS_LabelMachine.PublicMethod
                 }
                 if (iCustProdCode || iCustPo || iDC || iLotNo)
                 {
-                    GroupByCondition = " group by "+(GroupByCondition.Substring(0, GroupByCondition.Length - 1));
+                    GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
                 }
                 sql.Append("1,");
                 DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + GroupByCondition, "select");

+ 24 - 19
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -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)