public ActionResult Edit(int TreatId, Flavor flavor)
 {
     if (TreatId != 0)
     {
         _db.TreatFlavor.Add(new TreatFlavor {
             TreatId = TreatId, FlavorId = flavor.FlavorId
         });
     }
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #2
0
 public ActionResult Edit(Treat treat, int FlavorId)
 {
     if (FlavorId != 0)
     {
         _db.TreatFlavor.Add(new TreatFlavor()
         {
             FlavorId = FlavorId, TreatId = treat.TreatId
         });
     }
     _db.Entry(treat).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(Flavor flavor)
 {
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }