示例#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));
 }
示例#2
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);
 }
示例#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());
            }
        }
示例#4
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();
            }
        }