コード例 #1
0
        public List <JobPost> GetJobPosts(int page = 0, int max = 10, int parentId = 0)
        {
            ContentServiceController contentService = new ContentServiceController();
            List <IPublishedContent> contents       = contentService.GetContentListByTypeAndParentId("jobPost", parentId, page, max);

            List <JobPost> jobPostList = new List <JobPost>();

            foreach (var content in contents)
            {
                JobPost jobPost = new JobPost
                {
                    ID              = content.Id,
                    JobDescription  = content.GetPropertyValue("jobDescription").ToString(),
                    NeededSkills    = content.GetPropertyValue("neededSkills").ToString(),
                    ContactEmail    = content.GetPropertyValue("contactEmail").ToString(),
                    NumberOfVacancy = (int)content.GetPropertyValue("numberOfVacancy"),
                    EndDate         = Convert.ToDateTime(content.GetPropertyValue("endDate")),
                    UrlOfPost       = content.GetPropertyValue("urlOfPost").ToString(),
                    PostUmbracoUrl  = content.Url,
                    JobOffer        = content.GetPropertyValue("jobOffer").ToString(),
                    JobOverview     = content.GetPropertyValue("jobOverview").ToString()
                };

                jobPostList.Add(jobPost);
            }


            return(jobPostList);
        }
コード例 #2
0
        public List <Entity> GetEntities(int page = 0, int max = 10, int contentId = 0)
        {
            ContentServiceController contentService = new ContentServiceController();
            List <IPublishedContent> contents       = contentService.GetContentListByTypeAndParentId("entity", contentId, page, max);

            List <Entity> entityList = new List <Entity>();

            foreach (var content in contents)
            {
                Entity entity = new Entity
                {
                    ID              = content.Id,
                    Name            = content.GetPropertyValue("entityName").ToString(),
                    Organization    = content.GetPropertyValue("organizationName").ToString(),
                    EmployeeListUrl = content.Children().First().Url
                };

                entityList.Add(entity);
            }


            return(entityList);
        }
コード例 #3
0
        public List <Position> GetPositions(int page = 0, int max = 10, int parentId = 0)
        {
            ContentServiceController contentService = new ContentServiceController();
            List <IPublishedContent> contents       = contentService.GetContentListByTypeAndParentId("position", parentId, page, max);
            List <Position>          positionList   = new List <Position>();

            foreach (var content in contents)
            {
                Position position = new Position
                {
                    ID             = content.Id,
                    JobPostListUrl = content.Children().First().Url,
                    Name           = content.GetPropertyValue("positionName").ToString(),
                    Description    = content.GetPropertyValue("positionDescription").ToString(),
                    PositionUrl    = content.Url
                };

                positionList.Add(position);
            }


            return(positionList);
        }