Beispiel #1
0
        public void Create(ResumeViewModel command)
        {
            var newresume = new Resume(command.Priority, command.FromYear, command.ToYear, command.Title, command.Description);

            _irepository.Create(newresume);
            _irepository.SaveChanges();
        }
        public ActionResult Create(ResumeVM model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }


                var Jobseeker = _userManager.GetUserAsync(User).Result;

                model.JobseekerId = Jobseeker.Id;



                var resume = _mapper.Map <Resume>(model);

                var isSucess = _repo.Create(resume);
                if (!isSucess)
                {
                    ModelState.AddModelError("", "Something went wrong...");
                    return(View(model));
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something went wrong...");
                return(View(model));
            }
        }
Beispiel #3
0
        public IActionResult ResumeCreate(ResumeModel model)
        {
            if (ModelState.IsValid)
            {
                var entity = new Resume()
                {
                    Title       = model.Title,
                    Company     = model.Company,
                    Description = model.Description,
                    Job         = model.Job,
                    StartDate   = model.StartDate,
                    FinishDate  = model.FinishDate
                };

                _resumeRepository.Create(entity);
                return(RedirectToAction("ResumeList"));
            }
            return(View());
        }