Exemplo n.º 1
0
 public int SaveJob(PostedJob postJob)
 {
     try
     {
         ApplicationDbContext.PostedJobs.Add(postJob);
         ApplicationDbContext.SaveChanges();
         return(1);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
Exemplo n.º 2
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;
     }
 }
Exemplo n.º 3
0
        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>());
        }
Exemplo n.º 4
0
        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"));
        }
Exemplo n.º 5
0
        public ActionResult SearchByUser(PostedJob postedJob)
        {
            var job = _unitOfWork.GeneralRepository.SearchJobsUsingCondition(postedJob);

            return(View("Index", job));
        }