Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        // 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));
        }
Exemplo n.º 4
0
        // 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));
        }