Exemple #1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     _parameter.portName  = String.Format("{0}", this.comName.SelectedItem);
     _parameter.soundType = String.Format("{0}", this.comWarn.SelectedItem);
     if (String.IsNullOrWhiteSpace(_parameter.portName))
     {
         MessageBox.Show("请选择Com串口!", "系统提示");
         return;
     }
     if (String.IsNullOrWhiteSpace(_parameter.soundType))
     {
         MessageBox.Show("请选择告警方式!", "系统提示");
         return;
     }
     try
     {
         ParaHelper.saveParameter(_filePath, _parameter);
         if (MessageBox.Show("操作成功", "系统提示") == DialogResult.OK)
         {
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "系统提示");
     }
 }
Exemple #2
0
        public void btnSubmit_Click(object sender, EventArgs e)
        {
            _parameter.standardValue = this.tbxStandard.Text;
            if (String.IsNullOrWhiteSpace(_parameter.standardValue))
            {
                MessageBox.Show("请输入校验值!", "系统提示");
                return;
            }

            try
            {
                ParaHelper.saveParameter(_filePath, _parameter);
                if (MessageBox.Show("操作成功", "系统提示") == DialogResult.OK)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "系统提示");
            }
        }