editar producto funcionando sin el boton de confirmar funcionando

This commit is contained in:
carlos
2024-06-19 17:54:56 -06:00
parent a445d3cc9e
commit e8f4217415
7 changed files with 26 additions and 10 deletions
+9 -8
View File
@@ -43,10 +43,10 @@
// txtNombre
//
this.txtNombre.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtNombre.Location = new System.Drawing.Point(333, 209);
this.txtNombre.Location = new System.Drawing.Point(240, 210);
this.txtNombre.Margin = new System.Windows.Forms.Padding(4);
this.txtNombre.Name = "txtNombre";
this.txtNombre.Size = new System.Drawing.Size(231, 30);
this.txtNombre.Size = new System.Drawing.Size(399, 30);
this.txtNombre.TabIndex = 5;
//
// label1
@@ -55,7 +55,7 @@
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(326, 165);
this.label1.Location = new System.Drawing.Point(235, 168);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(107, 29);
@@ -65,10 +65,10 @@
// txtPrecio
//
this.txtPrecio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtPrecio.Location = new System.Drawing.Point(333, 299);
this.txtPrecio.Location = new System.Drawing.Point(240, 299);
this.txtPrecio.Margin = new System.Windows.Forms.Padding(4);
this.txtPrecio.Name = "txtPrecio";
this.txtPrecio.Size = new System.Drawing.Size(231, 30);
this.txtPrecio.Size = new System.Drawing.Size(399, 30);
this.txtPrecio.TabIndex = 7;
//
// label2
@@ -77,7 +77,7 @@
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(326, 255);
this.label2.Location = new System.Drawing.Point(235, 256);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(89, 29);
@@ -90,7 +90,7 @@
this.lbImg.BackColor = System.Drawing.Color.Transparent;
this.lbImg.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbImg.ForeColor = System.Drawing.Color.Transparent;
this.lbImg.Location = new System.Drawing.Point(326, 344);
this.lbImg.Location = new System.Drawing.Point(350, 359);
this.lbImg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbImg.Name = "lbImg";
this.lbImg.Size = new System.Drawing.Size(99, 29);
@@ -119,11 +119,12 @@
this.pictureBox1.Size = new System.Drawing.Size(100, 69);
this.pictureBox1.TabIndex = 28;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.Location = new System.Drawing.Point(333, 388);
this.button1.Location = new System.Drawing.Point(240, 353);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(103, 46);
this.button1.TabIndex = 30;
+17 -2
View File
@@ -18,12 +18,15 @@ namespace compabetov2.admin
private Producto producto;
private crud ventanaPadre;
private string imagePath;
public editar (Producto producto, crud ventanaPadre)
public editar (Producto producto, crud ventanaPadre)
{
this.producto = producto;
this.ventanaPadre = ventanaPadre;
imagePath = Path.Combine(Application.StartupPath, "Resources", producto.img);
InitializeComponent();
cargarInto();
}
private void button1_Click(object sender, EventArgs e)
@@ -40,6 +43,13 @@ namespace compabetov2.admin
}
}
private void cargarInto()
{
txtNombre.Text = producto.nombre;
txtPrecio.Text = producto.precion.ToString();
lbImg.Text = $"Imagen: {Path.GetFileName(imagePath)}"; ;
}
private void editar_Load(object sender, EventArgs e)
{
@@ -49,5 +59,10 @@ namespace compabetov2.admin
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
Close();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.