private void AddBooks_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.Text == "")//validation part { MessageBox.Show("Please, insert all values"); } else { if (comboBox1.Text == "Name") { int r = EmC.EditBookPrice(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text)); if (r == 0) { MessageBox.Show("Your Request is Invalid"); } else { MessageBox.Show("Price of the Book is Updated!"); } } else if (comboBox1.Text == "Manager ID") { int r = EmC.EditQuantityPrice(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text)); if (r == 0) { MessageBox.Show("Your Request is Invalid"); } else { MessageBox.Show("Quantity of the Book is Updated!"); } } } }