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