public ActionResult ActiveRecruitment(int id) { Recruitment_Post Job = Recruitment_Post.SingleOrDefault("Where Id=@0", id); try { Job.Active = 1; Job.StaffIdUpdate = Convert.ToInt32(Session["UserId"]); Job.UpdateDate = DateTime.Now; Job.Save(); } catch { return(Redirect("/Error/Error")); } return(Redirect("/Recruitment/RecruitmentDetail/" + id)); }
public ActionResult DeleteRecruitment(int id) { Recruitment_Post Job = Recruitment_Post.SingleOrDefault("Where Id=@0 AND Status=1", id); try { Job.Status = 0; Job.StaffIdUpdate = Convert.ToInt32(Session["UserId"]); Job.UpdateDate = DateTime.Now; Job.Save(); } catch { return(Redirect("/Error/Error")); } return(Redirect("/Recruitment/DeletedRecruitmentList")); }