public ActionResult DeleteConfirmed(int id) { QuestionTypeAsk questionTypeAsk = db.QuestionTypeAsks.Find(id); db.QuestionTypeAsks.Remove(questionTypeAsk); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,QuestionTypeId,AskId")] QuestionTypeAsk questionTypeAsk) { if (ModelState.IsValid) { db.Entry(questionTypeAsk).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AskId = new SelectList(db.Asks, "Id", "title", questionTypeAsk.AskId); ViewBag.QuestionTypeId = new SelectList(db.QuestionTypes, "Id", "Name", questionTypeAsk.QuestionTypeId); return(View(questionTypeAsk)); }
// GET: QuestionTypeAsks/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuestionTypeAsk questionTypeAsk = db.QuestionTypeAsks.Find(id); if (questionTypeAsk == null) { return(HttpNotFound()); } return(View(questionTypeAsk)); }
// GET: QuestionTypeAsks/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuestionTypeAsk questionTypeAsk = db.QuestionTypeAsks.Find(id); if (questionTypeAsk == null) { return(HttpNotFound()); } ViewBag.AskId = new SelectList(db.Asks, "Id", "title", questionTypeAsk.AskId); ViewBag.QuestionTypeId = new SelectList(db.QuestionTypes, "Id", "Name", questionTypeAsk.QuestionTypeId); return(View(questionTypeAsk)); }