Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            putong putong = db.Putongs.Find(id);

            db.Putongs.Remove(putong);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,Content")] putong putong)
 {
     if (ModelState.IsValid)
     {
         db.Entry(putong).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(putong));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "Id,Content")] putong putong)
        {
            if (ModelState.IsValid)
            {
                db.Putongs.Add(putong);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(putong));
        }
Beispiel #4
0
        // GET: putongs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            putong putong = db.Putongs.Find(id);

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