启动 加载语言配置文件

This commit is contained in:
ehkang
2022-03-18 19:06:26 +08:00
parent 0a4fe0907b
commit 2b39fb593c
48 changed files with 4487 additions and 393 deletions

View File

@@ -56,7 +56,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
cmbGender.Items.Clear();
@@ -97,7 +97,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑用户数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑用户数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -107,36 +107,36 @@ namespace CleanMachineHMI.frmChild
{
if (string.IsNullOrEmpty(txtAccount.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户编码!", "EnterUserCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入用户编码!", "EnterUserCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtName.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户名称!", "EnterUserNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入用户名称!", "EnterUserNameInfo"));
return;
}
if (string.IsNullOrEmpty(txtPS.Text))
{
//KryptonMessageBox.Show("请输入用户密码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入用户密码!", "EnterUserPasswordInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入用户密码!", "EnterUserPasswordInfo"));
return;
}
if (string.IsNullOrEmpty(txtPS1.Text))
{
//KryptonMessageBox.Show("请确认用户密码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请确认用户密码!", "ConfirmUserPasswordInfo"));
KryptonMessageBox.Show(this.GetInfoText("请确认用户密码!", "ConfirmUserPasswordInfo"));
return;
}
if (cmbGender.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择性别!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择性别!", "SelectUserGenderInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择性别!", "SelectUserGenderInfo"));
return;
}
if (txtPS1.Text != txtPS.Text)
{
//KryptonMessageBox.Show("两次输入的密码不同,请重新输入!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
KryptonMessageBox.Show(this.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
return;
}
string sql = $@"update SYS_USER set USER_CODE = '{txtAccount.Text}',USER_NAME = '{txtName.Text}',PASSWORD = '{txtPS1.Text}',GENDER = '{cmbGender.SelectedIndex}',ROLE_ID = '{((ListItem)kcmb_Role.SelectedItem).Value}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where USER_ID = '{UserId}'";
@@ -144,19 +144,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改用户数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改用户数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改用户数据成功!", "EditSuccessInfo"));
frmUser.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改用户数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改用户数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改用户数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑用户数据发生异常", "EditUserDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑用户数据发生异常", "EditUserDataExp") + $":【{ex.Message}】!");
}
}