예제 #1
0
 public ActionResult Edit(int FlavorId, Treat treat)
 {
     if (FlavorId != 0)
     {
         _db.TreatFlavor.Add(new TreatFlavor()
         {
             FlavorId = FlavorId, TreatId = treat.TreatId
         });
     }
     _db.Entry(treat).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = treat.TreatId }));
 }
        public async Task <ActionResult> Edit(Treat treat)
        {
            var userId      = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var currentUser = await _userManager.FindByIdAsync(userId);

            _db.Entry(treat).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit(Flavor flavor, int TreatId)
 {
     if (TreatId != 0)
     {
         _db.FlavorTreat.Add(new FlavorTreat()
         {
             TreatId = TreatId, FlavorId = flavor.FlavorId
         });
     }
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #4
0
        public async Task <ActionResult> Edit(Flavor flavor, int TreatId)
        {
            if (TreatId != 0)
            {
                var userId      = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
                var currentUser = await _userManager.FindByIdAsync(userId);

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