MES登录接口设置
This commit is contained in:
@@ -43,7 +43,6 @@ namespace JY.Inspection.Frm
|
||||
TimeSpan ts = _tempDt.Subtract(_dt);
|
||||
if (ts.Milliseconds > 100)
|
||||
{
|
||||
|
||||
txtPassword2.Text = "";//清空
|
||||
}
|
||||
else
|
||||
@@ -75,7 +74,6 @@ namespace JY.Inspection.Frm
|
||||
}
|
||||
private void btLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(txtUserID.Text) | string.IsNullOrEmpty(txtPassWord.Text))
|
||||
{
|
||||
txtUserID.Focus();
|
||||
@@ -84,12 +82,31 @@ namespace JY.Inspection.Frm
|
||||
}
|
||||
UserHelper helper = new UserHelper("");
|
||||
string strErr = "";
|
||||
var res = helper.CheckUserLogin("user.pt", txtUserID.Text.Trim(), txtPassWord.Text.Trim(), ref strErr);
|
||||
|
||||
User res = null;
|
||||
|
||||
if (check_isMesLogin.Checked)
|
||||
{
|
||||
res = helper.CheckMesUserLogin(txtUserID.Text.Trim(), txtPassWord.Text.Trim(), ref strErr);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = helper.CheckUserLogin("user.pt", txtUserID.Text.Trim(), txtPassWord.Text.Trim(), ref strErr);
|
||||
}
|
||||
|
||||
if (res == null)
|
||||
{
|
||||
txtPassWord.Focus();
|
||||
loginFailedCount++;
|
||||
MessageBox.Show($"用户名或密码不正确,登录失败({loginFailedCount})次!", "系统提示");
|
||||
if (check_isMesLogin.Checked)
|
||||
{
|
||||
MessageBox.Show($"使用MES账户登录失败,错误信息: {strErr}!", "系统提示");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"用户名或密码不正确,登录失败({loginFailedCount})次!", "系统提示");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user