예제 #1
0
        //
        // GET: /Position/Edit/5
        public async Task <ActionResult> Edit(int id)
        {
            AESManagement.Models.PositionModel model    = new Models.PositionModel();
            AESDataService.Position            position = new AESDataService.Position();
            using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
            {
                position = await client.getPositionAsync(id);

                model.Id           = position.positionId;
                model.Title        = position.title;
                model.Description  = position.description;
                model.Education    = position.education;
                model.Requirements = position.requirements;
                model.Pay          = position.pay;
            }
            return(View(model));
        }
예제 #2
0
        public async Task <ActionResult> Create(FormCollection collection)
        {
            try
            {
                AESDataService.Position position = new AESDataService.Position();
                using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
                {
                    position.title        = Request.Form["title"];
                    position.education    = Request.Form["education"];
                    position.description  = Request.Form["description"];
                    position.requirements = Request.Form["requirements"];
                    position.pay          = Request.Form["pay"];
                    await client.updatePositionAsync(position);
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }