public ActionResult JobDetails(Guid?id) { CompanyJobPoco companyJobPoco = null; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (TempData["ListJobsModelPerCompany"] != null) { IEnumerable <CompanyJobPoco> companyJobList = (IEnumerable <CompanyJobPoco>)TempData["ListJobsModelPerCompany"]; companyJobPoco = companyJobList.Where(c => c.Id == id).FirstOrDefault(); if (companyJobPoco == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TempData.Keep("ListJobsModelPerCompany"); } else { IDataRepository <CompanyJobPoco> repoCompanyJob = new MvcLogic <CompanyJobPoco>().Repo; companyJobPoco = repoCompanyJob.GetSingle(c => c.Id == id); if (companyJobPoco == null) { return(HttpNotFound()); } } if (TempData["JobDetailsModelPerCompany"] == null) { TempData["JobDetailsModelPerCompany"] = companyJobPoco; } return(View(companyJobPoco)); }
public ActionResult JobDetailsApplied(Guid?id) { ApplicantJobApplicationPoco applicantJobApplicationPoco = null; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (TempData["ListJobsAppliedModel"] != null) { IEnumerable <ApplicantJobApplicationPoco> appliedJobList = (IEnumerable <ApplicantJobApplicationPoco>)TempData["ListJobsAppliedModel"]; applicantJobApplicationPoco = appliedJobList.Where(c => c.Id == id).FirstOrDefault(); if (applicantJobApplicationPoco == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TempData.Keep("ListJobsAppliedModel"); } else { IDataRepository <ApplicantJobApplicationPoco> repoAppliedJob = new MvcLogic <ApplicantJobApplicationPoco>().Repo; applicantJobApplicationPoco = repoAppliedJob.GetSingle(c => c.Id == id); if (applicantJobApplicationPoco == null) { return(HttpNotFound()); } } return(View(applicantJobApplicationPoco)); }