public SingleGateThresholdUpdateForm(int gateNo) { InitializeComponent(); label_gateNo.Text = gateNo.ToString(); this.gateNo = gateNo; GateThresholdValue gateThresholdValue = GateService.getInstance().getGateThreshold(gateNo); //为空就是默认值 if (gateThresholdValue == null) { textEdit_nuclear.Text = nuclear_default.ToString(); textEdit_temperature.Text = temperature_default.ToString(); } else { textEdit_nuclear.Text = gateThresholdValue.nuclear.ToString(); textEdit_temperature.Text = gateThresholdValue.temperature.ToString(); } }
/// <summary> /// 手动选中每个值后,查找对应的闸机的阈值并显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void checkedListBoxControl_gate_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e) { int index = e.Index; CheckState checkState = e.State; //如果是当前项被选中,则获取该闸机的阈值显示出来 if (selectedAllButton == false && checkState == CheckState.Checked) { GateThresholdValue gateThresholdValue = GateService.getInstance().getGateThreshold(index + 1); //为空就是默认值 if (gateThresholdValue == null) { textEdit_nuclear.Text = nuclear_default.ToString(); textEdit_temperature.Text = temperature_default.ToString(); } else { textEdit_nuclear.Text = gateThresholdValue.nuclear.ToString(); textEdit_temperature.Text = gateThresholdValue.temperature.ToString(); } } }