Subo cambios

This commit is contained in:
Michael Robles
2024-06-30 08:33:24 -07:00
parent bd5573527d
commit 13f578865b
28 changed files with 144 additions and 26 deletions
+3 -7
View File
@@ -25,13 +25,11 @@ namespace compabetov2.admin
private void pictureBox2_Click(object sender, EventArgs e)
{
try
{
string nombre = txtNombre.Text;
decimal precio = 0;
//valida que se haya colocado alguna imagen
if (!imagePath.Equals("")) {
Producto producto = new Producto(-1, nombre, "", precio, imagePath, 0);
Producto producto = new Producto(-1, nombre, "", precio, Path.GetFileName(imagePath), 0);
if (service.insertarProducto(producto))
{
string destinationFolder = Path.Combine(Application.StartupPath, "Resources");
@@ -40,6 +38,7 @@ namespace compabetov2.admin
Close();
ventanaPadre.llenarLayout();
}
}
else
@@ -47,10 +46,7 @@ namespace compabetov2.admin
MessageBox.Show("Por favor seleccione alguna imagen", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch {
MessageBox.Show("Por favor introduzca un precio valido", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button1_Click(object sender, EventArgs e)