示例#1
0
        public ActionResult ApplyNow(int id)
        {
            if (!_repo.IsExist(id))
            {
                return(NotFound());
            }
            var username    = User.Identity.Name;
            var user        = _jobseekerManager.GetUserAsync(User).Result;
            var resume      = _ResumeRepositoryRepo.FindAll().FirstOrDefault(q => q.JobseekerId == user.Id);
            var application = new Vacancy_Application
            {
                Resume_requestid  = resume.Id,
                vacancy_requestid = id
            };
            var isSucess = _VacancyApplicationRepositoryRepo.Create(application);

            if (!isSucess)
            {
                ModelState.AddModelError("", "Something went wrong...");
                return(RedirectToAction("Apply", new { id }));
            }

            return(RedirectToAction(nameof(AvailableJobs)));
        }
 public bool Update(Vacancy_Application Entity)
 {
     _db.Vacancy_Applications.Update(Entity);
     return(Save());
 }
 public bool Delete(Vacancy_Application Entity)
 {
     _db.Vacancy_Applications.Remove(Entity);
     return(Save());
 }
 public bool Create(Vacancy_Application Entity)
 {
     _db.Vacancy_Applications.Add(Entity);
     return(Save());
 }