private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Customer = null;
		}
		private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.BookingStatus = null;
		}
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Customer = this;
		}
 partial void DeleteBooking(Booking instance);
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.BookingStatus = this;
		}
 partial void UpdateBooking(Booking instance);
 partial void InsertBooking(Booking instance);
		private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Vehicle = null;
		}
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Vehicle = this;
		}
        public int SaveBooking(Booking b)
        {
            try
            {
                int j = -1;
                dc = new LSQLDataContext();

                IQueryable<int> d = from r in dc.Bookings
                                    orderby r.booking_id ascending
                                    select r.booking_id;
                foreach (int i in d)
                {
                    j = i;
                }

                b.booking_id = j + 1;

                dc.Bookings.InsertOnSubmit(b);
                dc.SubmitChanges();
            }
            catch (Exception)
            {
                return -1;
            }
            return b.booking_id;
        }