public ActionResult DeleteConfirmed(int id) { tblItemCategory tblItemCategory = db.tblItemCategories.Find(id); db.tblItemCategories.Remove(tblItemCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit2([Bind(Include = "ItemCategoryID,ItemID,CategoryID,Status,StatusBeschrijving")] tblItemCategory tblItemCategory) { if (ModelState.IsValid) { db.Entry(tblItemCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.tblCategories, "CategoryID", "CategoryName", tblItemCategory.CategoryID); ViewBag.ItemID = new SelectList(db.tblItems, "ItemID", "ItemName", tblItemCategory.ItemID); return(View(tblItemCategory)); }
public ActionResult Create([Bind(Include = "ItemCategoryID,ItemID,CategoryID")] tblItemCategory tblItemCategory) { tblItemCategory.Status = "Te Accorderen creatie"; if (ModelState.IsValid) { db.tblItemCategories.Add(tblItemCategory); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.tblCategories, "CategoryID", "CategoryName", tblItemCategory.CategoryID); ViewBag.ItemID = new SelectList(db.tblItems, "ItemID", "ItemName", tblItemCategory.ItemID); return(View(tblItemCategory)); }
// GET: tblItemCategories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblItemCategory tblItemCategory = db.tblItemCategories.Find(id); if (tblItemCategory == null) { return(HttpNotFound()); } return(View(tblItemCategory)); }
// GET: tblItemCategories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblItemCategory tblItemCategory = db.tblItemCategories.Find(id); if (tblItemCategory == null) { return(HttpNotFound()); } ViewBag.CategoryID = new SelectList(db.tblCategories, "CategoryID", "CategoryName", tblItemCategory.CategoryID); ViewBag.ItemID = new SelectList(db.tblItems, "ItemID", "ItemName", tblItemCategory.ItemID); return(View(tblItemCategory)); }