启动 加载语言配置文件

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

@@ -8,8 +8,8 @@
<add key="GlobalPaletteMode" value="Professionaloffice2003"/>
<!--<add key="LanguageCode" value="Chinese"/>-->
<add key="LanguageCode" value="English"/>
<add key="LanguageCode" value="zh-CN"/>
<!--<add key="LanguageCode" value="English"/>-->
<add key="sqlmapConfigPath" value="Config/sqlmap.config"/>
<!--MySql数据库连接字符串-->
<add key="LeadMySql" value="Data Source = localhost; Port=3306;Initial Catalog = testasrs; Persist Security Info=True;User ID = root; Password=sa1234567;"/>

View File

@@ -17,6 +17,7 @@
<ItemGroup>
<PackageReference Include="Krypton.Navigator" Version="60.22.2.32" />
<PackageReference Include="Krypton.Toolkit" Version="60.22.2.32" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NModbus" Version="3.0.72" />
<PackageReference Include="NModbus.Serial" Version="3.0.72" />
</ItemGroup>
@@ -42,10 +43,22 @@
<Reference Include="System.Management" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="DataBase\clearMac.db">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

View File

@@ -87,7 +87,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kdtp_CreateStartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
kdtp_CreateEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
@@ -117,7 +117,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载清洁方式界面发生异常", "LoadFrmCleanModeExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载清洁方式界面发生异常", "LoadFrmCleanModeExp") + $":【{ex.Message}】!");
}
}
@@ -129,7 +129,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询清洁方式数据发生异常", "QueryCleanModeData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询清洁方式数据发生异常", "QueryCleanModeData") + $":【{ex.Message}】!");
}
}
@@ -159,7 +159,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的清洗方式数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的清洗方式数据行!", "SelectWantToEditRow"));
}
}
@@ -169,7 +169,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的清洗方式数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的清洗方式数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string CleanModeId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -177,23 +177,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除清洗方式数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除清洗方式数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除清洗方式数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除清洗方式数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的清洗方式数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的清洗方式数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除清洁方式数据发生异常", "DeleteCleanModeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除清洁方式数据发生异常", "DeleteCleanModeDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -76,7 +76,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CONTAMINATION_TYPE_CODE,CONTAMINATION_TYPE_NAME from BAS_CONTAMINATION_TYPE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -122,7 +122,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载污染明细界面发生异常", "LoadContaminationDTLExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载污染明细界面发生异常", "LoadContaminationDTLExp") + $":【{ex.Message}】!");
}
}
@@ -134,7 +134,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询污染明细数据发生异常", "QueryContaminationDTLData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询污染明细数据发生异常", "QueryContaminationDTLData") + $":【{ex.Message}】!");
}
}
@@ -164,7 +164,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的污染明细数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的污染明细数据行!", "SelectWantToEditRow"));
}
}
@@ -174,7 +174,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的污染明细数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的污染明细数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string ContaminationDtlId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -182,23 +182,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染明细数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除污染明细数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染明细数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除污染明细数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的污染明细数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的污染明细数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染明细数据发生异常", "DeleteContaminationDTLDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除污染明细数据发生异常", "DeleteContaminationDTLDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -86,7 +86,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CLEAN_MODE_CODE,CLEAN_MODE_NAME from BAS_CLEAN_MODE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -132,7 +132,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载污染类型界面发生异常", "LoadContaminationTypeExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载污染类型界面发生异常", "LoadContaminationTypeExp") + $":【{ex.Message}】!");
}
}
@@ -144,7 +144,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询污染类型数据发生异常", "QueryContaminationTypeData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询污染类型数据发生异常", "QueryContaminationTypeData") + $":【{ex.Message}】!");
}
}
@@ -174,7 +174,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的污染类型数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的污染类型数据行!", "SelectWantToEditRow"));
}
}
@@ -184,7 +184,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的污染类型数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的污染类型数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string ContaminationId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -192,23 +192,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染类型数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除污染类型数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染类型数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除污染类型数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的污染类型数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的污染类型数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染类型数据发生异常", "DeleteContaminationTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除污染类型数据发生异常", "DeleteContaminationTypeDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -80,7 +80,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_roleGrade.Items.Clear();
@@ -116,7 +116,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载角色信息界面发生异常", "LoadRoleMsgExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载角色信息界面发生异常", "LoadRoleMsgExp") + $":【{ex.Message}】!");
}
}
@@ -136,7 +136,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的角色数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的角色数据行!", "SelectWantToEditRow"));
}
}
@@ -146,7 +146,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的角色信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的角色信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string UserId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -154,30 +154,30 @@ namespace CleanMachineHMI.FrmUserControl
DataTable dtIsExistAdmin = LeadDbHelperSQLite.Query(sqlIsExistAdmin).Tables[0];
if (dtIsExistAdmin != null && dtIsExistAdmin.Rows.Count > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("管理员角色不允许删除!", "DeleteAdminRoleInfo"));
KryptonMessageBox.Show(this.GetInfoText("管理员角色不允许删除!", "DeleteAdminRoleInfo"));
return;
}
string sql = $@"DELETE FROM SYS_ROLE WHERE ROLE_ID = '{UserId}'";
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除角色数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除角色数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除角色数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除角色数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的角色数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的角色数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除角色数据发生异常", "DeleteRoleDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除角色数据发生异常", "DeleteRoleDataExp") + $":【{ex.Message}】!");
}
}
@@ -189,7 +189,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询角色信息数据发生异常", "QueryRoleMsgData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询角色信息数据发生异常", "QueryRoleMsgData") + $":【{ex.Message}】!");
}
}
@@ -213,7 +213,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要授权菜单权限的角色数据行!", "SelectWantToPermissionRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要授权菜单权限的角色数据行!", "SelectWantToPermissionRow"));
}
}
}

View File

@@ -83,7 +83,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kdtp_CreateStartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
kdtp_CreateEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
@@ -112,7 +112,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载板材类型界面发生异常", "LoadSheetTypeExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载板材类型界面发生异常", "LoadSheetTypeExp") + $":【{ex.Message}】!");
}
}
@@ -124,7 +124,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询板材类型数据发生异常", "QuerySheetTypeData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询板材类型数据发生异常", "QuerySheetTypeData") + $":【{ex.Message}】!");
}
}
@@ -154,7 +154,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的板材类型数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的板材类型数据行!", "SelectWantToEditRow"));
}
}
@@ -164,7 +164,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的板材类型数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的板材类型数据吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string SheetTypeId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -172,23 +172,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除板材类型数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除板材类型数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除板材类型数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除板材类型数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的板材类型数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的板材类型数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除污染板材类型数据发生异常", "DeleteSheetTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除污染板材类型数据发生异常", "DeleteSheetTypeDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -79,7 +79,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kdtp_CreateStartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
kdtp_CreateEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
@@ -117,7 +117,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载用户信息界面发生异常", "LoadUserMsgExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载用户信息界面发生异常", "LoadUserMsgExp") + $":【{ex.Message}】!");
}
}
@@ -129,7 +129,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询用户信息数据发生异常", "QueryUserMsgData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询用户信息数据发生异常", "QueryUserMsgData") + $":【{ex.Message}】!");
}
}
@@ -159,7 +159,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的用户信息数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的用户信息数据行!", "SelectWantToEditRow"));
}
}
@@ -169,7 +169,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的用户信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的用户信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string UserId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -177,23 +177,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除用户数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除用户数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除用户数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除用户数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的用户数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的用户数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除用户信息数据发生异常", "DeleteUserMsgDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除用户信息数据发生异常", "DeleteUserMsgDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -86,7 +86,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kdtp_CreateStartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
kdtp_CreateEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
@@ -125,7 +125,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载报警信息界面发生异常", "LoadWarningMsgExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载报警信息界面发生异常", "LoadWarningMsgExp") + $":【{ex.Message}】!");
}
}
@@ -137,7 +137,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询报警信息数据发生异常", "QueryWarningMsgDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询报警信息数据发生异常", "QueryWarningMsgDataExp") + $":【{ex.Message}】!");
}
}
@@ -167,7 +167,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的报警信息数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的报警信息数据行!", "SelectWantToEditRow"));
}
}
@@ -177,7 +177,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (dataGridView.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的报警信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的报警信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string WarningId = dataGridView.SelectedRows[0].Cells[0].Value.ToString();
@@ -185,23 +185,23 @@ namespace CleanMachineHMI.FrmUserControl
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除报警数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除报警数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除报警数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除报警数据失败!", "DeleteFailInfo"));
}
}
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的报警数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的报警数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除报警信息数据发生异常", "DeleteWarningMsgDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除报警信息数据发生异常", "DeleteWarningMsgDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -27,7 +27,7 @@ namespace CleanMachineHMI.FrmUserControl
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"SELECT * FROM CM_WORKING_PALLET_DTL WHERE WORKING_DTL_STATUS = 0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)

View File

@@ -91,7 +91,7 @@ namespace CleanMachineHMI.FrmUserControl
{
KryptonLabel label1 = this.Controls.Find("klb_X" + Convert.ToString(Convert.ToInt32(item.PlcItemPriAddress), 8).PadLeft(2, '0'), true)[0] as KryptonLabel;
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
}
}));
}
@@ -108,7 +108,7 @@ namespace CleanMachineHMI.FrmUserControl
{
KryptonLabel label1 = this.Controls.Find("klb_Y" + Convert.ToString(Convert.ToInt32(item.PlcItemPriAddress), 8).PadLeft(2, '0'), true)[0] as KryptonLabel;
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
}
}));
}

View File

@@ -114,7 +114,7 @@ namespace CleanMachineHMI.FrmUserControl
private void frmMainDetail_Load(object sender, EventArgs e)
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
try
{
InitControlEvent();
@@ -291,7 +291,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("主业务界面加载发生异常", "LoadMainDetailFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("主业务界面加载发生异常", "LoadMainDetailFrmExp") + $":【{ex.Message}】!");
LogHelper.WriteLog($"1111【{ex.Message}】", LogTypeEum.Err);
}
}
@@ -1586,19 +1586,19 @@ namespace CleanMachineHMI.FrmUserControl
if (string.IsNullOrEmpty(kcmb_SheetType.Text.Trim()))
{
//KryptonMessageBox.Show("请输入板材类型信息!!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材类型信息!", "EnterSheetTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入板材类型信息!", "EnterSheetTypeInfo"));
return;
}
if (string.IsNullOrEmpty(ktb_IR.Text.Trim()))
{
//KryptonMessageBox.Show("请输入IR收货编号信息!!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入IR收货编号信息!", "EnterIRMsgInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入IR收货编号信息!", "EnterIRMsgInfo"));
return;
}
if (!kdtp_RecordDate.Checked)
{
//KryptonMessageBox.Show("请选择录入时间!!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择录入时间!", "EnterInputTimeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择录入时间!", "EnterInputTimeInfo"));
return;
}
//string sqlWorkPallet = $@"SELECT * FROM CM_WORKING_PALLET WHERE WORKING_STATUS = 0";
@@ -1875,7 +1875,7 @@ namespace CleanMachineHMI.FrmUserControl
catch (Exception ex)
{
//KryptonMessageBox.Show("保存IR数据发生异常!" + ex.Message);
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("保存作业板材和IR数据发生异常", "SaveSheetIRDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("保存作业板材和IR数据发生异常", "SaveSheetIRDataExp") + $":【{ex.Message}】!");
}
}
@@ -2322,7 +2322,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (ktb_IR.Enabled)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("当前没有作业中的IR信息!", "CurrWorkingIsNoIrMsg"));
KryptonMessageBox.Show(this.GetInfoText("当前没有作业中的IR信息!", "CurrWorkingIsNoIrMsg"));
}
else
{

View File

@@ -31,7 +31,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
LoadManualFrmData = new dlgLoadManualFrmData(GetManualPlcItemVlaue);
GetManualPlcItemVlaue();
GlobalHelper.OnSyncFinishPalletData += SyncFinishPalletData;

View File

@@ -118,7 +118,7 @@ namespace CleanMachineHMI.FrmUserControl
private void frmMechineCheck_Load(object sender, EventArgs e)
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
Thread th1 = new Thread(MainDtlRunTh);
th1.IsBackground = true;
th1.Start();
@@ -246,7 +246,7 @@ namespace CleanMachineHMI.FrmUserControl
PlcOperationHelper.Instance.WritePlcItem("SelfCheckPassFlag", "False", PlcItemTypeDesc.M);
//测试未通过,请检查并重新测试
GlobalHelper.CanOperate = false;
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("测试未通过,请检查设备并重新测试!!", "NoPassShowMsg"));
KryptonMessageBox.Show(this.GetInfoText("测试未通过,请检查设备并重新测试!!", "NoPassShowMsg"));
}
catch (Exception ex)
{

View File

@@ -83,7 +83,7 @@ namespace CleanMachineHMI.FrmUserControl
kdtp_CreateEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
kdtp_CreateStartTime.Checked = false;
kdtp_CreateEndTime.Checked = false;
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
RefreshFrmHost = new dlgRefreshFrmHost(Init);
Init();
foreach (Control item in tableLayoutPanel2.Controls)
@@ -106,7 +106,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载系统参数界面发生异常", "LoadSysParamaterExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载系统参数界面发生异常", "LoadSysParamaterExp") + $":【{ex.Message}】!");
}
}
@@ -119,7 +119,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询系统参数数据发生异常", "QuerySysParamaterData") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询系统参数数据发生异常", "QuerySysParamaterData") + $":【{ex.Message}】!");
}
}
@@ -143,7 +143,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的参数信息数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的参数信息数据行!", "SelectWantToEditRow"));
}
}

View File

@@ -38,7 +38,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载报警数据界面发生异常", "LoadFrmPlcAlarmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载报警数据界面发生异常", "LoadFrmPlcAlarmExp") + $":【{ex.Message}】!");
}
}
@@ -65,7 +65,7 @@ namespace CleanMachineHMI.FrmUserControl
private void frmPlcAlarmLog_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kcmb_plcAlarmStatus.Items.Clear();
if (GlobalHelper.LanguageCode == "English")
{

View File

@@ -50,7 +50,7 @@ namespace CleanMachineHMI.FrmUserControl
private void frmPlcItemConfig_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_plcItemType.Items.Clear();
@@ -256,7 +256,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载PLC变量数据界面发生异常", "LoadFrmPlcItemExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载PLC变量数据界面发生异常", "LoadFrmPlcItemExp") + $":【{ex.Message}】!");
}
}
private void kbt_Query_Click(object sender, EventArgs e)
@@ -290,7 +290,7 @@ namespace CleanMachineHMI.FrmUserControl
else
{
//KryptonMessageBox.Show("请选择要编辑的PLC变量数据行!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要编辑的PLC变量数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要编辑的PLC变量数据行!", "SelectWantToEditRow"));
}
}
@@ -300,7 +300,7 @@ namespace CleanMachineHMI.FrmUserControl
{
if (kryptonDataGridView1.SelectedRows.Count > 0)
{
DialogResult dr = KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("确定要删除所选的PLC变量信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
DialogResult dr = KryptonMessageBox.Show(this.GetInfoText("确定要删除所选的PLC变量信息吗?", "DeleteInfo"), "Prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
string PlcItemId = kryptonDataGridView1.SelectedRows[0].Cells[0].Value.ToString();
@@ -309,25 +309,25 @@ namespace CleanMachineHMI.FrmUserControl
if (row > 0)
{
//KryptonMessageBox.Show("删除PLC变量数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除PLC变量数据成功!", "DeleteSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除PLC变量数据成功!", "DeleteSuccessInfo"));
RefreshFrmHost();
}
else
{
//KryptonMessageBox.Show("删除PLC变量数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除PLC变量数据失败!", "DeleteFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("删除PLC变量数据失败!", "DeleteFailInfo"));
}
}
}
else
{
//KryptonMessageBox.Show("请选择要删除的PLC变量数据行!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择要删除的PLC变量数据行!", "SelectWantToDeleteRow"));
KryptonMessageBox.Show(this.GetInfoText("请选择要删除的PLC变量数据行!", "SelectWantToDeleteRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("删除PLC变量数据发生异常", "DeletePlcItemDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("删除PLC变量数据发生异常", "DeletePlcItemDataExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -132,7 +132,7 @@ namespace CleanMachineHMI.FrmUserControl
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sqlQuerySheetType = $@"SELECT SHEET_TYPE_CODE,SHEET_TYPE_NAME FROM BAS_SHEET_TYPE WHERE USED_FLAG = 1 and DEL_FLAG = 0 ORDER BY SHEET_TYPE_ID";
DataTable dtQuerySheetType = LeadDbHelperSQLite.Query(sqlQuerySheetType).Tables[0];
if (dtQuerySheetType != null && dtQuerySheetType.Rows.Count > 0)
@@ -180,7 +180,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载作业数据查询界面发生异常", "LoadQueryWorkingDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载作业数据查询界面发生异常", "LoadQueryWorkingDataExp") + $":【{ex.Message}】!");
}
}
#region 打印测试代码
@@ -334,7 +334,7 @@ namespace CleanMachineHMI.FrmUserControl
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("查询作业托盘数据发生异常", "QueryWorkingPalletDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("查询作业托盘数据发生异常", "QueryWorkingPalletDataExp") + $":【{ex.Message}】!");
}
}
@@ -409,12 +409,12 @@ namespace CleanMachineHMI.FrmUserControl
else
{
//KryptonMessageBox.Show("请勾选要打印的托盘数据行!!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请勾选要打印的托盘数据行!", "SelectWantToPrintRow"));
KryptonMessageBox.Show(this.GetInfoText("请勾选要打印的托盘数据行!", "SelectWantToPrintRow"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("打印作业托盘数据发生异常", "PrintWorkingPalletDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("打印作业托盘数据发生异常", "PrintWorkingPalletDataExp") + $":【{ex.Message}】!");
}
}
private void PrintWorkedIrMsg(string workingIrCodeMsg)
@@ -697,7 +697,7 @@ namespace CleanMachineHMI.FrmUserControl
else
{
//KryptonMessageBox.Show("请勾选要编辑的作业托盘数据行!!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请勾选要编辑的作业托盘数据行!", "SelectWantToEditRow"));
KryptonMessageBox.Show(this.GetInfoText("请勾选要编辑的作业托盘数据行!", "SelectWantToEditRow"));
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ namespace CleanMachineHMI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

View File

@@ -8,6 +8,7 @@ using Krypton.Toolkit;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
@@ -22,7 +23,7 @@ namespace CleanMachineHMI
/// <summary>
/// 主窗体_New
/// </summary>
public static frmMainNew MainFormNew{ get; set; }
public static frmMainNew MainFormNew { get; set; }
/// <summary>
/// 登陆窗体
@@ -46,6 +47,11 @@ namespace CleanMachineHMI
/// </summary>
public static string LanguageCode { get; set; } = AppConfigHelper.Get("LanguageCode");
/// <summary>
/// 语言字典
/// </summary>
public static Dictionary<string, string> ThemeLanguage = null;
/// <summary>
/// 用户信息
/// </summary>
@@ -176,5 +182,43 @@ namespace CleanMachineHMI
CanOperate = false;
}
/// <summary>
/// 加载主题
/// </summary>
public static void LoadTheme()
{
if (ThemeLanguage == null || ThemeLanguage.Count == 0)
{
var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0];
var filePath = appPath + $"Lang\\{GlobalHelper.LanguageCode}.json";
using (StreamReader sr = new StreamReader(filePath))
{
var str = sr.ReadToEnd();
var lstLanguage = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str);
//var tmpThemeLanguage = new List<ThemeLanguage>();
//lstLanguage.ForEach(item =>
//{
// var part = tmpThemeLanguage.FirstOrDefault(x => x.formCode == item.formCode && x.controlCode == item.controlCode);
// if (part == null)
// {
// tmpThemeLanguage.Add(item);
// }
// else
// {
// part.options.Add(item.controlName);
// }
//});
//var str1 = Newtonsoft.Json.JsonConvert.SerializeObject(tmpThemeLanguage);
//WriteFile(appPath + "\\Lang", filePath, str1);
var tmpThemeLanguage = new Dictionary<string, string>();
lstLanguage.ForEach(item =>
{
tmpThemeLanguage.Add(item.formCode + "|" + item.controlCode, item.controlName);
});
ThemeLanguage = tmpThemeLanguage;
}
}
}
}
}

View File

@@ -6,6 +6,7 @@ using NX_LogUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
@@ -19,6 +20,7 @@ namespace CleanMachineHMI.Utils
/// </summary>
public static class frmUtil
{
/// <summary>
/// 给一个字符串进行MD5加密
/// </summary>
@@ -116,22 +118,44 @@ namespace CleanMachineHMI.Utils
}
}
/// <summary>
/// object 选择返回值
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static string GetObjToString(this object obj)
private static void WriteFile(string strDir, string filePath, string txt)
{
if (obj == null)
FileStream fs = null;
StreamWriter sw = null;
try
{
return string.Empty;
if (!Directory.Exists(strDir))//如果日志文件存放的文件夹不存在,就新建一个文件夹。
{
Directory.CreateDirectory(strDir);
}
if (File.Exists(filePath))//日志文件存放路径存在,向日志文件追加记录。
{
fs = new FileStream(filePath, FileMode.Append);
}
else//日志文件存放路径不存在,创建日志文件。
{
fs = new FileStream(filePath, FileMode.Create);
}
sw = new StreamWriter(fs);
//开始写入
sw.Write(txt);
//清空缓冲区
sw.Flush();
//关闭流
sw.Close();
fs.Close();
}
if (obj.ToString() == "")
catch (Exception)
{
return string.Empty;
}
return obj.ToString();
finally
{
if (sw != null)
sw.Close();
if (fs != null)
fs.Close();
}
}
/// <summary>
@@ -139,46 +163,45 @@ namespace CleanMachineHMI.Utils
/// </summary>
/// <param name="form">窗体对象</param>
/// <param name="languageCode">语言编码</param>
public static void SetFormControlText(this Form form,string languageCode)
public static void SetFormControlText(this ContainerControl form)
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND FORM_CODE='{form.Name}' AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE !='DataSource'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
ErgodicControlsText(form, dt);
foreach (Control item in form.Controls)
{
var key = form.Name + "|" + item.Name;
if (!GlobalHelper.ThemeLanguage.ContainsKey(key))
{
continue;
}
if (item is KryptonGroupBox)
{
//Console.Write("模块名称"+ ((KryptonGroupBox)tmpC[0]).Values.Heading);
//Console.Write("\r\n");
((KryptonGroupBox)item).Values.Heading = GlobalHelper.ThemeLanguage[key];
continue;
}
//Console.Write("控件名称:"+ tmpC[0].Name+ ":控件中文名:" + tmpC[0].Text);
//Console.Write("\r\n");
}
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
}
}
public static void SetFormControlText(this UserControl form, string languageCode)
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND FORM_CODE='{form.Name}' AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE !='DataSource'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
ErgodicControlsText(form, dt);
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
}
}
/// <summary>
/// 设定数据视图列文本
/// </summary>
/// <param name="dataGrid"></param>
/// <param name="formName"></param>
/// <param name="languageCode"></param>
public static void SetDataViewColumnText(this DataGridView dataGrid ,string formName, string languageCode)
public static void SetDataViewColumnText(this DataGridView dataGrid, string formName, string languageCode)
{
try
@@ -202,12 +225,10 @@ namespace CleanMachineHMI.Utils
/// <param name="dataGrid"></param>
/// <param name="formName"></param>
/// <param name="languageCode"></param>
public static DataTable GetInfoLanguageText(this Form form, string languageCode, string controlType = "Info")
public static DataTable GetInfoLanguageText(this ContainerControl form, string languageCode, string controlType = "Info")
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND (FORM_CODE='{form.Name}' OR IFNULL(FORM_CODE,'')='') AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE = '{controlType}' ORDER BY LANGUAGE_CONTROL_ID";
@@ -219,55 +240,7 @@ namespace CleanMachineHMI.Utils
return null;
}
}
public static DataTable GetInfoLanguageText(this UserControl form, string languageCode, string controlType = "Info")
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND (FORM_CODE='{form.Name}' OR IFNULL(FORM_CODE,'')='') AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE = '{controlType}' ORDER BY LANGUAGE_CONTROL_ID";
return LeadDbHelperSQLite.Query(sql).Tables[0];
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
return null;
}
}
public static DataTable GetInfoLanguageText_1(this Form form, string languageCode, string controlType = "Info")
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND (FORM_CODE='{form.Name}' OR IFNULL(FORM_CODE,'')='') AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE like '{controlType}' ORDER BY LANGUAGE_CONTROL_ID";
return LeadDbHelperSQLite.Query(sql).Tables[0];
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
return null;
}
}
public static DataTable GetInfoLanguageText_1(this UserControl form, string languageCode, string controlType = "Info")
{
try
{
var sql = $@"SELECT * FROM SYS_LANGUAGE_CONTROL
WHERE USED_FLAG = 1 AND DEL_FLAG = 0
AND (FORM_CODE='{form.Name}' OR IFNULL(FORM_CODE,'')='') AND LANGUAGE_CODE='{languageCode}' AND CONTROL_TYPE like '{controlType}' ORDER BY LANGUAGE_CONTROL_ID";
return LeadDbHelperSQLite.Query(sql).Tables[0];
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
return null;
}
}
/// <summary>
/// 获取等于查询行
/// </summary>
@@ -275,7 +248,7 @@ namespace CleanMachineHMI.Utils
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
public static DataRow[] GetEqualSelectRow(this DataTable dataTable,string key,string value)
public static DataRow[] GetEqualSelectRow(this DataTable dataTable, string key, string value)
{
try
@@ -322,20 +295,18 @@ namespace CleanMachineHMI.Utils
/// <param name="dataTable"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetInfoText(this DataTable dataTable,string defaultValue,string key)
public static string GetInfoText(this Control form, string defaultValue, string infoCode, string controlType = "Info")
{
try
{
var likeSql = $"`CONTROL_CODE` = '{key}' and `CONTROL_TYPE` = 'Info'";
DataRow[] dataRow = dataTable.Select(likeSql);
if (dataRow == null || !dataRow.Any())
var key = form.Name + "|" + infoCode;
if (!GlobalHelper.ThemeLanguage.ContainsKey(key))
{
return defaultValue;
}
else
{
return dataRow[0]["CONTROL_NAME"].ToString();
return GlobalHelper.ThemeLanguage[key];
}
}
catch (Exception ex)
@@ -344,28 +315,7 @@ namespace CleanMachineHMI.Utils
return null;
}
}
public static string GetInfoText_1(this DataTable dataTable, string defaultValue, string key, string controlType)
{
try
{
var likeSql = $"`CONTROL_CODE` = '{key}' and `CONTROL_TYPE` = '{controlType}'";
DataRow[] dataRow = dataTable.Select(likeSql);
if (dataRow == null || !dataRow.Any())
{
return defaultValue;
}
else
{
return dataRow[0]["CONTROL_NAME"].ToString();
}
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
return null;
}
}
public static DataRow[] GetComBoboxItemArr(this DataTable dataTable, string key, string controlType)
{
@@ -387,12 +337,13 @@ namespace CleanMachineHMI.Utils
/// </summary>
/// <param name="container"></param>
/// <param name="dataTable"></param>
private static void ErgodicControlsText(Control container,DataTable dataTable)
private static void ErgodicControlsText(Control container, DataTable dataTable)
{
for (int i = 0; i < dataTable.Rows.Count; i++)
{
Control[] tmpC = container.Controls.Find(dataTable.Rows[i]["CONTROL_CODE"].ToString(), true);
if (tmpC.Length>0)
if (tmpC.Length > 0)
{
if (tmpC[0] is KryptonGroupBox)
{
@@ -418,7 +369,7 @@ namespace CleanMachineHMI.Utils
/// <param name="dataTable"></param>
private static void ErgodicColumnsText(DataGridView dataGrid, DataTable dataTable)
{
for(int k = 0; k < dataGrid.Columns.Count; k++)
for (int k = 0; k < dataGrid.Columns.Count; k++)
{
for (int i = 0; i < dataTable.Rows.Count; i++)
{
@@ -431,4 +382,22 @@ namespace CleanMachineHMI.Utils
}
}
}
public class ThemeLanguage
{
/// <summary>
/// 窗体编码
/// </summary>
public string formCode { get; set; }
/// <summary>
/// 控件编码
/// </summary>
public string controlCode { get; set; }
/// <summary>
/// 控件名称
/// </summary>
public string controlName { get; set; }
public List<string> options { get; set; } = new List<string>();
}
}

View File

@@ -71,7 +71,7 @@ namespace CleanMachineHMI.forms
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
foreach (Control item in kryptonPanel1.Controls)
{
if (item.Tag != null && item.Tag.ToString() != "")
@@ -91,7 +91,7 @@ namespace CleanMachineHMI.forms
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载基础配置界面发生异常", "LoadFrmBaseExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载基础配置界面发生异常", "LoadFrmBaseExp") + $":【{ex.Message}】!");
}
}

View File

@@ -27,7 +27,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddCleanCode_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
}
private void txt_GotFocus(object sender, EventArgs e)
{
@@ -52,12 +52,12 @@ namespace CleanMachineHMI.frmChild
{
if (string.IsNullOrEmpty(txtCleanModeCode.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式编码!", "EnterCleanCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入清洗方式编码!", "EnterCleanCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtCleanModeName.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CLEAN_MODE WHERE CLEAN_MODE_CODE = '{txtCleanModeCode.Text}'";
@@ -106,18 +106,18 @@ namespace CleanMachineHMI.frmChild
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增清洗方式数据成功!", "AddSuccessInfo"));
frmCleanMode.RefreshFrmHost();
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增清洗方式数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增清洗方式数据发生异常", "AddCleanModeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增清洗方式数据发生异常", "AddCleanModeDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CONTAMINATION_TYPE_CODE,CONTAMINATION_TYPE_NAME from BAS_CONTAMINATION_TYPE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
cmbContaminationType.DisplayMember = "Text";
@@ -71,7 +71,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增污染明细界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
}
}
@@ -81,17 +81,17 @@ namespace CleanMachineHMI.frmChild
{
if (cmbContaminationType.SelectedIndex == 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationDTLCode.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationDTLName.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CONTAMINATION_DTL WHERE CONTAMINATION_TYPE_CODE = '{((ListItem)cmbContaminationType.SelectedItem).Value}' AND CONTAMINATION_DTL_CODE = '{txtContaminationDTLCode.Text}'";
@@ -142,18 +142,18 @@ namespace CleanMachineHMI.frmChild
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染明细数据成功!", "AddSuccessInfo"));
frmContaminationDTL.RefreshFrmHost();
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染明细数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据发生异常", "AddContaminationDtlDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增污染明细数据发生异常", "AddContaminationDtlDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CLEAN_MODE_CODE,CLEAN_MODE_NAME from BAS_CLEAN_MODE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
cmbCleanMode.DisplayMember = "Text";
@@ -71,7 +71,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增污染类型界面加载异常", "LoadAddFrmExp") + $":【{ex.Message}】!");
}
}
@@ -81,19 +81,19 @@ namespace CleanMachineHMI.frmChild
{
if (cmbCleanMode.SelectedIndex == 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationTypeCode.Text))
{
//KryptonMessageBox.Show("请输入污染类型编码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationTypeName.Text))
{
//KryptonMessageBox.Show("请输入污染类型名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_CONTAMINATION_TYPE WHERE CLEAN_MODE_CODE = '{((ListItem)cmbCleanMode.SelectedItem).Value}' AND CONTAMINATION_TYPE_CODE = '{txtContaminationTypeCode.Text}'";
@@ -144,18 +144,18 @@ namespace CleanMachineHMI.frmChild
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染类型数据成功!", "AddSuccessInfo"));
frmContaminationType.RefreshFrmHost();
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染类型数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染类型数据发生异常", "AddContaminationTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增污染类型数据发生异常", "AddContaminationTypeDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -51,7 +51,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddPlcItem_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_plcItemType.Items.Clear();
@@ -87,25 +87,25 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(ktb_plcItemCode.Text))
{
//KryptonMessageBox.Show("请输入PLC编码");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
return;
}
if (string.IsNullOrEmpty(ktb_plcItemName.Text))
{
//KryptonMessageBox.Show("请输入PLC名称");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
return;
}
if (string.IsNullOrEmpty(kcmb_plcItemType.Text))
{
//KryptonMessageBox.Show("请选择PLC类型");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
return;
}
if (string.IsNullOrEmpty(kcmb_plcItemDataType.Text))
{
//KryptonMessageBox.Show("请选择PLC数据类型");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
return;
}
int addPriIndex = Convert.ToInt32(knud_plcItemPriAddress.Value);
@@ -206,19 +206,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("添加PLC变量数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增PLC变量数据成功!", "AddSuccessInfo"));
frmPlcItemConfig.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("添加PLC变量数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增PLC变量数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增PLC变量数据发生异常", "AddPlcItemDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增PLC变量数据发生异常", "AddPlcItemDataExp") + $":【{ex.Message}】!");
}
}

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}】!");
}
}

View File

@@ -31,13 +31,13 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtSheetTypeCode.Text))
{
//KryptonMessageBox.Show("请输入板材编码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材编码!", "EnterSheetTypeCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入板材编码!", "EnterSheetTypeCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtSheetTypeName.Text))
{
//KryptonMessageBox.Show("请输入板材名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_SHEET_TYPE WHERE SHEET_TYPE_CODE = '{txtSheetTypeCode.Text}'";
@@ -87,19 +87,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("新增板材数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增板材数据成功!", "AddSuccessInfo"));
frmSheetType.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("新增板材数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增板材数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增板材类型数据发生异常", "AddSheetTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增板材类型数据发生异常", "AddSheetTypeDataExp") + $":【{ex.Message}】!");
}
}
@@ -127,7 +127,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddSheetType_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kryptonPanel1.Focus();
}

View File

@@ -52,7 +52,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddUser_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
cmbGender.Items.Clear();
@@ -93,42 +93,42 @@ 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 (kcmb_Role.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择所属角色!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择所属角色!", "SelectUserRoleInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择所属角色!", "SelectUserRoleInfo"));
return;
}
if (txtPS1.Text != txtPS.Text)
{
//KryptonMessageBox.Show("两次输入的密码不同,请重新输入!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
KryptonMessageBox.Show(this.GetInfoText("两次输入的密码不同,请重新输入!", "ConfirmUserPasswordErrInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM SYS_USER WHERE USER_CODE = '{txtAccount.Text}'";
@@ -187,19 +187,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("新增用户数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增用户数据成功!", "AddSuccessInfo"));
frmUser.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("新增用户数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增用户数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增用户数据发生异常", "AddUserDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增用户数据发生异常", "AddUserDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -51,7 +51,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddWaringMsg_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_WarningType.Items.Clear();
@@ -71,19 +71,19 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtWarningCode.Text))
{
//KryptonMessageBox.Show("请输入报警条码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtWarningName.Text))
{
//KryptonMessageBox.Show("请输入报警名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
return;
}
if (kcmb_WarningType.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择报警类型!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_WARNING WHERE WARNING_TYPE = '{kcmb_WarningType.SelectedIndex}' AND PLC_ITEM_CODE = '{ktb_PlcCode.Text}' AND WARNING_CODE = '{txtWarningCode.Text}'";
@@ -139,20 +139,20 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("新增基础报警数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据成功!", "AddSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增基础报警数据成功!", "AddSuccessInfo"));
// frmWarning.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("新增基础报警数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据失败!", "AddFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增基础报警数据失败!", "AddFailInfo"));
}
}
catch (Exception ex)
{
//KryptonMessageBox.Show(ex.Message);
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增基础报警数据发生异常", "AddWarningDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("新增基础报警数据发生异常", "AddWarningDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -27,7 +27,7 @@ namespace CleanMachineHMI.frmChild
private void frmAddCleanCode_Load(object sender, EventArgs e)
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
}
private void txt_GotFocus(object sender, EventArgs e)
{
@@ -59,12 +59,12 @@ namespace CleanMachineHMI.frmChild
txtCleanModeCode.Enabled = false;
txtCleanModeName.Text = dt.Rows[0]["CLEAN_MODE_NAME"].ToString();
}
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
kryptonPanel1.Focus();
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改清洁方式数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("修改清洁方式数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -75,7 +75,7 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtCleanModeName.Text))
{
//KryptonMessageBox.Show("请输入板材名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入清洗方式名称!", "EnterCleanNameInfo"));
return;
}
string sql = $@"update BAS_CLEAN_MODE set CLEAN_MODE_NAME = '{txtCleanModeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where CLEAN_MODE_ID = '{CleanModeId}'";
@@ -83,7 +83,7 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改清洗方式数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑清洗方式数据成功!", "EditSuccessInfo"));
frmCleanMode.RefreshFrmHost();
this.Close();
@@ -91,12 +91,12 @@ namespace CleanMachineHMI.frmChild
else
{
//KryptonMessageBox.Show("修改清洗方式数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑清洗方式数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑清洗方式数据发生异常", "EditCleanModeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑清洗方式数据发生异常", "EditCleanModeDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CONTAMINATION_TYPE_CODE,CONTAMINATION_TYPE_NAME from BAS_CONTAMINATION_TYPE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -80,7 +80,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染明细数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑污染明细数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -91,19 +91,19 @@ namespace CleanMachineHMI.frmChild
if (cmbContaminationType.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择污染类型!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择污染类型!", "SelectContaminationTypeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationDTLCode.Text))
{
//KryptonMessageBox.Show("请输入污染明细编码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染明细编码!", "EnterContaminationDtlCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationDTLName.Text))
{
//KryptonMessageBox.Show("请输入污染明细名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染明细名称!", "EnterContaminationDtlNameInfo"));
return;
}
string sql = $@"update BAS_CONTAMINATION_DTL set CONTAMINATION_DTL_NAME = '{txtContaminationDTLName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where CONTAMINATION_DTL_ID = '{ContaminationDtlId}'";
@@ -111,19 +111,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改污染明细数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染明细数据成功!", "EditSuccessInfo"));
frmContaminationDTL.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改污染明细数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("新增污染明细数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("新增污染明细数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染明细数据发生异常", "EditContaminationDtlDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑污染明细数据发生异常", "EditContaminationDtlDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select CLEAN_MODE_CODE,CLEAN_MODE_NAME from BAS_CLEAN_MODE where DEL_FLAG=0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -81,7 +81,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑污染类型界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -91,35 +91,35 @@ namespace CleanMachineHMI.frmChild
{
if (cmbCleanMode.SelectedIndex == 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择清洗方式!", "SelectCleanModeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationTypeCode.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染类型编码!", "EnterContaminationTypeCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtContaminationTypeName.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入污染类型名称!", "EnterContaminationTypeNameInfo"));
return;
}
string sql = $@"update BAS_CONTAMINATION_TYPE set CONTAMINATION_TYPE_NAME = '{txtContaminationTypeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where CONTAMINATION_TYPE_ID = '{ContaminationId}'";
int row = LeadDbHelperSQLite.ExecuteSql(sql);
if (row > 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑污染类型数据成功!", "EditSuccessInfo"));
frmContaminationType.RefreshFrmHost();
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑污染类型数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑污染类型数据发生异常", "EditContaminationTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑污染类型数据发生异常", "EditContaminationTypeDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -43,7 +43,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"SELECT * FROM SYS_PARAMETER WHERE PARAMETER_ID = '{ParamaterId}'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -56,7 +56,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑参数数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -67,7 +67,7 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtValue.Text))
{
//KryptonMessageBox.Show("请输入参数值!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入参数值!", "EnterparamaterVlaueInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入参数值!", "EnterparamaterVlaueInfo"));
return;
}
string sql = $@"update SYS_PARAMETER set PARAMETER_VALUE = '{txtValue.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where PARAMETER_ID = '{ParamaterId}'";
@@ -75,19 +75,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改参数信息数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑参数数据成功!", "EditSuccessInfo"));
frmParamater.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改参数信息数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑参数数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑参数数据发生异常", "EditParamaterDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑参数数据发生异常", "EditParamaterDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -53,7 +53,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_plcItemType.Items.Clear();
@@ -86,7 +86,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑PLC变量数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
/// <summary>
@@ -106,25 +106,25 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(ktb_plcItemCode.Text))
{
//KryptonMessageBox.Show("请输入PLC编码");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入PLC变量编码!", "EnterPlcItemCodeInfo"));
return;
}
if (string.IsNullOrEmpty(ktb_plcItemName.Text))
{
//KryptonMessageBox.Show("请输入PLC名称");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入PLC变量名称!", "EnterPlcItemNameInfo"));
return;
}
if (string.IsNullOrEmpty(kcmb_plcItemType.Text))
{
//KryptonMessageBox.Show("请选择PLC类型");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择PLC变量类型!", "SelectPlcItemTypeInfo"));
return;
}
if (string.IsNullOrEmpty(kcmb_plcItemDataType.Text))
{
//KryptonMessageBox.Show("请选择PLC数据类型");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择PLC变量数据类型!", "SelectPlcItemDataTypeInfo"));
return;
}
int addPriIndex = Convert.ToInt32(knud_plcItemPriAddress.Value);
@@ -182,19 +182,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("编辑PLC变量数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑PLC变量数据成功!", "EditSuccessInfo"));
frmPlcItemConfig.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("编辑PLC变量数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑PLC变量数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑PLC变量数据发生异常", "EditPlcItemDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑PLC变量数据发生异常", "EditPlcItemDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -47,7 +47,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_roleGrade.Items.Clear();
@@ -78,7 +78,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑角色数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -89,14 +89,14 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtRoleName.Text))
{
//KryptonMessageBox.Show("请输入角色名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入角色名称!", "EnterRoleNameInfo"));
return;
}
int roleGrade = 0;
if (kcmb_roleGrade.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择角色级别!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择角色级别!", "SelectRoleGradeInfo"));
return;
}
else if (kcmb_roleGrade.SelectedIndex == 1)
@@ -119,19 +119,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改角色数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改角色数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改角色数据成功!", "EditSuccessInfo"));
frmRole.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改角色数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改角色数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改角色数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色数据发生异常", "EditRoleDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑角色数据发生异常", "EditRoleDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -46,7 +46,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"SELECT * FROM BAS_SHEET_TYPE WHERE SHEET_TYPE_ID = '{SheetTypeId}'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -59,7 +59,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -70,7 +70,7 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtSheetTypeName.Text))
{
//KryptonMessageBox.Show("请输入板材名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
return;
}
string sql = $@"update BAS_SHEET_TYPE set SHEET_TYPE_NAME = '{txtSheetTypeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where SHEET_TYPE_ID = '{SheetTypeId}'";
@@ -78,19 +78,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改板材数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据成功!", "EditSuccessInfo"));
frmSheetType.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改板材数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑板材类型数据发生异常", "EditSheetTypeDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑板材类型数据发生异常", "EditSheetTypeDataExp") + $":【{ex.Message}】!");
}
}

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}】!");
}
}

View File

@@ -54,7 +54,7 @@ namespace CleanMachineHMI.frmChild
try
{
InitControlEvent();
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
if (GlobalHelper.LanguageCode == "English")
{
kcmb_WarningType.Items.Clear();
@@ -79,7 +79,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑基础报警数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑基础报警数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -90,19 +90,19 @@ namespace CleanMachineHMI.frmChild
if (string.IsNullOrEmpty(txtWarningCode.Text))
{
//KryptonMessageBox.Show("请输入报警条码!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入报警条码!", "EnterWarningCodeInfo"));
return;
}
if (string.IsNullOrEmpty(txtWarningName.Text))
{
//KryptonMessageBox.Show("请输入报警名称!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
KryptonMessageBox.Show(this.GetInfoText("请输入报警名称!", "EnterWarningNameInfo"));
return;
}
if (kcmb_WarningType.SelectedIndex == 0)
{
//KryptonMessageBox.Show("请选择报警类型!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择报警类型!", "SelectWarningTypeInfo"));
return;
}
string sqlIsExistCode = $@"SELECT 1 FROM BAS_WARNING WHERE WARNING_TYPE = '{kcmb_WarningType.SelectedIndex}' AND PLC_ITEM_CODE = '{ktb_PlcCode.Text}' AND WARNING_CODE = '{txtWarningCode.Text}'";
@@ -118,19 +118,19 @@ namespace CleanMachineHMI.frmChild
if (row > 0)
{
//KryptonMessageBox.Show("修改基础报警数据成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改基础报警数据成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改基础报警数据成功!", "EditSuccessInfo"));
//frmWarning.RefreshFrmHost();
this.Close();
}
else
{
//KryptonMessageBox.Show("修改基础报警数据失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("修改基础报警数据失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("修改基础报警数据失败!", "EditFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑基础报警数据发生异常", "EditWarningDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑基础报警数据发生异常", "EditWarningDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -28,7 +28,7 @@ namespace CleanMachineHMI.frmChild
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"select * from VW_WORKING_PALLET_MSG where WORKING_PALLET_CODE = '{PalletCode}'";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
@@ -53,7 +53,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑作业托盘数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑作业托盘数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -88,7 +88,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑作业托盘数据异常", "EditWorkingPalletDataExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑作业托盘数据异常", "EditWorkingPalletDataExp") + $":【{ex.Message}】!");
}
}

View File

@@ -27,7 +27,7 @@ namespace CleanMachineHMI.frmChild
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
string sql = $@"SELECT * FROM SYS_MENU";
allMenuData = LeadDbHelperSQLite.Query(sql).Tables[0];
if (allMenuData != null && allMenuData.Rows.Count > 0)
@@ -77,7 +77,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("角色菜单权限配置界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("角色菜单权限配置界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
}
}
@@ -208,24 +208,24 @@ namespace CleanMachineHMI.frmChild
if (rowSum > 0)
{
//KryptonMessageBox.Show("该角色菜单授权成功!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("该角色的菜单权限授权成功!", "EditSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("该角色的菜单权限授权成功!", "EditSuccessInfo"));
this.Close();
}
else
{
//KryptonMessageBox.Show("该角色菜单授权失败!");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("该角色的菜单权限授权失败!", "EditFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("该角色的菜单权限授权失败!", "EditFailInfo"));
}
}
else
{
//KryptonMessageBox.Show("未选择任何菜单项,无法配置权限。");
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("未选择任何菜单项,无法配置权限!", "EmptyMenuDataInfo"));
KryptonMessageBox.Show(this.GetInfoText("未选择任何菜单项,无法配置权限!", "EmptyMenuDataInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("编辑角色的菜单权限授权异常", "EditRoleMenuPermissionExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("编辑角色的菜单权限授权异常", "EditRoleMenuPermissionExp") + $":【{ex.Message}】!");
}
}
}

View File

@@ -26,7 +26,7 @@ namespace CleanMachineHMI.frmChild
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
int directNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("DischargeDirectionSelection", PlcItemTypeDesc.D));
if (GlobalHelper.LanguageCode == "English")
{
@@ -70,7 +70,7 @@ namespace CleanMachineHMI.frmChild
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("加载出料运行方向切换界面发生异常", "LoadSwitchRunDirectionExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("加载出料运行方向切换界面发生异常", "LoadSwitchRunDirectionExp") + $":【{ex.Message}】!");
}
}
@@ -80,7 +80,7 @@ namespace CleanMachineHMI.frmChild
{
if (kcmb_SwitchRunDirection.SelectedIndex == 0)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请选择切换方向!", "SelectSwitchDirectionInfo"));
KryptonMessageBox.Show(this.GetInfoText("请选择切换方向!", "SelectSwitchDirectionInfo"));
return;
}
if (!PlcOperationHelper.Instance.isConn)
@@ -90,17 +90,17 @@ namespace CleanMachineHMI.frmChild
}
if (PlcOperationHelper.Instance.WritePlcItem("DischargeDirectionSelection", (kcmb_SwitchRunDirection.SelectedIndex - 1).ToString(), PlcItemTypeDesc.D))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向成功!", "SwitchDirectionSuccessInfo"));
KryptonMessageBox.Show(this.GetInfoText("切换出料运行方向成功!", "SwitchDirectionSuccessInfo"));
this.Close();
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向失败!", "SwitchDirectionFailInfo"));
KryptonMessageBox.Show(this.GetInfoText("切换出料运行方向失败!", "SwitchDirectionFailInfo"));
}
}
catch (Exception ex)
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("切换出料运行方向的函数发生异常", "SwitchRunDirectionExp") + $":【{ex.Message}】!");
KryptonMessageBox.Show(this.GetInfoText("切换出料运行方向的函数发生异常", "SwitchRunDirectionExp") + $":【{ex.Message}】!");
}
}

View File

@@ -212,7 +212,7 @@ namespace CleanMachineHMI
KryptonLabel label1 = new KryptonLabel();
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
label1.Location = new Point(44, 6);
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
panel.Controls.Add(label);
panel.Controls.Add(button);
@@ -247,7 +247,7 @@ namespace CleanMachineHMI
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
label1.Location = new Point(44, 6);
//label1.Text = item.PlcItemName.Replace("(I/O监控)", "");
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
panel.Controls.Add(label);
panel.Controls.Add(button);
@@ -338,7 +338,7 @@ namespace CleanMachineHMI
KryptonLabel label1 = new KryptonLabel();
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
label1.Location = new Point(44, 6);
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
panel.Controls.Add(label);
panel.Controls.Add(button);
@@ -372,7 +372,7 @@ namespace CleanMachineHMI
KryptonLabel label1 = new KryptonLabel();
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
label1.Location = new Point(44, 6);
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
panel.Controls.Add(label);
panel.Controls.Add(button);

View File

@@ -179,7 +179,7 @@ namespace CleanMachineHMI
{
KryptonLabel label1 = this.Controls.Find("klb_X" + Convert.ToString(Convert.ToInt32(item.PlcItemPriAddress), 8).PadLeft(2, '0'), true)[0] as KryptonLabel;
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
}
}));
}
@@ -196,7 +196,7 @@ namespace CleanMachineHMI
{
KryptonLabel label1 = this.Controls.Find("klb_Y" + Convert.ToString(Convert.ToInt32(item.PlcItemPriAddress), 8).PadLeft(2, '0'), true)[0] as KryptonLabel;
label1.Text = _InfoLanguageTextList.GetInfoText_1(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
label1.Text = this.GetInfoText(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode, "Label");
}
}));
}

View File

@@ -30,7 +30,7 @@ namespace CleanMachineHMI
InitializeComponent();
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
}
private void Init()
@@ -48,12 +48,12 @@ namespace CleanMachineHMI
{
if (string.IsNullOrWhiteSpace(txtAccount.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入登陆账号!", "PleaseInputAccount"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("请输入登陆账号!", "PleaseInputAccount"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (string.IsNullOrWhiteSpace(txtPs.Text))
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入登陆密码!", "PleaseInputPassword"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("请输入登陆密码!", "PleaseInputPassword"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
@@ -64,17 +64,17 @@ namespace CleanMachineHMI
var data = dt.Rows[0];
if (data["USED_FLAG"].ToString() == "0")
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("用户已被停用!", "UserStop"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("用户已被停用!", "UserStop"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (data["DEL_FLAG"].ToString() == "1")
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("用户已被删除!", "UserDeleted"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("用户已被删除!", "UserDeleted"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (data["PASSWORD"].ToString().ToLower() != txtPs.Text.ToLower())
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("输入密码错误!", "PasswordFail"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("输入密码错误!", "PasswordFail"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
AppConfigHelper.Update("LastTimeUserCode",txtAccount.Text.Trim());
@@ -107,7 +107,7 @@ namespace CleanMachineHMI
}
else
{
KryptonMessageBox.Show(_InfoLanguageTextList.GetInfoText("请输入正确的登陆账号!", "PleaseCorrectAccount"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
KryptonMessageBox.Show(this.GetInfoText("请输入正确的登陆账号!", "PleaseCorrectAccount"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}

View File

@@ -26,7 +26,7 @@ namespace CleanMachineHMI
public frmMainNew()
{
InitializeComponent();
_InfoLanguageTextList = this.GetInfoLanguageText_1(GlobalHelper.LanguageCode, "Info%");
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode, "Info%");
}
#region 全局变量
@@ -145,7 +145,7 @@ namespace CleanMachineHMI
{
try
{
this.SetFormControlText(GlobalHelper.LanguageCode);
this.SetFormControlText();
SwitchFrmMenu = new dlgSwitchFrmMenu(AddFrmMenuPage);
string sql1 = $@" SELECT * FROM BAS_PLC_ITEM ";
@@ -186,7 +186,7 @@ namespace CleanMachineHMI
bool isInitStatus = PlcOperationHelper.Instance.PlcInit();
if (isInitStatus)
{
label3Professional.Text = _InfoLanguageTextList.GetInfoText_1("串口打开成功,PLC连接成功!", "label3Professional", "Info_Success");
label3Professional.Text = this.GetInfoText("串口打开成功,PLC连接成功!", "label3Professional", "Info_Success");
label3Professional.BackColor = Color.Lime;
isPlcConnStatus = true;
@@ -233,7 +233,7 @@ namespace CleanMachineHMI
else
{
//label3Professional.Text = "串口打开失败,PLC连接失败!";
label3Professional.Text = _InfoLanguageTextList.GetInfoText_1("串口打开失败,PLC连接失败!", "label3Professional", "Info_Failed");
label3Professional.Text = this.GetInfoText("串口打开失败,PLC连接失败!", "label3Professional", "Info_Failed");
label3Professional.BackColor = Color.Red;
isPlcConnStatus = false;