Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PostsHistory postsHistory = db.PostsHistories.Find(id);

            db.PostsHistories.Remove(postsHistory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "HistoryId,PostID,Message,ChangedDate,UserId")] PostsHistory postsHistory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(postsHistory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(postsHistory));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "HistoryId,PostID,Message,ChangedDate,UserId")] PostsHistory postsHistory)
        {
            if (ModelState.IsValid)
            {
                db.PostsHistories.Add(postsHistory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(postsHistory));
        }
Beispiel #4
0
        // GET: PostsHistories/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PostsHistory postsHistory = db.PostsHistories.Find(id);

            if (postsHistory == null)
            {
                return(HttpNotFound());
            }
            return(View(postsHistory));
        }