Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "ColorID,ColorName")] Color color)
 {
     if (ModelState.IsValid)
     {
         db.Entry(color).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(color));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "OccasionID,OccasionName")] Occasion occasion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(occasion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(occasion));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ShoeID,Name,Photo,ColorID,SeasonID,OccasionID")] Shoe shoe)
 {
     if (ModelState.IsValid)
     {
         db.Entry(shoe).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ColorID    = new SelectList(db.Colors, "ColorID", "ColorName", shoe.ColorID);
     ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "OccasionName", shoe.OccasionID);
     ViewBag.SeasonID   = new SelectList(db.Seasons, "SeasonID", "SeasonName", shoe.SeasonID);
     return(View(shoe));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "OutfitID,TopID,BottomID,ShoeID,AccessoryID")] Outfit outfit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(outfit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AccessoryID = new SelectList(db.Accessories, "AccessoryID", "Name", outfit.AccessoryID);
     ViewBag.BottomID    = new SelectList(db.Bottoms, "BottomID", "Name", outfit.BottomID);
     ViewBag.ShoeID      = new SelectList(db.Shoes, "ShoeID", "Name", outfit.ShoeID);
     ViewBag.TopID       = new SelectList(db.Tops, "TopID", "Name", outfit.TopID);
     return(View(outfit));
 }
Ejemplo n.º 5
0
 public void UpdateItem(Item item)
 {
     context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
 }