private void button1_Click(object sender, EventArgs e) { if (BoxOrder.Checked) { int orderValidity = DatabaseTools.AddOrder(BoxOrderNum.Text, dateOrder.Value, jobID); switch (orderValidity) { case 2: //Order didn't exist but has been added Submit(); break; case 1: //Order exists but date/job don't match MessageBox.Show("Order number exists but input date and/or job does not match what is stored!"); break; case 0: //Order exists Submit(); break; } } else { Submit(); } }