瀏覽代碼

额外打开窗口可拖动

Hcsy 8 年之前
父節點
當前提交
23974ccb93

+ 2 - 2
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -305,6 +305,8 @@ namespace UAS_MES.Warehouse
                             OperateResult.AppendText("未选择录入数据类型\n", Color.Red,input);
                             OperateResult.AppendText("未选择录入数据类型\n", Color.Red,input);
                             return;
                             return;
                         }
                         }
+                        LoadFormData();
+                        LoadGridData();
                         if (dta.Rows[0]["pi_type"].ToString() == "按订单出货")
                         if (dta.Rows[0]["pi_type"].ToString() == "按订单出货")
                         {
                         {
                             if (int.Parse(dtform.Rows[0]["outqty"].ToString()) > int.Parse(dtform.Rows[0]["getqty"].ToString()))
                             if (int.Parse(dtform.Rows[0]["outqty"].ToString()) > int.Parse(dtform.Rows[0]["getqty"].ToString()))
@@ -324,8 +326,6 @@ namespace UAS_MES.Warehouse
                             dh.UpdateByCondition("prodinout", "pi_pdastatus='备货中'", "pi_inoutno='" + pi_inoutno.Text + "'");
                             dh.UpdateByCondition("prodinout", "pi_pdastatus='备货中'", "pi_inoutno='" + pi_inoutno.Text + "'");
                             OperateResult.AppendText("出货单" + pi_inoutno.Text + "备货成功\n", Color.Black,input);
                             OperateResult.AppendText("出货单" + pi_inoutno.Text + "备货成功\n", Color.Black,input);
                         }
                         }
-                        LoadFormData();
-                        LoadGridData();
                     }
                     }
                     else
                     else
                     {
                     {

+ 1 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_NewPiInOut.Designer.cs

@@ -50,6 +50,7 @@
             this.headBar1.Size = new System.Drawing.Size(304, 32);
             this.headBar1.Size = new System.Drawing.Size(304, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
             this.headBar1.Title = null;
+            this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
             // 
             // 
             // Confirm
             // Confirm
             // 
             // 

+ 16 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_NewPiInOut.cs

@@ -4,6 +4,7 @@ using System.ComponentModel;
 using System.Data;
 using System.Data;
 using System.Drawing;
 using System.Drawing;
 using System.Linq;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 using System.Windows.Forms;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
 using UAS_MES.DataOperate;
@@ -14,6 +15,15 @@ namespace UAS_MES.Warehouse
 {
 {
     public partial class Warehouse_NewPiInOut : Form
     public partial class Warehouse_NewPiInOut : Form
     {
     {
+
+        [DllImport("user32.dll")]
+        public static extern bool ReleaseCapture();
+        [DllImport("user32.dll")]
+        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+        public const int WM_SYSCOMMAND = 0x0112;
+        public const int SC_MOVE = 0xF010;
+        public const int HTCAPTION = 0x0002;
+
         DataTable dbfind;
         DataTable dbfind;
 
 
         DataHelper dh;
         DataHelper dh;
@@ -98,5 +108,11 @@ namespace UAS_MES.Warehouse
         {
         {
             pi_inoutno1 = pi_inoutno.Text;
             pi_inoutno1 = pi_inoutno.Text;
         }
         }
+
+        private void headBar1_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
     }
     }
 }
 }

+ 2 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_ProdDetail.Designer.cs

@@ -47,6 +47,7 @@
             this.headBar1.Size = new System.Drawing.Size(621, 32);
             this.headBar1.Size = new System.Drawing.Size(621, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
             this.headBar1.Title = null;
+            this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
             // 
             // 
             // InOutDetailDGV
             // InOutDetailDGV
             // 
             // 
@@ -58,6 +59,7 @@
             this.outqty,
             this.outqty,
             this.getqty,
             this.getqty,
             this.ungetqty});
             this.ungetqty});
+            this.InOutDetailDGV.EnableContentClick = true;
             this.InOutDetailDGV.Location = new System.Drawing.Point(32, 37);
             this.InOutDetailDGV.Location = new System.Drawing.Point(32, 37);
             this.InOutDetailDGV.Margin = new System.Windows.Forms.Padding(2);
             this.InOutDetailDGV.Margin = new System.Windows.Forms.Padding(2);
             this.InOutDetailDGV.Name = "InOutDetailDGV";
             this.InOutDetailDGV.Name = "InOutDetailDGV";

+ 15 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_ProdDetail.cs

@@ -4,6 +4,7 @@ using System.ComponentModel;
 using System.Data;
 using System.Data;
 using System.Drawing;
 using System.Drawing;
 using System.Linq;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 using System.Windows.Forms;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
 using UAS_MES.DataOperate;
@@ -13,6 +14,14 @@ namespace UAS_MES.Warehouse
 {
 {
     public partial class Warehouse_ProdDetail : Form
     public partial class Warehouse_ProdDetail : Form
     {
     {
+        [DllImport("user32.dll")]
+        public static extern bool ReleaseCapture();
+        [DllImport("user32.dll")]
+        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+        public const int WM_SYSCOMMAND = 0x0112;
+        public const int SC_MOVE = 0xF010;
+        public const int HTCAPTION = 0x0002;
+
         DataTable dbfind;
         DataTable dbfind;
 
 
         DataHelper dh;
         DataHelper dh;
@@ -45,5 +54,11 @@ namespace UAS_MES.Warehouse
                 InOutDetailDGV.Rows[i].Cells["ungetqty"].Value = (int.Parse(InOutDetailDGV.Rows[i].Cells["outqty"].Value.ToString()) - int.Parse(InOutDetailDGV.Rows[i].Cells["getqty"].Value.ToString())).ToString();
                 InOutDetailDGV.Rows[i].Cells["ungetqty"].Value = (int.Parse(InOutDetailDGV.Rows[i].Cells["outqty"].Value.ToString()) - int.Parse(InOutDetailDGV.Rows[i].Cells["getqty"].Value.ToString())).ToString();
             }
             }
         }
         }
+
+        private void headBar1_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
     }
     }
 }
 }