public ActionResult RejectProfile(string user_id, int job_id) { SeekerToJob sj = db.SeekersToJobs.Where(s => s.UserId == user_id && s.job_id == job_id).FirstOrDefault(); sj.IsAccepted = false; db.SaveChanges(); return(RedirectToAction("GetJobApplicants", new { id = job_id })); }
public ActionResult ApplyForJob(string Message) { var UserId = User.Identity.GetUserId(); var job_id = (int)Session["job_id"]; var check = db.SeekersToJobs.Where(j => j.job_id == job_id && j.UserId == UserId).ToList(); if (check.Count < 1) { var SeekToJob = new SeekerToJob(); SeekToJob.UserId = UserId; SeekToJob.job_id = job_id; SeekToJob.Message = Message; SeekToJob.Date = DateTime.Now; db.SeekersToJobs.Add(SeekToJob); db.SaveChanges(); ViewBag.Msg = "Data Send Successfully"; } else { ViewBag.Msg = "User can't apply for the job more than one time"; } return(View()); }