public ActionResult Edit([Bind(Include = "ItemSubtypeID,ItemSubtype1,ItemTypeID")] ItemSubtype itemSubtype) { if (ModelState.IsValid) { db.Entry(itemSubtype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ItemTypeID = new SelectList(db.ItemTypes, "ItemTypeID", "ItemType1", itemSubtype.ItemTypeID); return(View(itemSubtype)); }
public ActionResult Create([Bind(Include = "ItemSubtypeID,ItemSubtype1,ItemTypeID")] ItemSubtype itemSubtype) { if (ModelState.IsValid) { itemSubtype.ItemSubtypeID = Guid.NewGuid(); db.ItemSubtypes.Add(itemSubtype); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ItemTypeID = new SelectList(db.ItemTypes, "ItemTypeID", "ItemType1", itemSubtype.ItemTypeID); return(View(itemSubtype)); }
// GET: Manager/ItemSubtypes/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemSubtype itemSubtype = db.ItemSubtypes.Find(id); if (itemSubtype == null) { return(HttpNotFound()); } return(View(itemSubtype)); }
// GET: Manager/ItemSubtypes/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemSubtype itemSubtype = db.ItemSubtypes.Find(id); if (itemSubtype == null) { return(HttpNotFound()); } ViewBag.ItemTypeID = new SelectList(db.ItemTypes, "ItemTypeID", "ItemType1", itemSubtype.ItemTypeID); return(View(itemSubtype)); }