Ejemplo n.º 1
0
        public ActionResult Increase(IncreaseProductViewModel model)
        {
            if (ModelState.IsValid)
            {
                var entity = ProductManager.FindById(model.Id);
                entity.Remaining = model.Remaining;
                ProductManager.Update(entity);
                ProductManager.Save();

                return RedirectToAction("Index");
            }
            return View(model);
        }
Ejemplo n.º 2
0
 public ActionResult Increase(Guid? id)
 {
     if (id.HasValue)
     {
         var entity = ProductManager.FindById(id.Value);
         var model = new IncreaseProductViewModel
         {
             Id = entity.Id,
             Name = entity.Name,
             ProductCategory = entity.Platform.Name,
             Remaining = entity.Remaining
         };
         return View("Increase", model);
     }
     return RedirectToAction("Index");
 }