修改密码 固化锁线程 加oldplctrigger,避免重复调用
This commit is contained in:
1 parent
60cafc4f8c
commit
d20b935213
9 files changed
+303
-195
No files matched your search
@@ -7,6 +7,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1.db;
|
||||
using WindowsFormsApp1.mod;
|
||||
|
||||
namespace WindowsFormsApp1.form
|
||||
{
|
||||
@@ -24,7 +26,34 @@ namespace WindowsFormsApp1.form
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(string.IsNullOrEmpty(textBox1.Text)|| string.IsNullOrEmpty(textBox2.Text)|| string.IsNullOrEmpty(textBox3.Text))
|
||||
{
|
||||
MessageBox.Show("新旧密码不能为空!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (textBox1.Text != Init.t_User.password)
|
||||
{
|
||||
MessageBox.Show("原密码不正确!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (textBox2.Text != textBox3.Text)
|
||||
{
|
||||
MessageBox.Show("两次新密码不一致!");
|
||||
return;
|
||||
}
|
||||
Init.t_User.password = textBox2.Text;
|
||||
SQLiteHelper<t_user> userHelper = new SQLiteHelper<t_user>();
|
||||
var result = userHelper.Update(Init.t_User);
|
||||
if (!result.Success)
|
||||
{
|
||||
MessageBox.Show("密码修改失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("密码修改成功");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user