public int SaveBooking(Booking b)
        {
            try
            {
                int j = -1;
                LINQDBDataContext dc = new LINQDBDataContext();

                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;
        }
Exemplo n.º 2
0
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Vehicle = this;
		}
Exemplo n.º 3
0
		private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Vehicle = null;
		}
Exemplo n.º 4
0
 partial void UpdateBooking(Booking instance);
Exemplo n.º 5
0
 partial void DeleteBooking(Booking instance);
Exemplo n.º 6
0
 partial void InsertBooking(Booking instance);
Exemplo n.º 7
0
		private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.BookingStatus = null;
		}
Exemplo n.º 8
0
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.BookingStatus = this;
		}
Exemplo n.º 9
0
		private void detach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Customer = null;
		}
Exemplo n.º 10
0
		private void attach_Bookings(Booking entity)
		{
			this.SendPropertyChanging();
			entity.Customer = this;
		}