public ShackUpService() { statesRepo = StatesRepositoryFactory.GetRepository(); bathroomTypesRepo = BathroomTypesRepositoryFactory.GetRepository(); listingsRepo = ListingRepositoryFactory.GetRepository(); acctRepo = AccountRepositoryFactory.GetRepository(); }
public ActionResult Contacts() { var userId = AuthorizeUtilities.GetUserId(this); var repo = AccountRepositoryFactory.GetRepository(); var model = repo.GetContacts(userId); return(View(model)); }
public ActionResult DeleteFavorite(int ListingId) { var userId = AuthorizeUtilities.GetUserId(this); var repo = AccountRepositoryFactory.GetRepository(); repo.RemoveFavorite(userId, ListingId); return(RedirectToAction("Favorites")); }
public IHttpActionResult RemoveContact(string userId, int listingId) { var repo = AccountRepositoryFactory.GetRepository(); try { repo.RemoveContact(userId, listingId); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult CheckFavorite(string userId, int listingId) { var repo = AccountRepositoryFactory.GetRepository(); try { var result = repo.IsFavorite(userId, listingId); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult UserList() { var model = AccountRepositoryFactory.GetRepository().GetUsers().ToList(); return(View(model)); }
public ActionResult Contact(Contacts contacts) { AccountRepositoryFactory.GetRepository().AddContact(contacts); return(View()); }
public MyAccountController() { _svc = ShackUpServiceFactory.GetService(); acctRepo = AccountRepositoryFactory.GetRepository(); //use if no service layer }
public ListingsAPIController() { _svc = ShackUpServiceFactory.GetService(); acctRepo = AccountRepositoryFactory.GetRepository(); //use if no service layer listingRepo = ListingRepositoryFactory.GetRepository(); //use if no service layer }