Ejemplo n.º 1
0
 public ActionResult Edit(Flavor flavor, int TreatId)
 {
     if (TreatId != 0)
     {
         _db.TreatFlavor.Add(new TreatFlavor()
         {
             TreatId = TreatId, FlavorId = flavor.FlavorId
         });
     }
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(Patron patron, int FlavorId)
 {
     if (FlavorId != 0)
     {
         _db.Checkout.Add(new Checkout()
         {
             FlavorId = FlavorId, PatronId = patron.PatronId
         });
     }
     _db.Entry(patron).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 3
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"));
 }
Ejemplo n.º 4
0
 public ActionResult Edit(Flavor flavor, int TreatId, int joinId)
 {
     if (TreatId != 0)
     {
         var joinEntry = _db.FlavorTreat.FirstOrDefault(entry => entry.FlavorTreatId == joinId);
         if (joinEntry != null)
         {
             _db.FlavorTreat.Remove(joinEntry);
         }
         _db.FlavorTreat.Add(new FlavorTreat()
         {
             TreatId = TreatId, FlavorId = flavor.FlavorId
         });
     }
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(Treat treat)
 {
     _db.Entry(treat).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }