修复因语言字典缺失导致的界面报错

This commit is contained in:
kang
2022-05-17 11:19:58 +08:00
parent 2bc18cb082
commit 103708143e
13 changed files with 67 additions and 33 deletions

View File

@@ -77,10 +77,11 @@ namespace CleanMachineHMI.FrmUserControl
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name);
if (items != null && items.Count > 0)
{ {
kcmb_roleGrade.Items.Clear(); kcmb_roleGrade.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) foreach (string item in items)
{ {
kcmb_roleGrade.Items.Add(item); kcmb_roleGrade.Items.Add(item);
} }

View File

@@ -82,10 +82,11 @@ namespace CleanMachineHMI.FrmUserControl
kdtp_CreateStartTime.Checked = false; kdtp_CreateStartTime.Checked = false;
kdtp_CreateEndTime.Checked = false; kdtp_CreateEndTime.Checked = false;
var items = this.GetComBoboxItemArr(kcmb_gender.Name);
if (items != null && items.Count > 0)
{ {
kcmb_gender.Items.Clear(); kcmb_gender.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_gender.Name)) foreach (string item in items)
{ {
kcmb_gender.Items.Add(item); kcmb_gender.Items.Add(item);
} }

View File

@@ -89,10 +89,11 @@ namespace CleanMachineHMI.FrmUserControl
kdtp_CreateStartTime.Checked = false; kdtp_CreateStartTime.Checked = false;
kdtp_CreateEndTime.Checked = false; kdtp_CreateEndTime.Checked = false;
var items = this.GetComBoboxItemArr(kcmb_WarningType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_WarningType.Items.Clear(); kcmb_WarningType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) foreach (string item in items)
{ {
kcmb_WarningType.Items.Add(item); kcmb_WarningType.Items.Add(item);
} }

View File

@@ -64,16 +64,25 @@ namespace CleanMachineHMI.FrmUserControl
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
kcmb_plcAlarmStatus.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmStatus.Name)) var items = this.GetComBoboxItemArr(kcmb_plcAlarmStatus.Name);
if (items != null && items.Count > 0)
{ {
kcmb_plcAlarmStatus.Items.Add(item); kcmb_plcAlarmStatus.Items.Clear();
foreach (string item in items)
{
kcmb_plcAlarmStatus.Items.Add(item);
}
} }
kcmb_plcAlarmHandleResult.Items.Clear(); items = this.GetComBoboxItemArr(kcmb_plcAlarmHandleResult.Name);
foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmHandleResult.Name)) if (items != null && items.Count > 0)
{ {
kcmb_plcAlarmHandleResult.Items.Add(item); kcmb_plcAlarmHandleResult.Items.Clear();
foreach (string item in items)
{
kcmb_plcAlarmHandleResult.Items.Add(item);
}
} }
kcmb_plcAlarmStatus.SelectedIndex = 0; kcmb_plcAlarmStatus.SelectedIndex = 0;
kcmb_plcAlarmHandleResult.SelectedIndex = 0; kcmb_plcAlarmHandleResult.SelectedIndex = 0;

View File

@@ -50,19 +50,25 @@ namespace CleanMachineHMI.FrmUserControl
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_plcItemType.Items.Clear(); kcmb_plcItemType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) foreach (string item in items)
{ {
kcmb_plcItemType.Items.Add(item); kcmb_plcItemType.Items.Add(item);
} }
}
items = this.GetComBoboxItemArr(kcmb_plcItemDateType.Name);
if (items != null && items.Count > 0)
{
kcmb_plcItemDateType.Items.Clear(); kcmb_plcItemDateType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDateType.Name)) foreach (string item in items)
{ {
kcmb_plcItemDateType.Items.Add(item); kcmb_plcItemDateType.Items.Add(item);
} }
} }
kcmb_plcItemType.SelectedIndex = 0; kcmb_plcItemType.SelectedIndex = 0;
kcmb_plcItemDateType.SelectedIndex = 0; kcmb_plcItemDateType.SelectedIndex = 0;
RefreshFrmHost = new dlgRefreshFrmHost(RefreshPlcData); RefreshFrmHost = new dlgRefreshFrmHost(RefreshPlcData);

View File

@@ -48,15 +48,20 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_plcItemType.Items.Clear(); kcmb_plcItemType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) foreach (string item in items)
{ {
kcmb_plcItemType.Items.Add(item); kcmb_plcItemType.Items.Add(item);
} }
}
items = this.GetComBoboxItemArr(kcmb_plcItemDataType.Name);
if (items != null && items.Count > 0)
{
kcmb_plcItemDataType.Items.Clear(); kcmb_plcItemDataType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) foreach (string item in items)
{ {
kcmb_plcItemDataType.Items.Add(item); kcmb_plcItemDataType.Items.Add(item);
} }

View File

@@ -43,10 +43,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name);
if (items != null && items.Count > 0)
{ {
kcmb_roleGrade.Items.Clear(); kcmb_roleGrade.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) foreach (string item in items)
{ {
kcmb_roleGrade.Items.Add(item); kcmb_roleGrade.Items.Add(item);
} }

View File

@@ -50,10 +50,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(cmbGender.Name);
if (items != null && items.Count > 0)
{ {
cmbGender.Items.Clear(); cmbGender.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) foreach (string item in items)
{ {
cmbGender.Items.Add(item); cmbGender.Items.Add(item);
} }

View File

@@ -48,10 +48,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_WarningType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_WarningType.Items.Clear(); kcmb_WarningType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) foreach (string item in items)
{ {
kcmb_WarningType.Items.Add(item); kcmb_WarningType.Items.Add(item);
} }

View File

@@ -50,15 +50,20 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_plcItemType.Items.Clear(); kcmb_plcItemType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) foreach (string item in items)
{ {
kcmb_plcItemType.Items.Add(item); kcmb_plcItemType.Items.Add(item);
} }
}
items = this.GetComBoboxItemArr(kcmb_plcItemDataType.Name);
if (items != null && items.Count > 0)
{
kcmb_plcItemDataType.Items.Clear(); kcmb_plcItemDataType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) foreach (string item in items)
{ {
kcmb_plcItemDataType.Items.Add(item); kcmb_plcItemDataType.Items.Add(item);
} }

View File

@@ -44,10 +44,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name);
if (items != null && items.Count > 0)
{ {
kcmb_roleGrade.Items.Clear(); kcmb_roleGrade.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) foreach (string item in items)
{ {
kcmb_roleGrade.Items.Add(item); kcmb_roleGrade.Items.Add(item);
} }

View File

@@ -53,10 +53,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(cmbGender.Name);
if (items != null && items.Count > 0)
{ {
cmbGender.Items.Clear(); cmbGender.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) foreach (string item in items)
{ {
cmbGender.Items.Add(item); cmbGender.Items.Add(item);
} }

View File

@@ -51,10 +51,11 @@ namespace CleanMachineHMI.frmChild
{ {
InitControlEvent(); InitControlEvent();
this.SetFormControlText(); this.SetFormControlText();
var items = this.GetComBoboxItemArr(kcmb_WarningType.Name);
if (items != null && items.Count > 0)
{ {
kcmb_WarningType.Items.Clear(); kcmb_WarningType.Items.Clear();
foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) foreach (string item in items)
{ {
kcmb_WarningType.Items.Add(item); kcmb_WarningType.Items.Add(item);
} }