public ActionResult DeleteFromList(string speciality) { EducatedPerson person = new EducatedPerson(); person.personalInfo = PIRepository.Responses.Last(); person.education = EduRepository.Responses.ToList(); EduRepository.DeleteResponce(person.education.FirstOrDefault(t => t.Speciality == speciality)); person.education = EduRepository.Responses.ToList(); return(View("EducationLoad", person)); }
public ActionResult EducationLoad(EducatedPerson personDTO) { if (ModelState.IsValid) { EduRepository.AddResponse(new Education(personDTO.InstituteName, personDTO.Degree, personDTO.Speciality, personDTO.YearPassed)); EducatedPerson person = new EducatedPerson(); person.personalInfo = PIRepository.Responses.Last(); person.education = EduRepository.Responses.ToList(); return(View("EducationLoad", person)); } else { EducatedPerson person = new EducatedPerson(PIRepository.Responses.Last(), null, null, null, 2020, new List <Education>()); return(View("EducationLoad", person)); } }
public ActionResult EducationAdd() { EducatedPerson person = new EducatedPerson(PIRepository.Responses.Last(), null, null, null, 2020, new List <Education>()); return(View("EducationLoad", person)); }