public int SaveJob(PostedJob postJob) { try { ApplicationDbContext.PostedJobs.Add(postJob); ApplicationDbContext.SaveChanges(); return(1); } catch (Exception ex) { return(0); } }
public IEnumerable <PostedJob> SearchJobsUsingCondition(PostedJob postedJob) { try { var _postedJob = ApplicationDbContext.PostedJobs .Where(j => j.JobTitle.Contains(postedJob.JobTitle) || j.Skill.Contains(postedJob.Skill) || j.Designation.Contains(postedJob.Designation) || j.City.Contains(postedJob.City)).ToList(); return(_postedJob); } catch (Exception ex) { throw; } }
public void ApplyTest() { var job = new PostedJob { City = "banagalore", JobTitle = "tester", ValidTill = DateTime.Now.AddDays(5), IsCanceled = false }; SetUpIdentity(); _generalRepository.Setup(s => s.GetJobForAppling(guid)) .Returns(job); var result = _userController.Apply(guid); Assert.IsNotNull(result); Assert.That(result, Is.InstanceOf <ViewResult>()); }
public ActionResult AddJob(JobFormViewModel viewModel) { var postedJob = new PostedJob { Id = Guid.NewGuid(), UserId = User.Identity.GetUserId(), JobTitle = viewModel.JobTitle, Description = viewModel.Description, Designation = viewModel.Designation, State_Id = viewModel.State_Id, City = viewModel.City, //JobCategory = viewModel.JobCategory, Skill = viewModel.Skill, TypeOfJob_ID = viewModel.TypeOfJob_Id, ValidTill = viewModel.ValidTill, IsCanceled = false, experience = viewModel.experience, salary = viewModel.salary }; var i = _unitOfWork.GeneralRepository.SaveJob(postedJob); return(RedirectToAction("DashBoard", "Recruiter")); }
public ActionResult SearchByUser(PostedJob postedJob) { var job = _unitOfWork.GeneralRepository.SearchJobsUsingCondition(postedJob); return(View("Index", job)); }