Example #1
0
        public async Task <IActionResult> EditResume(ResumeViewModel viewModel)
        {
            FilledResume filledResume = new FilledResume();

            filledResume.UserInfo         = viewModel.UserInfo;
            filledResume.StreamId         = _streamService.GetStreamByFullName(viewModel.StreamFullName).Id;
            filledResume.ResumeId         = viewModel.ResumeId;
            filledResume.Summary          = viewModel.Summary;
            filledResume.Skills           = viewModel.Skills;
            filledResume.ForeignLanguages = viewModel.ForeignLanguages;
            filledResume.Educations       = viewModel.Educations;
            filledResume.Courses          = viewModel.Courses;
            filledResume.Certificates     = viewModel.Certificates;
            filledResume.Exams            = viewModel.Exams;

            WorkExperience[] workExperiences = new WorkExperience[viewModel.WorkExperiences.Length];

            for (int i = 0; i < viewModel.WorkExperiences.Count(); i++)
            {
                workExperiences[i] = viewModel.WorkExperiences[i].ToWorkExperience();
            }

            filledResume.WorkExperiences = workExperiences;
            filledResume.Portfolios      = viewModel.Portfolios;
            filledResume.MilitaryStatus  = viewModel.MilitaryStatus;
            filledResume.AdditionalInfo  = viewModel.AdditionalInfo;
            filledResume.Recommendations = viewModel.Recommendations;

            await _editResumeService.SaveFullResumeAsync(filledResume);

            return(RedirectToAction(nameof(ResumeReviewController.Index), "ResumeReview", new { resumeId = viewModel.ResumeId }));
        }
Example #2
0
        public async Task <IActionResult> SaveStreamAsync(ResumeViewModel vm)
        {
            if (ModelState.IsValid)
            {
                UserInfo userInfo       = _userInfo;
                Student  currentStudent = _studentService.GetCurrentStudentByUserInfo(userInfo.Id);
                Resume   resume         = _resumeService.GetResumeById(vm.ResumeId);
                resume.CurrentStep = vm.CurrentResumeStep;
                int streamId = _streamService.GetStreamByFullName(vm.StreamFullName).Id;

                await _streamResumeService.SaveStreamAndUpdateResumeAsync(resume, currentStudent.Id, streamId);
            }

            return(RedirectToAction("Index", vm));
        }