diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 60291aa..8e670a6 100644 Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb index 07b203c..f178e35 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index b1fcf0d..332d002 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index 60291aa..8e670a6 100644 Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb index 07b203c..f178e35 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ diff --git a/vender.cs b/vender.cs index 60b2bbc..36f753c 100644 --- a/vender.cs +++ b/vender.cs @@ -200,22 +200,25 @@ namespace compabetov2 { contador_saltar_2_vueltas++; continue; - } TableLayoutPanel panelProducto = item as TableLayoutPanel; TableLayoutPanel panelInfo = panelProducto.Controls[1] as TableLayoutPanel; Label lbnombre = panelInfo.Controls[0] as Label; string textoLb = lbnombre.Text; - string[] cadenas = textoLb.Split(' '); - if (cadenas[1].Equals(nombreProducto)) + string[] cadenas = textoLb.Split(':'); + string cadena = cadenas[1].Remove(0, 1); + + if (cadena.Equals(nombreProducto)) { + existeProducto=true; - Label Lbcantidad = panelInfo.Controls[0] as Label; - Label Lbtotal = panelInfo.Controls[0] as Label; + Label Lbcantidad = panelInfo.Controls[2] as Label; + Label Lbtotal = panelInfo.Controls[3] as Label; string textcantidad = Lbcantidad.Text; - int NuevaCantiad = int.Parse(textcantidad.Split(' ')[1]); - string textoTotal = Lbtotal.Text; - int NuevoTotal = int.Parse(textoTotal.Split('$')[1]) * cantidad; + string[] cantidadCadenas = textcantidad.Split(' '); + int NuevaCantiad = int.Parse(cantidadCadenas[1]) + 1; + + int NuevoTotal = (int)(NuevaCantiad * precio); Lbcantidad.Text = $"Cantidad: {NuevaCantiad}"; Lbtotal.Text = $"Total: ${NuevoTotal}"; @@ -245,18 +248,22 @@ namespace compabetov2 Label lbNombre = new Label(); lbNombre.Dock = DockStyle.Fill; lbNombre.Text = $"producto: {nombreProducto}"; + lbNombre.ForeColor = Color.White; Label lbPrecio = new Label(); lbPrecio.Dock = DockStyle.Fill; lbPrecio.Text = $"Precio: ${precio}"; + lbPrecio.ForeColor = Color.White; Label lbCantidad = new Label(); lbCantidad.Dock = DockStyle.Fill; lbCantidad.Text = $"Cantidad: {cantidad}"; + lbCantidad.ForeColor = Color.White; Label lbTotal = new Label(); lbTotal.Dock = DockStyle.Fill; lbTotal.Text = $"Total: ${cantidad * precio}"; + lbTotal.ForeColor = Color.White; infoTicket.Controls.Add(lbNombre, 0, 0); infoTicket.Controls.Add(lbPrecio, 0, 1);