protected void Button1_Click(object sender, EventArgs e) { Booking book = new Booking(); book.BookingDate = Date; book.BookingNo = BookingNo; book.TravelerCount = Convert.ToInt32(TravelerCount.Text); if (!(Request.Cookies["custUsername"] is null)) { book.CustomerId = Convert.ToInt32(Request.Cookies["custUsername"].Value); } if (Session["custUsername"] != null) { book.CustomerId = Convert.ToInt32(Session["custUsername"].ToString()); } book.PackageId = ToNullableInt(Session["lastPckgVw"].ToString()); BookingDetailsDB.CreateBookingDetailPckg(BookingDB.CreateBookingPckg(book, ClassesDropDDl.SelectedValue), ClassesDropDDl.SelectedValue); Response.Redirect("Index.aspx"); }