public ActionResult DeleteConfirmed(int id) { Knit knit = db.knits.Find(id); db.knits.Remove(knit); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "KnitId,KnitType,Remarks")] Knit knit) { if (ModelState.IsValid) { db.Entry(knit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(knit)); }
public ActionResult Create([Bind(Include = "KnitId,KnitType,Remarks")] Knit knit) { if (ModelState.IsValid) { db.knits.Add(knit); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(knit)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Knit knit = db.knits.Find(id); if (knit == null) { return(HttpNotFound()); } return(View(knit)); }