public ActionResult Applications() { var data = (from p in db.applications join q in db.jobs on p.job_id equals q.job_id join r in db.employer_info on q.employer equals r.emp_id join s in db.jobseeker_info on p.jobseeker_id equals s.js_id select new { p, q.title, r.company_name, r.logo, r.emp_id, s.full_name }).ToList(); List <ApplicationDetailedViewModel> int_list = new List <ApplicationDetailedViewModel>(); foreach (var item in data) { ApplicationDetailedViewModel interest = new ApplicationDetailedViewModel(); interest.created_at = item.p.created_at; interest.app_id = item.p.app_id; interest.jobseeker_id = item.p.jobseeker_id; interest.job_id = item.p.job_id; interest.status = item.p.status; interest.job = item.title; interest.jobseeker = item.full_name; interest.employer = item.company_name; interest.employer_id = item.emp_id; interest.accept_status = item.p.accept_status; int_list.Add(interest); } return(View(int_list)); }
public ActionResult appliedJobs(int?page, string searchkey = "") { int pageIndex = page.HasValue ? Convert.ToInt32(page) : 1; int pageSize = 10; int js_id = Convert.ToInt32(Session["js_id"].ToString()); var data = (from p in db.applications join q in db.jobs on p.job_id equals q.job_id join r in db.employer_info on q.employer equals r.emp_id join s in db.jobseeker_info on p.jobseeker_id equals s.js_id where p.jobseeker_id == js_id where r.name.Contains(searchkey) || q.title.Contains(searchkey) where p.status == 1 select new { p, q.title, r.company_name, r.logo, r.emp_id }).ToList(); List <ApplicationDetailedViewModel> int_list = new List <ApplicationDetailedViewModel>(); foreach (var item in data) { ApplicationDetailedViewModel interest = new ApplicationDetailedViewModel(); interest.created_at = item.p.created_at; interest.app_id = item.p.app_id; interest.jobseeker_id = item.p.jobseeker_id; interest.job_id = item.p.job_id; interest.status = item.p.status; interest.job = item.company_name; interest.job = item.title; interest.employer = item.company_name; interest.employer_id = item.emp_id; interest.accept_status = item.p.accept_status; int_list.Add(interest); } return(View(int_list.ToPagedList(pageIndex, pageSize))); }