public utblTourPackageBooking GetBookingByID(long id) { utblTourPackageBooking obj = new utblTourPackageBooking(); obj = _db.utblTourPackageBookings.Where(r => r.BookingID == id).FirstOrDefault(); return(obj); }
public int Save(utblTourPackageBooking book) { int result = 0; if (book.BookingID == 0) { try { _db.utblTourPackageBookings.Add(book); _db.SaveChanges(); result = 1; } catch (Exception ex) { result = 0; } } utblTourPackageBooking dbentry = _db.utblTourPackageBookings.Find(book.BookingID); if (dbentry != null) { dbentry.Status = book.Status; _db.SaveChanges(); result = 1; } return(result); }