示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AvatarNote avatarNote = db.AvatarNotes.Find(id);

            db.AvatarNotes.Remove(avatarNote);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        // 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));
        }
示例#4
0
        // 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));
        }