Пример #1
0
        public ActionResult ListJobs()
        {
            IEnumerable <CompanyJobPoco> companyJobList = null;

            //In different menu step always clear other menu temp data's
            TempData.Keep("ListJobsAppliedModel");

            if (TempData["ListJobsModel"] == null)
            {
                IDataRepository <CompanyJobPoco> repoCompanyJob = new MvcLogic <CompanyJobPoco>().Repo;
                IList <Guid> companyFullIdJobList = repoCompanyJob.GetList(c => (c.IsInactive == false) && (c.IsCompanyHidden == false)).Select(c => c.Id).ToList();

                companyJobList = repoCompanyJob.GetList(c => companyFullIdJobList.Contains(c.Id),
                                                        c => c.CompanyJobsDescriptions,
                                                        c => c.CompanyProfiles
                                                        );
                TempData["ListJobsModel"] = companyJobList;
            }
            else
            {
                companyJobList = TempData["ListJobsModel"] as IEnumerable <CompanyJobPoco>;
                TempData.Keep("ListJobsModel");
            }

            return(View(companyJobList));
        }
Пример #2
0
        // GET: CompanyJob
        public ActionResult Index()
        {
            //IDataRepository<CompanyJobPoco> repo = new MvcLogic<CompanyJobPoco>().Repo;
            ////CompanyJobLogic logic = new CompanyJobLogic(new EFGenericRepository<CompanyJobPoco>);
            IDataRepository <CompanyJobPoco> repoCompanyJob = new MvcLogic <CompanyJobPoco>().Repo;
            IList <Guid> companyFullIdJobList = repoCompanyJob.GetList(c => (c.IsInactive == false) && (c.IsCompanyHidden == false)).Select(c => c.Id).ToList();


            IEnumerable <CompanyJobPoco> companyJobList = repoCompanyJob.GetList(c => companyFullIdJobList.Contains(c.Id),
                                                                                 c => c.CompanyJobsDescriptions,
                                                                                 c => c.CompanyProfiles
                                                                                 );


            //var companyJobs = db.CompanyJobs.Include(c => c.CompanyProfiles);
            return(View(companyJobList));
        }