public ActionResult DeleteConfirmed(int id) { AssessQuestionStorage assessQuestionStorage = db.AssessQuestionStorage.Find(id); db.AssessQuestionStorage.Remove(assessQuestionStorage); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "QuestionID,SectionID,QuestionTypeID,Question")] AssessQuestionStorage assessQuestionStorage) { if (ModelState.IsValid) { db.Entry(assessQuestionStorage).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(assessQuestionStorage)); }
public ActionResult Create([Bind(Include = "QuestionID,SectionID,QuestionTypeID,Question")] AssessQuestionStorage assessQuestionStorage) { if (ModelState.IsValid) { db.AssessQuestionStorage.Add(assessQuestionStorage); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(assessQuestionStorage)); }
public ActionResult SaveQuestions(AssessQuestionStorage AssessQuestionStorage) { AssessQuestionStorage Sect = new AssessQuestionStorage(); Sect.SectionID = AssessQuestionStorage.SectionID; Sect.Question = AssessQuestionStorage.Question; Sect.QuestionTypeID = AssessQuestionStorage.QuestionTypeID; db.AssessQuestionStorage.Add(Sect); db.SaveChanges(); return(Json(AssessQuestionStorage, JsonRequestBehavior.AllowGet)); }
// GET: AssessQuestionStorages/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssessQuestionStorage assessQuestionStorage = db.AssessQuestionStorage.Find(id); if (assessQuestionStorage == null) { return(HttpNotFound()); } return(View(assessQuestionStorage)); }
public ActionResult DeleteQuestion(AssessQuestionStorage AssessQuestionStorage) { if (db.AssessMultipleQuestion.Any(x => x.QuestionID == AssessQuestionStorage.QuestionID)) { int umber = 1; return(Json(umber.ToString(), JsonRequestBehavior.AllowGet)); } else { AssessQuestionStorage QuestionAssess = db.AssessQuestionStorage.Find(AssessQuestionStorage.QuestionID); db.AssessQuestionStorage.Remove(QuestionAssess); db.SaveChanges(); return(Json(QuestionAssess, JsonRequestBehavior.AllowGet)); } }