Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(textBox1.Text.Trim()) || string.IsNullOrEmpty(textBox2.Text.Trim()) ||
         string.IsNullOrEmpty(textBox3.Text.Trim()) || string.IsNullOrEmpty(textBox4.Text.Trim()))
     {
         MessageBox.Show("请输入通道完整信息");
         return;
     }
     if (!EquipmentData.AddEquipment(textBox1.Text.Trim(), textBox2.Text.Trim(), textBox3.Text.Trim()
                                     , textBox4.Text.Trim()))
     {
         MessageBox.Show("新建设备失败");
         return;
     }
     MessageBox.Show("新建设备成功");
     ClearText();
     OnSave();
     this.Hide();
     Program.log.Error($"新建设备{textBox1.Text.Trim()+textBox2.Text.Trim()+textBox3.Text.Trim()+textBox4.Text.Trim()}");
 }