diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index d796092..fab0e58 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 6aad6fb..ce5df14 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 925130e..3545a42 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index c7bb033..7f542a6 100644 Binary files a/obj/Debug/compabetov2.csproj.GenerateResource.cache and b/obj/Debug/compabetov2.csproj.GenerateResource.cache differ diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index d796092..fab0e58 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 6aad6fb..ce5df14 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ diff --git a/vender.Designer.cs b/vender.Designer.cs index 037efd3..8043b6f 100644 --- a/vender.Designer.cs +++ b/vender.Designer.cs @@ -96,6 +96,7 @@ this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Size = new System.Drawing.Size(324, 1191); this.flowLayoutPanel2.TabIndex = 11; + this.flowLayoutPanel2.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel2_Paint); // // panel1 // @@ -278,7 +279,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(1371, 750); + this.ClientSize = new System.Drawing.Size(1924, 750); this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox1); this.Controls.Add(this.flowLayoutPanel3); diff --git a/vender.cs b/vender.cs index dba9da8..094ccbd 100644 --- a/vender.cs +++ b/vender.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -98,12 +99,6 @@ namespace compabetov2 btnMenos.FlatStyle = FlatStyle.Flat; btnMenos.FlatAppearance.BorderSize = 0; btnMenos.BackColor = Color.FromArgb(33, 90, 255); - - // Agregar esquinas redondeadas al botón - System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); - gp.AddEllipse(0, 0, btnMenos.Width, btnMenos.Height); - btnMenos.Region = new Region(gp); - btnMenos.Click += new EventHandler(delegate (object sender, EventArgs e) { int numeroContador = int.Parse(contador.Text.ToString()); @@ -139,6 +134,28 @@ namespace compabetov2 int numeroContador = int.Parse(contador.Text.ToString()); contador.Text = (numeroContador + 1).ToString(); total += producto.precion; + + + + + // Obtener información del Label id y precio + int idProducto = int.Parse(id.Text); + decimal precioProducto; + if (decimal.TryParse(precio.Text, NumberStyles.Currency, CultureInfo.CurrentCulture, out precioProducto)) + { + // Generar ticket y agregarlo al flowLayoutPanel2 + GenerarTicket(idProducto, producto.nombre, precioProducto, int.Parse(contador.Text), total); + } + else + { + // Manejar el caso en el que la conversión no sea exitosa + MessageBox.Show("Formato de precio no válido.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + // Generar ticket y agregarlo al flowLayoutPanel2 + GenerarTicket(idProducto, producto.nombre, precioProducto, int.Parse(contador.Text), total); + + // ... (código existente) }); HUD.Controls.Add(btnMenos); @@ -150,8 +167,33 @@ namespace compabetov2 cartas.Add(carta); flowLayoutPanel3.Controls.Add(carta); } + + + + + + } + private void GenerarTicket(int idProducto, string nombreProducto, decimal precio, int cantidad, decimal total) + { + // Crear un nuevo control (puede ser un Label, Panel, etc.) para representar el ticket + Label ticketLabel = new Label(); + ticketLabel.Text = $"ID: {idProducto} | Producto: {nombreProducto} | Precio: ${precio} | Cantidad: {cantidad} | Total: ${total}"; + ticketLabel.BackColor = Color.LightGray; // Puedes ajustar el color de fondo según tu diseño + ticketLabel.AutoSize = true; + + // Agregar el ticket al flowLayoutPanel2 + flowLayoutPanel2.Controls.Add(ticketLabel); + } + + + + + + + + private void getData() { this.productos = service.conseguirProductos(); @@ -194,6 +236,11 @@ namespace compabetov2 menuPrincipal.Show(); this.Dispose(true); } + + private void flowLayoutPanel2_Paint(object sender, PaintEventArgs e) + { + + } } }