diff --git a/CleanMachineHMI/FrmUserControl/Base/frmRole.cs b/CleanMachineHMI/FrmUserControl/Base/frmRole.cs index d1a8c84..ac92a25 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmRole.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmRole.cs @@ -77,10 +77,11 @@ namespace CleanMachineHMI.FrmUserControl { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name); + if (items != null && items.Count > 0) { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) + foreach (string item in items) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/Base/frmUser.cs b/CleanMachineHMI/FrmUserControl/Base/frmUser.cs index f194ec5..22f5cd7 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmUser.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmUser.cs @@ -82,10 +82,11 @@ namespace CleanMachineHMI.FrmUserControl kdtp_CreateStartTime.Checked = false; kdtp_CreateEndTime.Checked = false; - + var items = this.GetComBoboxItemArr(kcmb_gender.Name); + if (items != null && items.Count > 0) { kcmb_gender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_gender.Name)) + foreach (string item in items) { kcmb_gender.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs b/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs index 116f465..7d88493 100644 --- a/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs +++ b/CleanMachineHMI/FrmUserControl/Base/frmWarning.cs @@ -89,10 +89,11 @@ namespace CleanMachineHMI.FrmUserControl kdtp_CreateStartTime.Checked = false; kdtp_CreateEndTime.Checked = false; - + var items = this.GetComBoboxItemArr(kcmb_WarningType.Name); + if (items != null && items.Count > 0) { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) + foreach (string item in items) { kcmb_WarningType.Items.Add(item); } diff --git a/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs b/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs index fdda4f7..153fd6f 100644 --- a/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs +++ b/CleanMachineHMI/FrmUserControl/frmPlcAlarmLog.cs @@ -64,16 +64,25 @@ namespace CleanMachineHMI.FrmUserControl { InitControlEvent(); 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(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcAlarmHandleResult.Name)) + items = 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_plcAlarmHandleResult.SelectedIndex = 0; diff --git a/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs b/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs index 9c1ce75..58f0e17 100644 --- a/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs +++ b/CleanMachineHMI/FrmUserControl/frmPlcItemConfig.cs @@ -50,19 +50,25 @@ namespace CleanMachineHMI.FrmUserControl { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name); + if (items != null && items.Count > 0) { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) + foreach (string item in items) { kcmb_plcItemType.Items.Add(item); } + } + items = this.GetComBoboxItemArr(kcmb_plcItemDateType.Name); + if (items != null && items.Count > 0) + { kcmb_plcItemDateType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDateType.Name)) + foreach (string item in items) { kcmb_plcItemDateType.Items.Add(item); } } + kcmb_plcItemType.SelectedIndex = 0; kcmb_plcItemDateType.SelectedIndex = 0; RefreshFrmHost = new dlgRefreshFrmHost(RefreshPlcData); diff --git a/CleanMachineHMI/frmChild/frmAddPlcItem.cs b/CleanMachineHMI/frmChild/frmAddPlcItem.cs index 462c41c..14e9ae7 100644 --- a/CleanMachineHMI/frmChild/frmAddPlcItem.cs +++ b/CleanMachineHMI/frmChild/frmAddPlcItem.cs @@ -48,15 +48,20 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name); + if (items != null && items.Count > 0) { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) + foreach (string item in items) { kcmb_plcItemType.Items.Add(item); } + } + items = this.GetComBoboxItemArr(kcmb_plcItemDataType.Name); + if (items != null && items.Count > 0) + { kcmb_plcItemDataType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) + foreach (string item in items) { kcmb_plcItemDataType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddRole.cs b/CleanMachineHMI/frmChild/frmAddRole.cs index e9019b6..ab9def4 100644 --- a/CleanMachineHMI/frmChild/frmAddRole.cs +++ b/CleanMachineHMI/frmChild/frmAddRole.cs @@ -43,10 +43,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name); + if (items != null && items.Count > 0) { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) + foreach (string item in items) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddUser.cs b/CleanMachineHMI/frmChild/frmAddUser.cs index 240ed3b..08750ff 100644 --- a/CleanMachineHMI/frmChild/frmAddUser.cs +++ b/CleanMachineHMI/frmChild/frmAddUser.cs @@ -50,10 +50,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(cmbGender.Name); + if (items != null && items.Count > 0) { cmbGender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) + foreach (string item in items) { cmbGender.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmAddWaringMsg.cs b/CleanMachineHMI/frmChild/frmAddWaringMsg.cs index 86cd48a..ddfd4a5 100644 --- a/CleanMachineHMI/frmChild/frmAddWaringMsg.cs +++ b/CleanMachineHMI/frmChild/frmAddWaringMsg.cs @@ -48,10 +48,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_WarningType.Name); + if (items != null && items.Count > 0) { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) + foreach (string item in items) { kcmb_WarningType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditPlcItem.cs b/CleanMachineHMI/frmChild/frmEditPlcItem.cs index 41bf566..cd1926e 100644 --- a/CleanMachineHMI/frmChild/frmEditPlcItem.cs +++ b/CleanMachineHMI/frmChild/frmEditPlcItem.cs @@ -50,15 +50,20 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_plcItemType.Name); + if (items != null && items.Count > 0) { kcmb_plcItemType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemType.Name)) + foreach (string item in items) { kcmb_plcItemType.Items.Add(item); } + } + items = this.GetComBoboxItemArr(kcmb_plcItemDataType.Name); + if (items != null && items.Count > 0) + { kcmb_plcItemDataType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_plcItemDataType.Name)) + foreach (string item in items) { kcmb_plcItemDataType.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditRole.cs b/CleanMachineHMI/frmChild/frmEditRole.cs index 1606b0c..2a502b6 100644 --- a/CleanMachineHMI/frmChild/frmEditRole.cs +++ b/CleanMachineHMI/frmChild/frmEditRole.cs @@ -44,10 +44,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_roleGrade.Name); + if (items != null && items.Count > 0) { kcmb_roleGrade.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_roleGrade.Name)) + foreach (string item in items) { kcmb_roleGrade.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditUser.cs b/CleanMachineHMI/frmChild/frmEditUser.cs index f725519..7aa9d47 100644 --- a/CleanMachineHMI/frmChild/frmEditUser.cs +++ b/CleanMachineHMI/frmChild/frmEditUser.cs @@ -53,10 +53,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(cmbGender.Name); + if (items != null && items.Count > 0) { cmbGender.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(cmbGender.Name)) + foreach (string item in items) { cmbGender.Items.Add(item); } diff --git a/CleanMachineHMI/frmChild/frmEditWaringMsg.cs b/CleanMachineHMI/frmChild/frmEditWaringMsg.cs index bc33ca4..d0d826c 100644 --- a/CleanMachineHMI/frmChild/frmEditWaringMsg.cs +++ b/CleanMachineHMI/frmChild/frmEditWaringMsg.cs @@ -51,10 +51,11 @@ namespace CleanMachineHMI.frmChild { InitControlEvent(); this.SetFormControlText(); - + var items = this.GetComBoboxItemArr(kcmb_WarningType.Name); + if (items != null && items.Count > 0) { kcmb_WarningType.Items.Clear(); - foreach (string item in this.GetComBoboxItemArr(kcmb_WarningType.Name)) + foreach (string item in items) { kcmb_WarningType.Items.Add(item); }