public static List<JobModel> GetJobsForReleasingResultForInterviewer(Models.User user) { SqlConnection con = DBUtils.getDBConnection(); con.Open(); SqlCommand command = new SqlCommand(" SELECT j.job_id, j.job_description, j.job_role_id, j.skill_set, j.vacancies, " + "j.min_experience, j.max_experience, j.age_limit, j.posted_by, j.posted_on, j.status " + " FROM dbo.Job j inner join dbo.InterviewerJob i on j.job_id = i.job_id" + " WHERE i.interviewer_username='******';", con); SqlDataReader reader = command.ExecuteReader(); List<JobModel> jobs = new List<JobModel>(); while (reader.Read()) { JobModel job = new JobModel(); job.JobId = reader.GetInt32(0); job.JobDesc = reader.GetString(1); job.JobRole = reader.GetInt32(2); job.Skills = new List<string>(reader.GetString(3).Split(',')); job.Vacancies = reader.GetInt32(4); job.MinExperience = reader.GetInt32(5); job.MaxExperience = reader.GetInt32(6); job.AgeLimit = reader.GetInt32(7); job.PostedBy = reader.GetInt32(8); job.PostedOn = reader.GetDateTime(9); job.Status = reader.GetString(10); //jobs.Add(job); if (job.Status.Equals("S")) { jobs.Add(job); } } con.Close(); return jobs; }
private static List<JobModel> getJobs() { SqlConnection con = DBUtils.getDBConnection(); con.Open(); SqlCommand command = new SqlCommand(" select job_id, job_description, job_role_id, skill_set, vacancies, " + "min_experience, max_experience, age_limit, posted_by, posted_on, status from dbo.Job ", con); command.ExecuteNonQuery(); SqlDataReader reader = command.ExecuteReader(); List<JobModel> jobs = new List<JobModel>(); while (reader.Read()) { JobModel job = new JobModel(); job.JobId = reader.GetInt32(0); job.JobDesc = reader.GetString(1); job.JobRole = reader.GetInt32(2); job.Skills = new List<string>(reader.GetString(3).Split(',')); job.Vacancies = reader.GetInt32(4); job.MinExperience = reader.GetInt32(5); job.MaxExperience = reader.GetInt32(6); job.AgeLimit = reader.GetInt32(7); job.PostedBy = reader.GetInt32(8); job.PostedOn = reader.GetDateTime(9); job.Status = reader.GetString(10); jobs.Add(job); } con.Close(); return jobs; }
public static JobModel getJobForWhichUserIsSelected(int candidate_id) { SqlConnection con = DBUtils.getDBConnection(); con.Open(); SqlCommand command = new SqlCommand(" select a.job_id, j.job_description " + "from dbo.Application a inner join job j on j.job_id = a.job_id where status_code = 'S' and candidate_id = " + candidate_id, con); command.ExecuteNonQuery(); JobModel job = new JobModel(); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { job.JobId = reader.GetInt32(0); job.JobDesc = reader.GetString(1); } con.Close(); return job; }
public JobSelectModel(JobModel job) { this.JobId = job.JobId; this.JobDesc = job.JobDesc; this.JobRole = job.JobRole; this.MinExperience = job.MinExperience; this.MaxExperience = job.MaxExperience; this.PostedBy = job.PostedBy; this.PostedOn = job.PostedOn; this.Skills = job.Skills; this.Status = job.Status; this.Vacancies = job.Vacancies; this.AgeLimit = job.AgeLimit; }
public ActionResult ScheduleInterviewDialog(JobModel jobModel) { 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"); } InterviewModel model = new InterviewModel(); model.JobId = jobModel.JobId; model.JobDesc = jobModel.JobDesc.Replace(Environment.NewLine, ""); @ViewBag.Layout = "~/Views/Shared/_LayoutPageManager.cshtml"; @ViewBag.Controller = "Admin"; return PartialView("../Staff/_PartialScheduleInterview", model); }
public ActionResult ReleaseResultsDialog(JobModel jobModel) { if (!Navigator.IsUserLoggedIn(Session)) { @ViewBag.Message = "Sorry! You need to login to view this page."; return View("Message"); //return RedirectToAction("Login", "Account"); } else if (!Navigator.UserRoleValidation(Session, "manager")) { @ViewBag.Message = "Access Denied ! You are not allowed to visit this page."; return View("Message"); //return RedirectToAction("Login", "Account"); } ResultModel model = new ResultModel(); model.JobId = jobModel.JobId; model.JobDesc = jobModel.JobDesc; model.Vacancies = jobModel.Vacancies; model.Candidates = ASCommonDAL.GetApplicantForTheJob(jobModel.JobId); @ViewBag.Layout = "~/Views/Shared/_LayoutPageManager.cshtml"; @ViewBag.Controller = "Admin"; return PartialView("../Staff/_PartialReleaseResults", model); }
public ActionResult ReleaseResultsDialog(JobModel jobModel) { if (!Navigator.IsUserLoggedIn(Session)) { @ViewBag.Message = "Sorry! You need to login to continue."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } else if (!Navigator.UserRoleValidation(Session, "staff")) { @ViewBag.Message = "Access Denied ! You are not allowed to continue."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } else if (!Navigator.IsStaffAllowed(Session, "RightToPublish")) { @ViewBag.Message = "User Rights Denied! You don't have permission for this."; return PartialView("_PartialMessage"); //return RedirectToAction("Login", "Account"); } ResultModel model = new ResultModel(); model.JobId = jobModel.JobId; model.JobDesc = jobModel.JobDesc; model.Vacancies = jobModel.Vacancies; model.Candidates = ASCommonDAL.GetApplicantForTheJob(jobModel.JobId); @ViewBag.Layout = "~/Views/Shared/_LayoutPageStaff.cshtml"; @ViewBag.Controller = "Staff"; return PartialView("_PartialReleaseResults", model); }