private CvFormViewModel GetCurriculumVitae(string userId, string cvId) { var cv = _curriculumVitaeService.GetCurriculumVitaeById(userId, cvId); if (cv == null) { return(null); } var result = new CvFormViewModel() { Id = cv.Id, FileName = cv.Name, Type = cv.Type, RefNum = cv.RefNum, SelectedExp1 = cv.Experience1, SelectedExp2 = cv.Experience2, Experiences = GetExperienceSelectList(userId), SelectedCourse1 = cv.Course1, SelectedCourse2 = cv.Course2, Courses = GetCourseSelectList(userId), CreateDate = cv.CreateDate }; return(result); }
public IActionResult FormThree(CvFormViewModel model) { UserDetails user = new UserDetails { Fullname = model.Fullname, Phone = model.Phone, Email = model.Email, Summary = model.Summary, Skills = model.Skills, Institution = model.Institution, Course = model.Course, GradYear = model.GradYear, Degree = model.Degree, Company = model.Company, JobTitle = model.JobTitle, ExperienceStart = model.ExperienceStart, ExperienceEnd = model.ExperienceEnd, Duties = model.Duties, Languages = model.Languages, Certifications = model.Certifications }; TempData["userdata"] = user; return(RedirectToAction("CvThree", "CvGeneration")); }
public ActionResult EditCv(CvFormViewModel cv) { if (ModelState.IsValid) { var isUpdated = UpdateCurriculumVitae(User.Identity.GetUserId(), cv); if (isUpdated) { return(Json(new { success = true })); } } var cvmodel = GetCurriculumVitae(User.Identity.GetUserId(), cv.Id.ToString()); return(PartialView("_EditCV", cvmodel)); }
private bool UpdateCurriculumVitae(string userId, CvFormViewModel cv) { var updateRecord = new CurriculumVitaeDto() { Id = cv.Id, UserId = userId, Name = cv.FileName, Type = "BASIC", RefNum = cv.RefNum, Experience1 = cv.SelectedExp1, Experience2 = cv.SelectedExp2, Course1 = cv.SelectedCourse1, Course2 = cv.SelectedCourse2 }; return(_curriculumVitaeService.UpdateCurriculumVitae(userId, updateRecord)); }