public ActionResult DeleteConfirmed(int id) { AvatarNote avatarNote = db.AvatarNotes.Find(id); db.AvatarNotes.Remove(avatarNote); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,AvatarID,Content,DateCreated,DateModified")] AvatarNote avatarNote) { if (ModelState.IsValid) { db.Entry(avatarNote).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AvatarID = new SelectList(db.Avatars, "ID", "LastName", avatarNote.AvatarID); return(View(avatarNote)); }
// GET: AvatarNote/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AvatarNote avatarNote = db.AvatarNotes.Find(id); if (avatarNote == null) { return(HttpNotFound()); } return(View(avatarNote)); }
// GET: AvatarNote/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AvatarNote avatarNote = db.AvatarNotes.Find(id); if (avatarNote == null) { return(HttpNotFound()); } ViewBag.AvatarID = new SelectList(db.Avatars, "ID", "LastName", avatarNote.AvatarID); return(View(avatarNote)); }