Example #1
0
 //
 // GET: /Question/Edit/5
 public ActionResult Edit(int id)
 {
     Models.QuestionModel    model    = new Models.QuestionModel();
     AESDataService.Question question = new AESDataService.Question();
     using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
     {
         question         = client.getQuestion(id);
         model.QuestionId = question.questionId;
         model.Question   = question.theQuestion;
         model.Answer     = question.theAnswer;
     }
     return(View(model));
 }
 //
 // GET: /Question/Edit/5
 public ActionResult Edit(int id)
 {
     Models.QuestionModel model = new Models.QuestionModel();
     AESDataService.Question question = new AESDataService.Question();
     using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
     {
         question = client.getQuestion(id);
         model.QuestionId = question.questionId;
         model.Question = question.theQuestion;
         model.Answer = question.theAnswer;
     }
     return View(model);
 }
Example #3
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                AESDataService.Question question = new AESDataService.Question();
                using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
                {
                    question.theQuestion = Request.Form["theQuestion"];
                    question.theAnswer   = Request.Form["theAnswer"];
                    client.updateQuestion(question);
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                AESDataService.Question question = new AESDataService.Question();
                using (AESDataService.DataServiceClient client = new AESDataService.DataServiceClient())
                {
                    question.theQuestion = Request.Form["theQuestion"];
                    question.theAnswer = Request.Form["theAnswer"];
                    client.updateQuestion(question);
                }

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