Exemple #1
0
 private void bt_AddBrand_Click(object sender, EventArgs e)
 {
     try
     {
         if (device == null)
         {
             device = new Device();
         }
         device.Brand = textBox1.Text;
         sql.AddBrand(textBox1.Text, comboBox_Categories.Text);
         MessageBox.Show("Добавлен новый бренд: " + textBox1.Text + " в категории " + comboBox_Categories.Text, "Успешное добавление бренда");
     }
     catch
     {
         MessageBox.Show("Not connected to DB", "Error");
     }
     this.Close();
 }