public QuestionnaireDetailRecord(QCategory QCategory, Question Question, SelectList Answers, QType QType, int Ordinal) { this.QCategory = QCategory; this.Question = Question; this.Answers = Answers; this.QType = QType; this.Ordinal = Ordinal; }
public ActionResult Edit(QCategory qcategory) { if (ModelState.IsValid) { _db.Entry(qcategory).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(qcategory)); }
// // GET: /QCategory/Edit/5 public ActionResult Edit(int id = 0) { QCategory qcategory = _db.QCategories.Find(id); if (qcategory == null) { return(HttpNotFound()); } return(View(qcategory)); }
public QuestionnaireAppRecord(QCategory QCategory, QuestionnaireQuestion QuestionnaireQuestion, Question Question, SelectList Answers, QType QType, int Ordinal, int SubOrdinal, string Response) { this.QCategory = QCategory; this.QuestionnaireQuestion = QuestionnaireQuestion; this.Question = Question; this.Answers = Answers; this.QType = QType; this.Ordinal = Ordinal; this.SubOrdinal = SubOrdinal; this.Response = Response; }
public ActionResult Create(QCategory qcategory) { if (ModelState.IsValid) { _db.QCategories.Add(qcategory); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(qcategory)); }
public ActionResult DeleteConfirmed(int id) { QCategory qcategory = _db.QCategories.Find(id); try { _db.QCategories.Remove(qcategory); _db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { return(RedirectToAction("Delete", "QCategory", new { id, err = 1 })); } }
// // GET: /QCategory/Delete/5 public ActionResult Delete(int id = 0, int err = 0) { if (err != 0) { ViewBag.message = "The section is still being used by a questionnaire and cannot be deleted."; } else { ViewBag.message = ""; } QCategory qcategory = _db.QCategories.Find(id); if (qcategory == null) { return(HttpNotFound()); } return(View(qcategory)); }