// Student/DeleteEducation public ActionResult DeleteEducation(int idEducation) { StudentDTO studentDTO = studentService.GetStudent(educationService.GetEducation(idEducation).IdStudent); SubjectDTO subjectDTO = subjectService.GetSubject(educationService.GetEducation(idEducation).IdSubject); educationService.DeleteEducation(idEducation); studentDTO.StudentAvg = studentService.GetStudentAvg(studentDTO.Id); subjectDTO.SubjectAvg = subjectService.GetSubjectAvg(subjectDTO.Id); ViewBag.message = "Видалення успішне"; return(View("Report")); }
public async Task <IActionResult> EducationDetails(int EducationId) { try { var response = await _service.GetEducation(EducationId); if (response != null) { return(Ok(response)); } return(StatusCode(StatusCodes.Status204NoContent)); } catch (Exception ex) { throw ex; } }
public async Task <ActionResult <EducationViewModel> > GetEducation(int id) { if (id == 1) { return(new EducationViewModel { CollegeName = "Eastern Washington University", FieldOfStudy = "Computer Science", LevelOfDegree = "Bachelors", YearGraduated = 2019, Id = 1 }); } Education education = await EducationService.GetEducation(id); if (education == null) { return(NotFound()); } return(Ok(Mapper.Map <EducationViewModel>(education))); }
public PartialViewResult GetEducation(int id = 1) { var education = _iEducationService.GetEducation(id); return(PartialView("_HeaderEducation", education)); }