private void BtnAddDish_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(textBox1.Text)) { // it is not empty or null! Random rdm = new Random(); int menuItemId = rdm.Next(1, 999999); int VAT; if (comboBoxBTW.SelectedItem == comboBoxBTW.Items[0]) { VAT = 21; } else { VAT = 6; } menuItemService.AddMenuItem(menuItemId, textBox1.Text, numericUpDown1.Value, VAT, (int)numericUpDown3.Value, type, comboBoxType.SelectedItem.ToString()); menuService.AddItemToMenu(menu.Id, menuItemId); } else { LblWarning.Text = "Kan geen item zonder naam toevoegen!"; } }