public ActionResult DeleteConfirmed(int id) { KWLentry kwlentry = db.KWLentries.Find(id); db.KWLentries.Remove(kwlentry); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,UserId")] KWLentry kwlentry) { if (ModelState.IsValid) { db.Entry(kwlentry).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "Id", "Name", kwlentry.UserId); return(View(kwlentry)); }
public ActionResult Create([Bind(Include = "Id,UserId")] KWLentry kwlentry) { if (ModelState.IsValid) { db.KWLentries.Add(kwlentry); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "Id", "Name", kwlentry.UserId); return(View(kwlentry)); }
// GET: /QuestionsExample/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KWLentry kwlentry = db.KWLentries.Find(id); if (kwlentry == null) { return(HttpNotFound()); } return(View(kwlentry)); }
// GET: /QuestionsExample/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } KWLentry kwlentry = db.KWLentries.Find(id); if (kwlentry == null) { return(HttpNotFound()); } ViewBag.UserId = new SelectList(db.Users, "Id", "Name", kwlentry.UserId); return(View(kwlentry)); }