结果接口: 通过属性名与mes编码对应,不使用PLC相对地址

This commit is contained in:
liming 蔡
2026-07-20 11:02:43 +08:00
parent b297ef0add
commit 6d2e1f4873
9 changed files with 154 additions and 111 deletions
+16 -9
View File
@@ -19,8 +19,8 @@ namespace JY.Inspection.Frm
pLogin_card.Location = new System.Drawing.Point(81, 282);
chkIsSK.CheckedChanged += chkIsSK_CheckedChanged;
txtPassword2.KeyUp += txtPassWord_KeyUp;
txtPassword2.KeyDown += txtPassword2_KeyDown;
txtICCard.KeyUp += txtPassWord_KeyUp;
txtICCard.KeyDown += txtPassword2_KeyDown;
btLogin.Click += btLogin_Click;
}
@@ -43,26 +43,26 @@ namespace JY.Inspection.Frm
TimeSpan ts = _tempDt.Subtract(_dt);
if (ts.Milliseconds > 100)
{
txtPassword2.Text = "";//清空
txtICCard.Text = "";//清空
}
else
{
if (e.KeyCode == Keys.Enter)
{
if (txtPassword2.Text == string.Empty)
if (txtICCard.Text == string.Empty)
{
txtPassword2.Focus();
txtICCard.Focus();
MessageBox.Show("IC卡号为空", "系统提示");
return;
}
UserHelper helper = new UserHelper("");
string strErr = "";
var res = helper.CheckUserLogin("user.pt", "", txtPassword2.Text.Trim(), ref strErr);
var res = helper.CheckUserLogin("user.pt", "", txtICCard.Text.Trim(), ref strErr);
if (res == null)
{
txtPassword2.Text = "";
txtPassword2.Focus();
txtICCard.Text = "";
txtICCard.Focus();
MessageBox.Show("IC卡号不正确" + strErr, "系统提示");
return;
}
@@ -87,7 +87,14 @@ namespace JY.Inspection.Frm
if (check_isMesLogin.Checked)
{
res = helper.CheckMesUserLogin(txtUserID.Text.Trim(), txtPassWord.Text.Trim(), ref strErr);
if (chkIsSK.Checked)
{
res = helper.CheckMesUserLogin(string.Empty, string.Empty, txtICCard.Text.Trim(), ref strErr);
}
else
{
res = helper.CheckMesUserLogin(txtUserID.Text.Trim(), txtPassWord.Text.Trim(), string.Empty, ref strErr);
}
}
else
{