errores menores arreglados

This commit is contained in:
carlos
2024-02-15 01:50:15 -06:00
parent dfbb52c78a
commit 505f68b1a4
5 changed files with 3 additions and 3 deletions
+3 -3
View File
@@ -179,7 +179,7 @@ namespace compabetov2
decimal precioProducto = producto.precio; decimal precioProducto = producto.precio;
// Restar al ticket existente si ya se agregó // Restar al ticket existente si ya se agregó
carrito[indexCarrito].cantidad = int.Parse(contador.Text); carrito[indexCarrito].cantidad -= 1;
if (carrito[indexCarrito].cantidad == 0) if (carrito[indexCarrito].cantidad == 0)
{ {
carrito.RemoveAt(indexCarrito); carrito.RemoveAt(indexCarrito);
@@ -223,11 +223,11 @@ namespace compabetov2
int indexCarrito = estaEnCarrito(producto.nombre); int indexCarrito = estaEnCarrito(producto.nombre);
if (indexCarrito != -1) if (indexCarrito != -1)
{ {
carrito[indexCarrito].cantidad = int.Parse(contador.Text); carrito[indexCarrito].cantidad += 1;
} }
else else
{ {
carrito.Add(new DetalleVentaModel(int.Parse(contador.Text), producto)); carrito.Add(new DetalleVentaModel(1, producto));
} }
GenerarTicket(idProducto, producto.nombre, producto.precio, int.Parse(contador.Text), total, GenerarTicket(idProducto, producto.nombre, producto.precio, int.Parse(contador.Text), total,
Path.Combine(Application.StartupPath, "Resources", producto.img)); Path.Combine(Application.StartupPath, "Resources", producto.img));
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.