private void Setup() { SetupSimple(); try { actualData = manager.GetOne(Fillables.FillHotel, PrimaryKeys(0)); manager.Delete(PrimaryKeys(0)); } catch (Exception e) { } }
private bool CheckNoDuplicate(User user) //This should probably be replaced by some other code in the UWP app part. { User userEmailTemp = userManager.GetOne(Fillables.FillUser, UsersController.EmailKey(user.Email)); User userPhoneNumberTemp = userManager.GetOne(Fillables.FillUser, UsersController.PhoneNumberKey(user.PhoneNumber)); string email = userEmailTemp != null ? userEmailTemp.Email : string.Empty; string phoneNumber = userPhoneNumberTemp != null ? userPhoneNumberTemp.PhoneNumber : string.Empty; bool emailOk = email == string.Empty || userEmailTemp.Id == user.Id; bool phoneNumberOk = phoneNumber == string.Empty || userPhoneNumberTemp.Id == user.Id; return(emailOk && phoneNumberOk); }
private Tuple <User, Speaker, Admin> ManageLogin(Dictionary <string, object> lookupDictionary, bool isEmailKey) { User user = userManager.GetOne(Fillables.FillUser, lookupDictionary); if (user != null) { Speaker speaker = speakerManager.GetOne(Fillables.FillSpeaker, SpeakersController.PrimaryKeys(user.Id)); if (speaker != null) { return(new Tuple <User, Speaker, Admin>(null, speaker, null)); } Admin admin = adminManager.GetOne(Fillables.FillAdmin, AdminsController.PrimaryKeys(user.Id)); if (admin != null) { return(new Tuple <User, Speaker, Admin>(null, null, admin)); } return(new Tuple <User, Speaker, Admin>(user, null, null)); } return(null); }
// GET: api/Users/5 public User Get(int id) { return(manager.GetOne(Fillables.FillUser, PrimaryKeys(id))); }
public Room Get(int roomNo, int hotelNo) { return(manager.GetOne(Fillables.FillRoom, PrimaryKeys(roomNo, hotelNo))); }
// GET: api/Hotels/5 public Hotel Get(int id) { return(manager.GetOne(Fillables.FillHotel, PrimaryKeys(id))); }
// GET: api/Rooms/5 public Room Get(int id) { return(roomManager.GetOne(Fillables.FillRoom, PrimaryKeys(id))); }
// GET: api/Guests/5 public Guest Get(int id) { return(manager.GetOne(Fillables.FillGuest, PrimaryKeys(id))); }
// GET: api/Events/5 public Event Get(int id) { return(eventManager.GetOne(Fillables.FillEvent, PrimaryKeys(id))); }
// GET: api/Bookings/5 public Booking Get(int id) { return(bookingSettingsManager.GetOne(Fillables.FillBooking, PrimaryKeys(id))); }
// GET: api/Admins/5 public Admin Get(int id) { return(adminManager.GetOne(Fillables.FillAdmin, PrimaryKeys(id))); }
// GET: api/Speakers/5 public Speaker Get(int id) { return(speakerManager.GetOne(Fillables.FillSpeaker, PrimaryKeys(id))); }