diff --git a/admin/editar.Designer.cs b/admin/editar.Designer.cs index 1be877d..c4bb429 100644 --- a/admin/editar.Designer.cs +++ b/admin/editar.Designer.cs @@ -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; diff --git a/admin/editar.cs b/admin/editar.cs index 6c2ab28..fe3fc85 100644 --- a/admin/editar.cs +++ b/admin/editar.cs @@ -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(); + } } } diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index ca772bd..9c7d4a5 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 db30f66..d443aab 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 0ae98c7..9c5cbda 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 ca772bd..9c7d4a5 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 db30f66..d443aab 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ