Esempio n. 1
0
        public IEnumerable <TextAndValueBox> GetAll()
        {
            IEnumerable <Region> regions = _regionRepository.All();

            IEnumerable <TextAndValueBox> result = this.ConvertAllToVms(regions);

            return(result);
        }
Esempio n. 2
0
        public List <ShortJobPosting> GetPostingsByRegion(int regionId)
        {
            List <ShortJobPosting> postingsByRegion = new List <ShortJobPosting>();
            var postings = _jobPostingRepository.All().Where(p => p.RegionID == regionId).ToList();

            postings.ForEach(p =>
            {
                var company = _companyRepository.All().Where(c => c.CompanyID == p.CompanyID).SingleOrDefault();
                var region  = _regionRepository.All().Where(r => r.RegionID == p.RegionID).SingleOrDefault();
                ShortJobPosting shortPosting = new ShortJobPosting
                {
                    CompanyName        = company.CompanyName,
                    ImagePath          = company.CompanyLogoPath,
                    PostID             = p.PostID,
                    JobTitle           = p.JobTitle,
                    JobPostedDate      = p.JobPostedDate,
                    JobAvailableToDate = p.JobAvailableToDate,
                    RegionName         = p.Region.RegionName
                };
                postingsByRegion.Add(shortPosting);
            });

            return(postingsByRegion);
        }