public ActionResult DeleteConfirmed(int id) { ShootingDrill shootingDrill = db.ShootingDrills.Find(id); db.ShootingDrills.Remove(shootingDrill); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name")] ShootingDrill shootingDrill) { if (ModelState.IsValid) { db.Entry(shootingDrill).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shootingDrill)); }
public ActionResult Create([Bind(Include = "ID,Name")] ShootingDrill shootingDrill) { if (ModelState.IsValid) { db.ShootingDrills.Add(shootingDrill); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shootingDrill)); }
// GET: ShootingDrills/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShootingDrill shootingDrill = db.ShootingDrills.Find(id); if (shootingDrill == null) { return(HttpNotFound()); } return(View(shootingDrill)); }