Ejemplo n.º 1
0
        public ActionResult AddQuestions(Question[] q)
        {
            foreach (Question q1 in q)
            {
                db.Question.Add(q1);
                db.SaveChanges();

            }
            return RedirectToAction("Index");

            //return View(q);
        }
Ejemplo n.º 2
0
 public ActionResult Edit(Question question)
 {
     if (ModelState.IsValid)
     {
         db.Entry(question).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.SurveyId = new SelectList(db.Survey, "Id", "Name", question.SurveyId);
     return View(question);
 }