Subo cambios
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user