public IActionResult Remove(int id) { Session s = new Session(); LineaCarro lc = new LineaCarro(); lc.IdLinea = id; s.delete(lc); return(RedirectToAction("Carro", "Carro")); }
public IActionResult Increase(int id, int cantidad) { cantidad++; Session s = new Session(); LineaCarro lc = new LineaCarro(); lc.IdLinea = id; s.get(lc); lc.Cantidad = cantidad; s.update(lc); return(RedirectToAction("Carro", "Carro")); }
public IActionResult Decrease(int id, int cantidad) { cantidad--; if (cantidad == 0) { return(RedirectToAction("Remove", "Carro", new { id = id })); } Session s = new Session(); LineaCarro lc = new LineaCarro(); lc.IdLinea = id; s.get(lc); lc.Cantidad = cantidad; s.update(lc); return(RedirectToAction("Carro", "Carro")); }