// GET: /Job/
        public async Task<ViewResult> Index()
        {
            IEnumerable<Job> jobs = null;

            using (var client = new JobServiceClient())
            {
                jobs = await client.GetJobs();
            }

            return View(jobs);
        }
Example #2
0
        public IEnumerable<JobDAO> GetJobs()
        {
            JobServiceClient client = new JobServiceClient();

            try
            {
                IEnumerable<JobDAO> result = client.GetJobs();
                return result;
            }
            catch (FaultException<KaskServiceException> e)
            {
                throw new HttpException(e.Message);
            }
        }
        // GET: /OpenJob/Create
        public async Task<ActionResult> Create()
        {
            IEnumerable<Job> jobs = null;
            using (var client = new JobServiceClient())
            {
                jobs = await client.GetJobs();
            }

            var TitleList = new List<string>();
            var TitlesQuery = from j in jobs select j.Position;

            TitleList.AddRange(TitlesQuery);
            var sl = new SelectList(TitleList);

            ViewBag.JobTitles = sl;
            ViewBag.Jobs = jobs;

            return View();
        }