error de la imagen en productos solucionada
This commit is contained in:
@@ -38,7 +38,7 @@ namespace compabetov2.admin
|
||||
txtNombre.Text,
|
||||
Decimal.Parse(txtPrecio.Text),
|
||||
int.Parse(txtCantidad.Text),
|
||||
imagePath,
|
||||
Path.GetFileName(imagePath),
|
||||
producto.idProducto,
|
||||
Decimal.Parse(txtPrecioCompra.Text)
|
||||
);
|
||||
|
||||
@@ -25,8 +25,6 @@ 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
|
||||
@@ -36,12 +34,11 @@ namespace compabetov2.admin
|
||||
{
|
||||
string destinationFolder = Path.Combine(Application.StartupPath, "Resources");
|
||||
string destinationFile = Path.Combine(destinationFolder, Path.GetFileName(imagePath));
|
||||
MessageBox.Show($"destinationFile: {destinationFile}");
|
||||
MessageBox.Show($"destinationFolder: {destinationFolder}");
|
||||
File.Copy(imagePath, destinationFolder, true);
|
||||
File.Copy(imagePath, destinationFile, true);
|
||||
|
||||
Close();
|
||||
ventanaPadre.llenarLayout();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -49,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