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