public ActionResult DeleteConfirmed(int id) { fibre fibre = db.fibres.Find(id); db.fibres.Remove(fibre); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "FiberId,Name,Category,Picture1,Description,Advantages,Disadvantages,Picture2")] fibre fibre) { if (ModelState.IsValid) { db.Entry(fibre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fibre)); }
public ActionResult Create([Bind(Include = "FiberId,Name,Category,Picture1,Description,Advantages,Disadvantages,Picture2")] fibre fibre) { if (ModelState.IsValid) { db.fibres.Add(fibre); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fibre)); }
// GET: Home/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } fibre fibre = db.fibres.Find(id); if (fibre == null) { return(HttpNotFound()); } return(View(fibre)); }