public ActionResult DeleteConfirmed(int id) { PunshmentAction punshmentAction = db.PunshmentActions.Find(id); //db.PunshmentActions.Remove(punshmentAction); punshmentAction.Delete = true; db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }