Browse Source

修改文件导出和外箱未打印提示

章政 7 years ago
parent
commit
efffa7dc2f

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

@@ -20,7 +20,7 @@ namespace UAS_LabelMachine
             MemoryStream ms;
             ms = DataTableToExcel(dt);
             //以系统当前时间命名文件,FileMode.Create表示创建文件,FileAccess.Write表示拥有写的权限
-            string filePath = @FolderPath + "\\" + FileName + ".xlsx";
+            string filePath = @FolderPath + "\\" + FileName + ".xls";
             FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
             byte[] data = ms.ToArray();
             fs.Write(data, 0, data.Length);

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

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
@@ -37,7 +38,7 @@
             this.pib_id = new System.Windows.Forms.Label();
             this.pi_cardcode = new System.Windows.Forms.Label();
             this.Fresh = new System.Windows.Forms.LinkLabel();
-            this.RefreshDBConnect = new System.Windows.Forms.Timer();
+            this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -64,7 +65,7 @@
             this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.MidSource = new System.Windows.Forms.BindingSource();
+            this.MidSource = new System.Windows.Forms.BindingSource(this.components);
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             this.AttachInfo = new System.Windows.Forms.Button();
@@ -1416,6 +1417,7 @@
             this.OutBoxNum.Size = new System.Drawing.Size(72, 25);
             this.OutBoxNum.TabIndex = 91;
             this.OutBoxNum.SelectedIndexChanged += new System.EventHandler(this.OutBoxNum_SelectedIndexChanged);
+            this.OutBoxNum.SelectionChangeCommitted += new System.EventHandler(this.OutBoxNum_SelectionChangeCommitted);
             this.OutBoxNum.Click += new System.EventHandler(this.OutBoxNum_Click);
             // 
             // label10

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

@@ -782,7 +782,7 @@ namespace UAS_LabelMachine
                     SelectProdcode = LabelInf.Rows[SelectRowIndex].Cells["pib_prodcode"].Value.ToString();
                     for (int i = SelectRowIndex; i >= 0; i--)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true")
+                        if ((LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true") || i == SelectRowIndex)
                         {
                             LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
@@ -798,7 +798,7 @@ namespace UAS_LabelMachine
                     }
                     for (int i = SelectRowIndex; i < LabelInf.Rows.Count - 1; i++)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && LabelInf.Rows[i].Cells["pib_ifprint"].Value.ToString().ToLower() != "true")
+                        if ((LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true") || i == SelectRowIndex)
                         {
                             LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
@@ -1005,6 +1005,7 @@ namespace UAS_LabelMachine
                 OutReport.Print();
                 Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
                 Properties.Settings.Default.Save();
+                dh.UpdateByCondition("prodiobarcode", "pib_outifprint=-1", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "'");
             }
         }
 
@@ -1747,6 +1748,10 @@ namespace UAS_LabelMachine
 
         private void OutBoxNum_SelectedIndexChanged(object sender, EventArgs e)
         {
+            if (!ComBoxClickChangeLabelDoc)
+            {
+                OutBoxNum1 = OutBoxNum.Text;
+            }
             LoadGridData(sender, e);
         }
 
@@ -1758,5 +1763,16 @@ namespace UAS_LabelMachine
                 SelectRowIndex = dsc[0].Index;
             }
         }
+
+        string OutBoxNum1 = "";
+        private void OutBoxNum_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            if (OutBoxNum1 != "全部" && OutBoxNum1 != "新增")
+                if (dh.getFieldDataByCondition("prodiobarcode", "pib_outifprint", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + OutBoxNum1 + "'").ToString() != "-1")
+                {
+                    MessageBox.Show("外箱号" + OutBoxNum1 + "尚未打印标签");
+                }
+            OutBoxNum1 = OutBoxNum.Text;
+        }
     }
 }