public IHttpActionResult Get(int neighborhoodId) { NeighborhoodService neighService = CreateNeighborhoodService(); var neighs = neighService.GetNeighborhoodById(neighborhoodId); return(Ok(neighs)); }
private NeighborhoodService CreateNeighborhoodService() { var userId = Guid.Parse(User.Identity.GetUserId()); var neighborhoodService = new NeighborhoodService(userId); return(neighborhoodService); }
public IHttpActionResult GetAll() { NeighborhoodService neighService = CreateNeighborhoodService(); var neighs = neighService.GetNeighborhoods(); return(Ok(neighs)); }
public ActionResult Edit(NeighborhoodEdit neighborhood) { if (ModelState.IsValid) { _userId = Guid.Parse(User.Identity.GetUserId()); _neighborhoodService = new NeighborhoodService(_userId); _neighborhoodService.EditNeighborhood(neighborhood); return(RedirectToAction("Index")); } ViewBag.StateId = new SelectList(db.States, "StateId", "StateName", neighborhood.StateId); return(View(neighborhood)); }
public ActionResult AddLocations(NeighborhoodAddLocation locationToAdd) { if (ModelState.IsValid) { _userId = Guid.Parse(User.Identity.GetUserId()); _neighborhoodService = new NeighborhoodService(_userId); _neighborhoodService.AddLocation(locationToAdd); return(RedirectToAction("AddLocations")); // This line is what allows a location to be added without changing the page } ViewBag.LocationId = new SelectList(db.Locations, "LocationId", "Name"); return(View("AddLocations")); }
public HomeController(StudentService studentService, GovernorateService governorateService, NeighborhoodService neighborhoodService, FieldService fieldService ) { StudentService = studentService; GovernorateService = governorateService; NeighborhoodService = neighborhoodService; FieldService = fieldService; }
public ActionResult UnlistedPartial(NeighborhoodCreate neighborhood) { if (ModelState.IsValid) { _userId = Guid.Parse(User.Identity.GetUserId()); _neighborhoodService = new NeighborhoodService(_userId); _neighborhoodService.CreateNeighborhood(neighborhood); return(RedirectToAction("Create", "Residents")); } ViewBag.StateId = new SelectList(db.States, "StateId", "StateName", neighborhood.StateId); return(View(neighborhood)); }
public StudentController( StudentService _StudentService, StudentTeacherService _StudentTeacherService, GovernateService _GovernateService, NeighborhoodService _NeighborhoodService, FieldService _FieldService ) { StudentService = _StudentService; StudentTeacherService = _StudentTeacherService; GovernateService = _GovernateService; NeighborhoodService = _NeighborhoodService; FieldService = _FieldService; }
public NeighborhoodController(NeighborhoodService neighborhoodService, GovernateService governateService) { NeighborhoodService = neighborhoodService; GovernateService = governateService; }