예제 #1
0
        //[ValidateAntiForgeryToken]
        public ActionResult Create([Bind(Include = "subStepQuestionID,questionID,subStep_ID")] qSub_Step_Question qSub_Step_Question, FormCollection fc)
        {
            int _ss_id = 0;

            if (ModelState.IsValid)
            {
                _ss_id = Convert.ToInt16(fc["subStepID"]);

                if (_ss_id != null && _ss_id > 0)
                {
                    qSub_Step_Question.subStep_ID = _ss_id;
                    qSub_Step_Question.Active     = true;
                    db.qSub_Step_Question.Add(qSub_Step_Question);
                    db.SaveChanges();
                    return(RedirectToAction("Index", new { ss_id = _ss_id }));
                }
                else
                {
                    db.qSub_Step_Question.Add(qSub_Step_Question);
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
            }

            ViewBag.questionID = new SelectList(db.qQuestions, "questionID", "Name", qSub_Step_Question.questionID);
            ViewBag.subStep_ID = new SelectList(db.Sub_Step, "SubStep_ID", "Name", qSub_Step_Question.subStep_ID);
            return(View("Index/" + _ss_id));
        }
예제 #2
0
        //[ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(int id)
        {
            qSub_Step_Question qSub_Step_Question = db.qSub_Step_Question.Find(id);

            db.qSub_Step_Question.Remove(qSub_Step_Question);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 //[ValidateAntiForgeryToken]
 public ActionResult Edit([Bind(Include = "subStepQuestionID,questionID,subStep_ID,Active")] qSub_Step_Question qSub_Step_Question)
 {
     if (ModelState.IsValid)
     {
         db.Entry(qSub_Step_Question).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.questionID = new SelectList(db.qQuestions, "questionID", "Name", qSub_Step_Question.questionID);
     ViewBag.subStep_ID = new SelectList(db.Sub_Step, "SubStep_ID", "Name", qSub_Step_Question.subStep_ID);
     return(View(qSub_Step_Question));
 }
예제 #4
0
        // GET: qSub_Step_Question/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            qSub_Step_Question qSub_Step_Question = db.qSub_Step_Question.Find(id);

            if (qSub_Step_Question == null)
            {
                return(HttpNotFound());
            }
            return(View(qSub_Step_Question));
        }
예제 #5
0
        // GET: qSub_Step_Question/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            qSub_Step_Question qSub_Step_Question = db.qSub_Step_Question.Find(id);

            if (qSub_Step_Question == null)
            {
                return(HttpNotFound());
            }
            ViewBag.questionID = new SelectList(db.qQuestions, "questionID", "Name", qSub_Step_Question.questionID);
            ViewBag.subStep_ID = new SelectList(db.Sub_Step, "SubStep_ID", "Name", qSub_Step_Question.subStep_ID);
            return(View(qSub_Step_Question));
        }