diff --git a/Empleados/AgregarEmpleado1.cs b/Empleados/AgregarEmpleado1.cs index 0b34d19..b43cb68 100644 --- a/Empleados/AgregarEmpleado1.cs +++ b/Empleados/AgregarEmpleado1.cs @@ -67,7 +67,7 @@ namespace compabetov2.Empleados { imagenPath = openFileDialog1.FileName; 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)); //File.Copy(sourceFile, destinationFile, true); } diff --git a/admin/agregarproducto.cs b/admin/agregarproducto.cs index d68a848..8507b23 100644 --- a/admin/agregarproducto.cs +++ b/admin/agregarproducto.cs @@ -31,12 +31,14 @@ namespace compabetov2.admin 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"); 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(); ventanaPadre.llenarLayout(); diff --git a/bin/Debug/produtos_img/retrato.jpeg b/bin/Debug/Resources/usuarios/retrato.jpeg similarity index 100% rename from bin/Debug/produtos_img/retrato.jpeg rename to bin/Debug/Resources/usuarios/retrato.jpeg diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index df682ce..b17dc02 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 ac9dacc..311a1f3 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/bin/Debug/data.db b/bin/Debug/data.db index acf9349..6dfd2d5 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ diff --git a/bin/Debug/produtos_img/fondo.jpg b/bin/Debug/produtos_img/fondo.jpg deleted file mode 100644 index 95eb267..0000000 Binary files a/bin/Debug/produtos_img/fondo.jpg and /dev/null differ diff --git a/bin/Debug/produtos_img/logo.png b/bin/Debug/produtos_img/logo.png deleted file mode 100644 index 6a81398..0000000 Binary files a/bin/Debug/produtos_img/logo.png and /dev/null differ diff --git a/bin/Debug/produtos_img/the-legend-of-zelda-twi-56b48843ad5b6.jpg b/bin/Debug/produtos_img/the-legend-of-zelda-twi-56b48843ad5b6.jpg deleted file mode 100644 index 01080ed..0000000 Binary files a/bin/Debug/produtos_img/the-legend-of-zelda-twi-56b48843ad5b6.jpg and /dev/null differ diff --git a/database/DAO.cs b/database/DAO.cs index b949225..d2adff3 100644 --- a/database/DAO.cs +++ b/database/DAO.cs @@ -466,10 +466,6 @@ namespace compabetov2.database string sql = "INSERT INTO Producto (nombre, descripcion, precio,img, stock, fk_idcategoria) " + "VALUES (@nombre, @descripcion, @precio,@img , @stock, @idcategoria)"; - if (!producto.img.Equals("")) - { - producto.img = guardarImg(producto.img); - } using (SQLiteCommand command = new SQLiteCommand(sql, conexion)) diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 10a1a65..4382aa9 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index c5cc70b..7f6e788 100644 Binary files a/obj/Debug/compabetov2.csproj.AssemblyReference.cache and b/obj/Debug/compabetov2.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache index 5b82059..52fce8f 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -dc59a92235705ffed340a9d882657e3aec1c9a8bb08508bf171d109e3b7e4937 +4bc0b21d4c0f19e1e9ae1bfa37f9e96b5658ecea100004a31759a9d5405753d7 diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 53217ab..e35ac7e 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 df682ce..b17dc02 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 ac9dacc..311a1f3 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ