启动 加载语言配置文件

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

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddRole_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_roleGrade.Items.Clear();
@@ -65,18 +65,18 @@ namespace CleanMachineHMI.frmChild
{
if (string.IsNullOrEmpty(txtRoleCode.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色编码!", "EnterRoleCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入角色编码!", "EnterRoleCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtRoleName.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
return;
}
int roleGrade = 0;
if (kcmb_roleGrade.SelectedIndex == 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
return;
}
else if (kcmb_roleGrade.SelectedIndex == 1)
@@ -85,7 +85,7 @@ namespace CleanMachineHMI.frmChild
DataTable dtIsExistAdmin = LeadDbHelperSQLite.Query(sqlIsExistAdmin).Tables[0];
if (dtIsExistAdmin != null && dtIsExistAdmin.Rows.Count > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("管理员角色只能存在一个,请重新选择!", "AdminOnlyInfo"));
KryptonMessageBox.Show(this.GetInfoText("管理员角色只能存在一个,请重新选择!", "AdminOnlyInfo"));
return;
}
roleGrade = 100;
@@ -143,18 +143,18 @@ namespace CleanMachineHMI.frmChild
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增角色数据成功!", "AddSuccessInfo"));
frmRole.RefreshFrmHost();
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增角色数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增角色数据发生异常", "AddRoleDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增角色数据发生异常", "AddRoleDataExp") + $":【{ex.Message}】!");
}
}