//function to update an existing record on the dbase public void Update(clsBookings ExistingBooking) { clsDataConnection ExistingDBBooking = new clsDataConnection(); //add parameters ExistingDBBooking.AddParameter("@BookingNo", ExistingBooking.BookingNo); ExistingDBBooking.AddParameter("@CustomerNo", ExistingBooking.CustomerNo); ExistingDBBooking.AddParameter("@TourNo", ExistingBooking.TourNo); ExistingDBBooking.AddParameter("@DateTime", ExistingBooking.DateandTime); ExistingDBBooking.AddParameter("@PassengerCount", ExistingBooking.PassengerCount); //execute the sproc ExistingDBBooking.Execute("sproc_tblBooking_Update"); }
//function for adding new booking record to the database public Int32 Add(clsBookings NewBooking) { clsDataConnection NewDBBooking = new clsDataConnection(); //add the parameters NewDBBooking.AddParameter("@BookingNo", NewBooking.BookingNo); NewDBBooking.AddParameter("@CustomerNo", NewBooking.CustomerNo); NewDBBooking.AddParameter("@TourNo", NewBooking.TourNo); NewDBBooking.AddParameter("@DateTime", NewBooking.DateandTime); NewDBBooking.AddParameter("@PassengerCount", NewBooking.PassengerCount); //execute the insert stored procedure return(NewDBBooking.Execute("sproc_tblBookings_Insert")); }