public phone_booking AddNewBooking(phone_booking phone) { phone_booking book = null; book = context.phone_booking.Add(phone); context.SaveChanges(); return(book); }
public phone_booking FindById(int id) { phone_booking book = null; try { book = context.phone_booking.FirstOrDefault(e => e.id == id); } catch (Exception e) { } return(book); }
public phone_booking EditPhoneBooking(int id, String status) { phone_booking phone = null; try { phone = FindById(id); if (phone != null) { phone.status = status; context.SaveChanges(); } } catch (Exception e) { } return(phone); }