diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 7d92b74..96f4723 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 2d7ea08..eca5f4f 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/compabetov2.csproj b/compabetov2.csproj index 051a0a4..b787e4c 100644 --- a/compabetov2.csproj +++ b/compabetov2.csproj @@ -297,7 +297,7 @@ - + diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 6fd8f5d..c4d7667 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index 314837d..1367df0 100644 Binary files a/obj/Debug/compabetov2.csproj.AssemblyReference.cache and b/obj/Debug/compabetov2.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache index 8f1bb2d..339d4f0 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -424f6d4f8bcbc47e89c98d2fa689cb77dffd9f6b5116717e9e8dca5ece3777d7 +953cb31f9b6e74dde952aba09707a9add648ded1 diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 2b14cea..56f4122 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 7d92b74..f9cc898 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 2d7ea08..3b3a892 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 8043b6f..e09daa2 100644 --- a/vender.Designer.cs +++ b/vender.Designer.cs @@ -49,6 +49,8 @@ this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.labeltotal = new System.Windows.Forms.Label(); this.flowLayoutPanel2.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit(); @@ -91,6 +93,8 @@ // this.flowLayoutPanel2.BackgroundImage = global::compabetov2.Properties.Resources.rec; this.flowLayoutPanel2.Controls.Add(this.panel1); + this.flowLayoutPanel2.Controls.Add(this.label1); + this.flowLayoutPanel2.Controls.Add(this.labeltotal); this.flowLayoutPanel2.Location = new System.Drawing.Point(1605, -1); this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; @@ -274,6 +278,30 @@ this.textBox2.Size = new System.Drawing.Size(399, 36); this.textBox2.TabIndex = 16; // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F); + this.label1.ForeColor = System.Drawing.Color.AliceBlue; + this.label1.Location = new System.Drawing.Point(3, 267); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(102, 39); + this.label1.TabIndex = 17; + this.label1.Text = "Total:"; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // labeltotal + // + this.labeltotal.AutoSize = true; + this.labeltotal.BackColor = System.Drawing.Color.Transparent; + this.labeltotal.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F); + this.labeltotal.ForeColor = System.Drawing.Color.AliceBlue; + this.labeltotal.Location = new System.Drawing.Point(111, 267); + this.labeltotal.Name = "labeltotal"; + this.labeltotal.Size = new System.Drawing.Size(0, 39); + this.labeltotal.TabIndex = 18; + // // vender // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -293,6 +321,7 @@ this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.vender_Load); this.flowLayoutPanel2.ResumeLayout(false); + this.flowLayoutPanel2.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit(); @@ -327,5 +356,7 @@ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label labeltotal; } } \ No newline at end of file diff --git a/vender.cs b/vender.cs index 6d12471..1255e1d 100644 --- a/vender.cs +++ b/vender.cs @@ -27,6 +27,7 @@ namespace compabetov2 private List productos; private List cartas = new List(); private decimal total = 0; + private Label ticketLabel; @@ -52,13 +53,20 @@ namespace compabetov2 carta.Width = 200; carta.Height = 300; - PictureBox pic = new PictureBox(); - pic.Dock = DockStyle.Fill; - pic.SizeMode = PictureBoxSizeMode.Zoom; - string rutaImg = Path.Combine(Application.StartupPath, "Resources", producto.img); - pic.Image = Image.FromFile(rutaImg); - pic.BackgroundImageLayout = ImageLayout.Stretch; - pic.Tag = producto.idProducto; + PictureBox pic = new PictureBox(); + pic.Dock = DockStyle.Fill; + pic.SizeMode = PictureBoxSizeMode.Zoom; + string rutaImg = Path.Combine(Application.StartupPath, "Resources", producto.img); + pic.Image = Image.FromFile(rutaImg);//hay error aquí + pic.BackgroundImageLayout = ImageLayout.Stretch; + pic.Tag = producto.idProducto; + + + + + + + Label id = new Label(); id.Text = producto.idProducto.ToString(); @@ -138,11 +146,11 @@ namespace compabetov2 total += producto.precion; - + // Obtener información del Label id y precio int idProducto = int.Parse(id.Text); - decimal precioProducto = producto.precion; + decimal precioProducto = producto.precion; if (decimal.TryParse(precio.Text, NumberStyles.Currency, CultureInfo.CurrentCulture, out precioProducto)) { // Generar ticket y agregarlo al flowLayoutPanel2 @@ -157,7 +165,7 @@ namespace compabetov2 // Generar ticket y agregarlo al flowLayoutPanel2 GenerarTicket(idProducto, producto.nombre, precioProducto, int.Parse(contador.Text), total); - // ... (código existente) + }); HUD.Controls.Add(btnMenos); @@ -168,12 +176,15 @@ namespace compabetov2 carta.Controls.Add(HUD, 0, 1); cartas.Add(carta); flowLayoutPanel3.Controls.Add(carta); + + } - - - + + + + } @@ -182,8 +193,9 @@ namespace compabetov2 // 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; + labeltotal.Text = total.ToString(); // Agregar el ticket al flowLayoutPanel2 flowLayoutPanel2.Controls.Add(ticketLabel); @@ -196,6 +208,7 @@ namespace compabetov2 + private void getData() { this.productos = service.conseguirProductos(); @@ -243,6 +256,11 @@ namespace compabetov2 { } + + private void label1_Click(object sender, EventArgs e) + { + + } } }