Browse Source

修改密码update

Hcsy 7 years ago
parent
commit
6a4d4833c6
2 changed files with 7 additions and 2 deletions
  1. 1 0
      UAS-MES/PublicForm/ChangePwd.Designer.cs
  2. 6 2
      UAS-MES/PublicForm/ChangePwd.cs

+ 1 - 0
UAS-MES/PublicForm/ChangePwd.Designer.cs

@@ -145,6 +145,7 @@
             this.newpwd.Str1 = null;
             this.newpwd.Str2 = null;
             this.newpwd.TabIndex = 19;
+            this.newpwd.TextChanged += new System.EventHandler(this.checkpwd_TextChanged);
             // 
             // pwd
             // 

+ 6 - 2
UAS-MES/PublicForm/ChangePwd.cs

@@ -47,8 +47,12 @@ namespace UAS_MES.PublicForm
             if (LogicHandler.CheckUserLogin(UserName.Text, pwd.Text, out ErrorMessage))
             {
                 ErrorMessage = "";
-                string SQL = "update  employee set em_password = '"+newpwd.Text+"' where em_code='"+UserName.Text+"' ";
-                dh.ExecuteSql(SQL, "update");
+                String[] password = new string[1];
+                String[] username = new string[1];
+                password[0] = newpwd.Text;
+                username[0] = UserName.Text;
+                string SQL1 = "update  employee set em_password = :passowrd where em_code= :emcode ";
+                dh.BatchInsert(SQL1, new string[] { "passowrd", "emcode" }, password, username);
                 MessageBox.Show("修改密码成功");
                 Close();
             }