public async Task <IActionResult> EditParent(int id) { var user = await _userManager.GetUserAsync(User); var isAdmin = await IsAdmin(); var schools = _schoolsServices.GetAllByUserId <SchoolViewModel>(user?.UniqueGradebookId, isAdmin).ToList(); var students = _studentsService.GetAllBySchoolIds <StudentViewModel>(schools.Select(s => s.Id)); var parent = _parentsService.GetById <ParentInputModel>(id); var inputModel = new ParentModifyInputModel { Id = id, Students = students.Select(s => new SelectListItem($"{s.FirstName} {s.LastName} ({s.SchoolName})", s.Id.ToString())).ToList(), Parent = parent }; return(View(inputModel)); }
public IHttpActionResult GetParentById(int id) { Parent parent = parentsService.GetById(id); if (parent == null) { return(NotFound()); } return(Ok(parent)); }
public IHttpActionResult GetParentById(string id) { Parent parent = parentsService.GetById(id); if (parent == null) { return(NotFound()); } logger.Info("Requesting parent by id"); return(Ok(parent)); }