Prechádzať zdrojové kódy

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

章政 8 rokov pred
rodič
commit
b7921b8ac4

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -193,7 +193,7 @@ namespace UAS_MES.Make
                         {
                             OperateResult.AppendText(">>" + code.Text + "\n", Color.Black);
                             //开始录入SN
-                            if (ChangeResult.Checked||!dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "' and ms_status='1'"))
+                            if (ChangeResult.Checked||!dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "'"))
                             {
                                 //判断用户是否锁定输入SN长度,
                                 if (!checkLengthOrPre(SNLength_checkBox, SNLength, "长度", "SN"))
@@ -381,7 +381,7 @@ namespace UAS_MES.Make
             {
                 //校验已经完成,此时要再次校验之前的SN和关联采集信息
                 //再次校验SN
-                if (!dh.CheckExist("makeserial", "ms_sncode='" + SN + "' and ms_status='1'"))
+                if (!dh.CheckExist("makeserial", "ms_sncode='" + SN + "'"))
                 {
                     bool flag = true;
                     if (!ChangeResult.Checked)

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -171,6 +171,12 @@ namespace UAS_MES.Make
                         //bsncode不为空,说明输入的是转换后的序列号
                         else
                         {
+                            //判断用户是否锁定输入转换后序列号长度,
+                            if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
+                                return;
+                            //判断用户是否锁定输入转换后序列号前缀,
+                            if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
+                                return;
                             //判断输入的转换后序列号是否符合起始终止
                             if (!checkStartAndEnd())
                             {
@@ -178,16 +184,10 @@ namespace UAS_MES.Make
                                 sncode.Text = "";
                                 return;
                             }
-                            //判断用户是否锁定输入转换后序列号长度,
-                            if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
-                                return;
-                            //判断用户是否锁定输入转换后序列号前缀,
-                            if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
-                                return;
                             //如果两次输入的序列号相同进行提示,不相同则进行下一步
                             if (bsncode != sncode.Text)
                             {
-                                if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_status='1'"))
+                                if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
                                 {
                                     string firstsn = "";
                                     string updateSql = "";

+ 4 - 2
UAS-MES/PublicForm/ChangePwd.Designer.cs

@@ -171,11 +171,13 @@
             this.headBar1.Size = new System.Drawing.Size(331, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = null;
+            this.headBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.headBar1_MouseDown);
             // 
             // ChangePwd
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
             this.ClientSize = new System.Drawing.Size(331, 211);
             this.Controls.Add(this.UserName);
             this.Controls.Add(this.label1);
@@ -188,9 +190,9 @@
             this.Controls.Add(this.mc_madeqty_label);
             this.Controls.Add(this.headBar1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "ChangePwd";
-            this.Tag = "ChangePwd";
+            this.Tag = "ShowDialogWindow";
             this.Text = "ChangePwd";
             this.Load += new System.EventHandler(this.ChangePwd_Load);
             this.ResumeLayout(false);

+ 25 - 0
UAS-MES/PublicForm/ChangePwd.cs

@@ -4,6 +4,7 @@ using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
@@ -15,6 +16,23 @@ namespace UAS_MES.PublicForm
     public partial class ChangePwd : Form
     {
 
+        //所有用到了headBar的部分都需要这段代码
+        [DllImport("user32.dll")]
+        public static extern bool ReleaseCapture();
+
+        [DllImport("user32.dll")]
+        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
+
+        [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
+        public static extern int GetWindowLong(HandleRef hWnd, int nIndex);
+
+        [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
+        public static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
+
+        public const int WM_SYSCOMMAND = 0x0112;
+        public const int SC_MOVE = 0xF010;
+        public const int HTCAPTION = 0x0002;
+
         DataHelper dh;
         string ErrorMessage;
 
@@ -43,6 +61,7 @@ namespace UAS_MES.PublicForm
             dh = new DataHelper();
             UserName.Text = BaseUtil.GetCacheData("LastLoginUser").ToString();
             Confirm.Enabled = false;
+  
         }
 
         private void checkpwd_TextChanged(object sender, EventArgs e)
@@ -55,5 +74,11 @@ namespace UAS_MES.PublicForm
                 Confirm.Enabled = true;
             }
         }
+
+        private void headBar1_MouseDown(object sender, MouseEventArgs e)
+        {
+            ReleaseCapture();
+            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
+        }
     }
 }