コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PunshmentAction punshmentAction = db.PunshmentActions.Find(id);

            //db.PunshmentActions.Remove(punshmentAction);
            punshmentAction.Delete = true;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "index,Title,Delete,IPAddress,Longitude,Latitude")] PunshmentAction punshmentAction)
 {
     if (ModelState.IsValid)
     {
         db.Entry(punshmentAction).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(punshmentAction));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "index,Title,Delete,IPAddress,Longitude,Latitude")] PunshmentAction punshmentAction)
        {
            if (ModelState.IsValid)
            {
                db.PunshmentActions.Add(punshmentAction);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(punshmentAction));
        }
コード例 #4
0
        // GET: Baby/PunshmentActions/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PunshmentAction punshmentAction = db.PunshmentActions.Find(id);

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