public ActionResult ViewJobApplicationByJobId(JobListModel model) { if (!Navigator.IsUserLoggedIn(Session)) { @ViewBag.Message = "Sorry! You need to login to view this page."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } else if (!Navigator.UserRoleValidation(Session, "manager")) { @ViewBag.Message = "Access Denied ! You are not allowed to visit this page."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } IEnumerable<ApplicationModel> data = CandidateDAL.GetApplicationDetailsByJobId(model.JobId); @ViewBag.Controller = "Admin"; @ViewBag.Layout = "~/Views/Shared/_LayoutPageManager.cshtml"; return PartialView("../Staff/_PartialJobApplicationStatus", data); }
public static JobListModel GetJobList() { SqlConnection con = DBUtils.getDBConnection(); con.Open(); SqlCommand command = new SqlCommand("select job_id from dbo.Job;", con); SqlDataReader reader = command.ExecuteReader(); if (reader == null || !reader.Read()) { return null; } //Creating a JobRole List List<int> listItems = new List<int>(); do { listItems.Add(Convert.ToInt32(reader[0])); } while (reader.Read()); con.Close(); JobListModel model = new JobListModel(); model.JobIdList = listItems; return model; }
public ActionResult ViewJobApplicationByJobId(JobListModel model) { if (!Navigator.IsUserLoggedIn(Session)) { @ViewBag.Message = "Sorry! You need to login to view this page."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } else if (!Navigator.UserRoleValidation(Session, "staff")) { @ViewBag.Message = "Access Denied ! You are not allowed to visit this page."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } IEnumerable<ApplicationModel> data = CandidateDAL.GetApplicationDetailsByJobId(model.JobId); return PartialView("_PartialJobApplicationStatus", data); }