瀏覽代碼

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 年之前
父節點
當前提交
b0216cbbe1

+ 1 - 1
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -4,7 +4,7 @@
     {
         /// <summary>
         /// 必需的设计器变量。
-        /// </summary>
+        /// </summary> 
         private System.ComponentModel.IContainer components = null;
 
         /// <summary>

+ 11 - 1
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -376,6 +376,7 @@ namespace UAS_LabelMachine
                         if (int.Parse(GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString()) > int.Parse(CurrentPDNO))
                         {
                             GridPrcode.Rows[i].Selected = true;
+                            GridPrcode.FirstDisplayedScrollingRowIndex = i;
                             return;
                         }
                     }
@@ -387,6 +388,7 @@ namespace UAS_LabelMachine
                     if (int.Parse(outqty) > int.Parse(collectnum == "" ? "0" : collectnum))
                     {
                         GridPrcode.Rows[i].Selected = true;
+                        GridPrcode.FirstDisplayedScrollingRowIndex = i;
                     }
                 }
             }
@@ -575,6 +577,7 @@ namespace UAS_LabelMachine
                         if (int.Parse(outqty) > int.Parse(collectnum == "" ? "0" : collectnum))
                         {
                             GridPrcode.Rows[i].Selected = true;
+                            GridPrcode.FirstDisplayedScrollingRowIndex = i;
                         }
                     }
                     bi_inman.Text = dh.getFieldDataByCondition("barcodeio left join employee on bi_inman=em_code", "wm_concat(distinct em_name)", "bi_piid=" + PI_ID).ToString();
@@ -931,7 +934,7 @@ namespace UAS_LabelMachine
                 }
                 else
                 {
-                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "' and 中盒数量=10", "select");
+                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号='" + pib_outboxcode1 + "' and 中盒标识='外'", "select");
                 }
                 if (dt.Rows.Count > 0)
                 {
@@ -981,6 +984,7 @@ namespace UAS_LabelMachine
                         OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
                         OutReport.PrintSettings.ShowDialog = false;
                         OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
+                     
                         try
                         {
                             OutReport.Print();
@@ -993,6 +997,8 @@ namespace UAS_LabelMachine
                         BaseUtil.CleanDataTableData(dt1);
                     }
                 }
+                Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
+                Properties.Settings.Default.Save();
             }
         }
 
@@ -1284,6 +1290,7 @@ namespace UAS_LabelMachine
                 CurrentPrCount = GridPrcode.Rows[0].Cells["pd_outqty"].Value.ToString();
                 CurrentBrand = GridPrcode.Rows[0].Cells["pd_brand"].Value.ToString();
                 GridPrcode.Rows[0].Selected = true;
+                GridPrcode.FirstDisplayedScrollingRowIndex = 0;
             }
         }
 
@@ -1399,6 +1406,7 @@ namespace UAS_LabelMachine
             CurrentPrCount = GridPrcode.Rows[e.RowIndex].Cells["pd_outqty"].Value.ToString();
             CurrentBrand = GridPrcode.Rows[e.RowIndex].Cells["pd_brand"].Value.ToString();
             GridPrcode.Rows[e.RowIndex].Selected = true;
+            GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex;
             dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno='" + CurrentPDNO + "' and pib_prodcode='" + CurrentPrCode + "'", "delete");
             LoadGridData(sender, new EventArgs());
         }
@@ -1415,6 +1423,7 @@ namespace UAS_LabelMachine
                 CurrentPrCount = GridPrcode.Rows[dsc[0].Index].Cells["pd_outqty"].Value.ToString();
                 CurrentBrand = GridPrcode.Rows[dsc[0].Index].Cells["pd_brand"].Value.ToString();
                 GridPrcode.Rows[dsc[0].Index].Selected = true;
+                GridPrcode.FirstDisplayedScrollingRowIndex = dsc[0].Index;
             }
         }
 
@@ -1425,6 +1434,7 @@ namespace UAS_LabelMachine
             if (e.RowIndex >= 0)
             {
                 GridPrcode.Rows[e.RowIndex].Selected = true;
+                GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex;
             }
         }
 

+ 6 - 2
UAS_DeviceMonitor/DataOperate/DataHelper.cs

@@ -690,12 +690,14 @@ namespace UAS_DeviceMonitor.DataOperate
             return SerialNum;
         }
 
-        public void SaveDataTable(DataTable dt, string TableName, string ID, params string[] sql)
+        public void SaveDataTable(DataTable dt, string TableName, string ID, out string[] SavedID, params string[] sql)
         {
             if (dt == null)
             {
+                SavedID = new string[0];
                 return;
             }
+         
             StringBuilder sb = new StringBuilder();
             //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
             DataTable data = (DataTable)ExecuteSql("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", "select");
@@ -760,6 +762,7 @@ namespace UAS_DeviceMonitor.DataOperate
             sb.Append("update " + TableName + " set ");
             int ColumnCount = dt.Columns.Count;
             int RowCount = dt.Rows.Count;
+            SavedID = new string[RowCount];
             //存数据的参数
             List<string[]> Parameter = new List<string[]>();
             //存参数名的参数
@@ -782,6 +785,7 @@ namespace UAS_DeviceMonitor.DataOperate
                 for (int j = 0; j < RowCount; j++)
                 {
                     par[j] = dt.Rows[j][i].ToString();
+                    SavedID[j] = dt.Rows[j][ID].ToString();
                 }
                 Parameter.Add(par);
             }
@@ -966,7 +970,7 @@ namespace UAS_DeviceMonitor.DataOperate
             {
                 foreach (string sql in SQL)
                 {
-
+                    Console.WriteLine(sql);
                     if (!String.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;