Browse Source

排序BUG调整

章政 6 years ago
parent
commit
fa9926ad63
1 changed files with 8 additions and 2 deletions
  1. 8 2
      UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

+ 8 - 2
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -196,8 +196,14 @@ namespace UAS_LabelMachine.PublicMethod
                 //累计Excel该型号的数量
                 sumqty[pr_spec] += decimal.Parse(qty);
             }
-            dt.DefaultView.Sort = "箱号,DC ";
-            dt = dt.DefaultView.ToTable();
+            DataTable temp = dt.Clone();
+            temp.Columns["箱号"].DataType = typeof(int);
+            foreach (DataRow s in dt.Rows)
+            {
+                temp.ImportRow(s);//导入旧数据
+            }
+            temp.DefaultView.Sort = "箱号,DC ";
+            dt = temp.DefaultView.ToTable();
             for (int i = 0; i < dt1.Rows.Count; i++)
             {
                 //不包含型号则进行添加