public void BorrarItemCarrito(int cliid, int proid) { ClienteDAO clidao = new ClienteDAO(); if (clidao.ExisteCliente(cliid)) { ItemCarritoDAO itcdao = new ItemCarritoDAO(); if (itcdao.ExisteItemCarrito(cliid, proid)) { itcdao.AgregarItemCarrito(cliid, proid); } } else { throw new ClienteNoExisteException("No existe un cliente con ese id"); } }
//metodos de item carrito public void AgregarItemCarrito(int cliid, ItemCarritoInsVO item) { ClienteDAO clidao = new ClienteDAO(); if (clidao.ExisteCliente(cliid)) { ItemCarritoDAO itcdao = new ItemCarritoDAO(); if (itcdao.ExisteItemCarrito(cliid, item.IdProducto)) { itcdao.AgregarItemCarrito(cliid, item.IdProducto); } else { itcdao.InsertarItemCarrito(item); } } else { throw new ClienteNoExisteException("No existe un cliente con ese id"); } }