bajar cambios
This commit is contained in:
@@ -67,7 +67,7 @@ namespace compabetov2.Empleados
|
|||||||
{
|
{
|
||||||
imagenPath = openFileDialog1.FileName;
|
imagenPath = openFileDialog1.FileName;
|
||||||
lbImg.Text = $"Imagen: {Path.GetFileName(imagenPath)}";
|
lbImg.Text = $"Imagen: {Path.GetFileName(imagenPath)}";
|
||||||
string destinationFolder = Path.Combine(Application.StartupPath, "Resources", "usuarios");
|
//string destinationFolder = Path.Combine(Application.StartupPath, "Resources", "usuarios");
|
||||||
//string destinationFile = Path.Combine(destinationFolder, Path.GetFileName(sourceFile));
|
//string destinationFile = Path.Combine(destinationFolder, Path.GetFileName(sourceFile));
|
||||||
//File.Copy(sourceFile, destinationFile, true);
|
//File.Copy(sourceFile, destinationFile, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,12 +31,14 @@ namespace compabetov2.admin
|
|||||||
decimal precio = 0;
|
decimal precio = 0;
|
||||||
//valida que se haya colocado alguna imagen
|
//valida que se haya colocado alguna imagen
|
||||||
if (!imagePath.Equals("")) {
|
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))
|
if (service.insertarProducto(producto))
|
||||||
{
|
{
|
||||||
string destinationFolder = Path.Combine(Application.StartupPath, "Resources");
|
string destinationFolder = Path.Combine(Application.StartupPath, "Resources");
|
||||||
string destinationFile = Path.Combine(destinationFolder, Path.GetFileName(imagePath));
|
string destinationFile = Path.Combine(destinationFolder, Path.GetFileName(imagePath));
|
||||||
File.Copy(imagePath, destinationFile, true);
|
MessageBox.Show($"destinationFile: {destinationFile}");
|
||||||
|
MessageBox.Show($"destinationFolder: {destinationFolder}");
|
||||||
|
File.Copy(imagePath, destinationFolder, true);
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
ventanaPadre.llenarLayout();
|
ventanaPadre.llenarLayout();
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 506 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 MiB |
@@ -466,10 +466,6 @@ namespace compabetov2.database
|
|||||||
string sql = "INSERT INTO Producto (nombre, descripcion, precio,img, stock, fk_idcategoria) " +
|
string sql = "INSERT INTO Producto (nombre, descripcion, precio,img, stock, fk_idcategoria) " +
|
||||||
"VALUES (@nombre, @descripcion, @precio,@img , @stock, @idcategoria)";
|
"VALUES (@nombre, @descripcion, @precio,@img , @stock, @idcategoria)";
|
||||||
|
|
||||||
if (!producto.img.Equals(""))
|
|
||||||
{
|
|
||||||
producto.img = guardarImg(producto.img);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
|
using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
dc59a92235705ffed340a9d882657e3aec1c9a8bb08508bf171d109e3b7e4937
|
4bc0b21d4c0f19e1e9ae1bfa37f9e96b5658ecea100004a31759a9d5405753d7
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user