📄 changepwdform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DaFanRongMIS.ViewController.Login;
using DaFanRongMIS.Model.LoginOper;
namespace DaFanRongMIS.ViewController.Login
{
public partial class ChangePwdForm : Form
{
public ChangePwdForm()
{
InitializeComponent();
}
private void btnSave_Click(object sender, EventArgs e)
{
if (txtNewPassword.Text == "" || txtPassword.Text == "" || txtOldPassword.Text == "")
{
MessageBox.Show("密码不许空!");
return;
}
if (txtNewPassword.Text != txtPassword.Text)
{
MessageBox.Show("两次密码输入必须一致!");
return;
}
LoginDAOImpl log = new LoginDAOImpl();
int count = log.getUserPassword(txtOldPassword.Text.Trim());
if (count == 0)
{
MessageBox.Show("旧密码不正确!");
txtOldPassword.Focus();
txtOldPassword.SelectAll();
return;
}
string ret = log.setUserPassword(txtNewPassword.Text);
if (ret == "OK")
this.Close();
else
MessageBox.Show("密码修改错误,请联系管理员");
}
private void ChangePwdForm_Load(object sender, EventArgs e)
{
this.txtOldPassword.Focus();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -