Exemple #1
0
        private void simpleButton_modify_Click(object sender, EventArgs e)
        {
            double temperature;
            double nuclear;

            if (this.textEdit_temperature.Text == "" || this.textEdit_temperature.Text.Trim() == "")
            {
                MessageBox.Show("请输入温度阀值!");
                this.textEdit_temperature.Focus();
                return;
            }
            else
            {
                try
                {
                    temperature = double.Parse(this.textEdit_temperature.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效温度值(整数)!");
                    this.textEdit_temperature.Focus();
                    return;
                }
            }
            if (this.textEdit_nuclear.Text == "" || this.textEdit_nuclear.Text.Trim() == "")
            {
                MessageBox.Show("请输入核素阀值!");
                this.textEdit_nuclear.Focus();
                return;
            }
            else
            {
                try
                {
                    nuclear = double.Parse(this.textEdit_nuclear.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效核素值(小数)!");
                    this.textEdit_nuclear.Focus();
                    return;
                }
            }

            int[] gateIds = new int[] { gateNo };

            try
            {
                UpdateThresholdService.getInstance().updateGateThreshold(temperature, nuclear, gateIds);
                MessageBox.Show("修改闸机阈值成功!");

                LogService.getInstance().log("更新闸机" + gateNo + "的阈值", ModuleConstant.GateThresholdUpdate_MODULE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }
Exemple #2
0
        private void simpleButton_modify_Click(object sender, EventArgs e)
        {
            double temperature_error, nuclear_error;

            if (this.textEdit_temperatureError.Text == "" || this.textEdit_temperatureError.Text.Trim() == "")
            {
                MessageBox.Show("请输入温度误差值(比如+0.1,-0.1)!");
                this.textEdit_temperatureError.Focus();
                return;
            }
            else
            {
                try
                {
                    temperature_error = double.Parse(this.textEdit_temperatureError.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效温度误差值(比如+0.1,-0.1)!");
                    this.textEdit_temperatureError.Focus();
                    return;
                }
            }
            if (this.textEdit_nuclearError.Text == "" || this.textEdit_nuclearError.Text.Trim() == "")
            {
                MessageBox.Show("请输入核素误差值(比如+0.1,-0.1)!");
                this.textEdit_nuclearError.Focus();
                return;
            }
            else
            {
                try
                {
                    nuclear_error = double.Parse(this.textEdit_nuclearError.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效核素误差值(比如+0.1,-0.1)!");
                    this.textEdit_nuclearError.Focus();
                    return;
                }
            }

            int[] gateIds = new int[] { gateNo };
            try
            {
                UpdateThresholdService.getInstance().updateGateThresholdError(temperature_error, nuclear_error, gateIds);
                MessageBox.Show("修改闸机误差值成功!");

                LogService.getInstance().log("更新闸机" + gateNo + "的阈值误差", ModuleConstant.GateThresholdUpdateError_MODULE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }
Exemple #3
0
        private void simpleButton_modify_Click(object sender, EventArgs e)
        {
            if (this.textEdit_biology.Text == "" || this.textEdit_biology.Text.Trim() == "")
            {
                MessageBox.Show("请输入生物战剂阀值!");
                this.textEdit_biology.Focus();
                return;
            }
            else
            {
                try
                {
                    biology = double.Parse(this.textEdit_biology.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效生物战剂值!");
                    this.textEdit_biology.Focus();
                    return;
                }
            }
            if (this.textEdit_chem.Text == "" || this.textEdit_chem.Text.Trim() == "")
            {
                MessageBox.Show("请输入化学战剂阀值!");
                this.textEdit_chem.Focus();
                return;
            }
            else
            {
                try
                {
                    chem = double.Parse(this.textEdit_chem.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入化学战剂值!");
                    this.textEdit_chem.Focus();
                    return;
                }
            }

            try
            {
                UpdateThresholdService.getInstance().updateHxswqhThreshold(biology, chem);
                MessageBox.Show("修改口岸阈值成功!");
                LogService.getInstance().log("更新口岸阈值", ModuleConstant.GateThresholdUpdate_MODULE);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }
        private void simpleButton_modify_Click(object sender, EventArgs e)
        {
            if (this.checkedListBoxControl_gate.CheckedItems.Count == 0)
            {
                MessageBox.Show("请选择通道!");
                return;
            }

            if (this.textEdit_temperature.Text == "" || this.textEdit_temperature.Text.Trim() == "")
            {
                MessageBox.Show("请输入温度阀值!");
                this.textEdit_temperature.Focus();
                return;
            }
            else
            {
                try
                {
                    temperature = double.Parse(this.textEdit_temperature.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效温度值(整数)!");
                    this.textEdit_temperature.Focus();
                    return;
                }
            }
            if (this.textEdit_nuclear.Text == "" || this.textEdit_nuclear.Text.Trim() == "")
            {
                MessageBox.Show("请输入核素阀值!");
                this.textEdit_nuclear.Focus();
                return;
            }
            else
            {
                try
                {
                    nuclear = double.Parse(this.textEdit_nuclear.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效核素值(小数)!");
                    this.textEdit_nuclear.Focus();
                    return;
                }
            }

            int[] gateIds = new int[this.checkedListBoxControl_gate.CheckedItems.Count];
            for (int i = 0; i < this.checkedListBoxControl_gate.CheckedItems.Count; i++)
            {
                object obj = this.checkedListBoxControl_gate.CheckedItems[i];
                gateIds[i] = (int)obj;
            }

            try
            {
                UpdateThresholdService.getInstance().updateGateThreshold(temperature, nuclear, gateIds);
                MessageBox.Show("修改闸机阈值成功!");

                LogService.getInstance().log(ModuleConstant.GateThresholdUpdate_MODULE, ModuleConstant.GateThresholdUpdate_MODULE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }
Exemple #5
0
        private void simpleButton_modify_Click(object sender, EventArgs e)
        {
            if (this.checkedListBoxControl_gate.CheckedItems.Count == 0)
            {
                MessageBox.Show("请选择通道!");
                return;
            }

            if (this.textEdit_temperatureError.Text == "" || this.textEdit_temperatureError.Text.Trim() == "")
            {
                MessageBox.Show("请输入温度误差值(比如+0.1,-0.1)!");
                this.textEdit_temperatureError.Focus();
                return;
            }
            else
            {
                try
                {
                    temperature_error = double.Parse(this.textEdit_temperatureError.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效温度误差值(比如+0.1,-0.1)!");
                    this.textEdit_temperatureError.Focus();
                    return;
                }
            }
            if (this.textEdit_nuclearError.Text == "" || this.textEdit_nuclearError.Text.Trim() == "")
            {
                MessageBox.Show("请输入核素误差值(比如+0.1,-0.1)!");
                this.textEdit_nuclearError.Focus();
                return;
            }
            else
            {
                try
                {
                    nuclear_error = double.Parse(this.textEdit_nuclearError.Text.Trim());
                }
                catch
                {
                    MessageBox.Show("请输入有效核素误差值(比如+0.1,-0.1)!");
                    this.textEdit_nuclearError.Focus();
                    return;
                }
            }

            int[] gateIds = new int[this.checkedListBoxControl_gate.CheckedItems.Count];
            for (int i = 0; i < this.checkedListBoxControl_gate.CheckedItems.Count; i++)
            {
                object obj = this.checkedListBoxControl_gate.CheckedItems[i];
                gateIds[i] = (int)obj;
            }

            try
            {
                UpdateThresholdService.getInstance().updateGateThresholdError(temperature_error, nuclear_error, gateIds);
                MessageBox.Show("修改闸机误差值成功!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误");
            }
        }