private void button1_Click(object sender, EventArgs e) { string name, type, noOfGuests, contact, venue; DateTime stime, etime, date; int id; float price; if (MH.validator(guestnamtxtbx) && MH.validator(typeofeventtxtbx) && MH.validator(noofpersontxtbx) && MH.validator(cntctnotxtbx) && MH.validator(venueList)) { name = guestnamtxtbx.Text; type = typeofeventtxtbx.Text; noOfGuests = noofpersontxtbx.Text; stime = dateTimePicker2.Value; etime = dateTimePicker3.Value; date = dateTimePicker1.Value; venue = this.venueList.GetItemText(this.venueList.SelectedItem); contact = cntctnotxtbx.Text; price = float.Parse(price_lable.Text.ToString()); id = MH.InsertNewBooking(name, type, venue, noOfGuests, stime, etime, date, contact, price); MessageBox.Show("Your Event has been sceduled! \n Booking ID: " + id.ToString()); textBox4.Text = id.ToString(); } }