public void addStock() { Storeroom store = new Storeroom(); store.Description = descriptionText.Text; store.StoringQty = Convert.ToInt32(storeNumericUpDown.Value); store.Temperature = Int32.Parse(tempText.Text); bool avail = false; int availability = availabilityBox.SelectedIndex; if (availability == 1) { avail = true; } store.Availability = avail; InsertSQL storeHnd = new InsertSQL(); int addrecord = storeHnd.addNewStore(store); MessageBox.Show(addrecord + " Your record is added"); }