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; }
private void attach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.Vehicle = this; }
private void detach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.Vehicle = null; }
partial void UpdateBooking(Booking instance);
partial void DeleteBooking(Booking instance);
partial void InsertBooking(Booking instance);
private void detach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.BookingStatus = null; }
private void attach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.BookingStatus = this; }
private void detach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.Customer = null; }
private void attach_Bookings(Booking entity) { this.SendPropertyChanging(); entity.Customer = this; }