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/Envios/envios.Designer.cs b/Envios/envios.Designer.cs
index c37a1bf..cc2e782 100644
--- a/Envios/envios.Designer.cs
+++ b/Envios/envios.Designer.cs
@@ -143,6 +143,7 @@
this.button3.TabIndex = 10;
this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
diff --git a/Envios/envios.cs b/Envios/envios.cs
index 257c038..92f4b78 100644
--- a/Envios/envios.cs
+++ b/Envios/envios.cs
@@ -11,6 +11,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using compabetov2.admin;
namespace compabetov2
{
@@ -447,5 +448,20 @@ namespace compabetov2
MessageBox.Show("Por favor, ingrese solo números en el teléfono.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ if (loginPrincipal.tipo.Equals("empleado"))
+ {
+ MessageBox.Show("Usted no tiene permisos de acceder a este apartado");
+ }
+ else
+ {
+ crud crud = new crud();
+ crud.Owner = this;
+ crud.Show();
+
+ }
+ }
}
}
diff --git a/Estadiscticas.Designer.cs b/Estadiscticas.Designer.cs
index ed7fd3d..da73d1b 100644
--- a/Estadiscticas.Designer.cs
+++ b/Estadiscticas.Designer.cs
@@ -356,6 +356,7 @@
//
// btnVentasDia
//
+ this.btnVentasDia.Enabled = false;
this.btnVentasDia.Location = new System.Drawing.Point(660, 313);
this.btnVentasDia.Name = "btnVentasDia";
this.btnVentasDia.Size = new System.Drawing.Size(110, 23);
@@ -366,6 +367,7 @@
//
// btnVentasMes
//
+ this.btnVentasMes.Enabled = false;
this.btnVentasMes.Location = new System.Drawing.Point(666, 611);
this.btnVentasMes.Name = "btnVentasMes";
this.btnVentasMes.Size = new System.Drawing.Size(110, 23);
diff --git a/Estadiscticas.cs b/Estadiscticas.cs
index cccc074..3b8bfdf 100644
--- a/Estadiscticas.cs
+++ b/Estadiscticas.cs
@@ -72,6 +72,8 @@ namespace compabetov2
}
};
mostrarDatos(estadisticas);
+ btnVentasDia.Enabled = true;
+ btnVentasMes.Enabled = true;
}
diff --git a/Estadiscticas.resx b/Estadiscticas.resx
index a4d2de6..60ffc58 100644
--- a/Estadiscticas.resx
+++ b/Estadiscticas.resx
@@ -135,6 +135,42 @@
True
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
True
diff --git a/Merma/mermas.Designer.cs b/Merma/mermas.Designer.cs
index b2cc6d7..1b0cbde 100644
--- a/Merma/mermas.Designer.cs
+++ b/Merma/mermas.Designer.cs
@@ -136,6 +136,7 @@
this.button3.TabIndex = 10;
this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
@@ -154,6 +155,7 @@
this.button5.TabIndex = 12;
this.button5.Text = "Salir";
this.button5.UseVisualStyleBackColor = false;
+ this.button5.Click += new System.EventHandler(this.button5_Click);
//
// lblfecha
//
diff --git a/Merma/mermas.cs b/Merma/mermas.cs
index e0ffb52..bed4a1e 100644
--- a/Merma/mermas.cs
+++ b/Merma/mermas.cs
@@ -11,6 +11,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using compabetov2.admin;
namespace compabetov2
{
@@ -225,8 +226,36 @@ namespace compabetov2
private void button2_Click(object sender, EventArgs e)
{
- Estadiscticas verstats = new Estadiscticas();
- verstats.Show();
+ if (loginPrincipal.tipo.Equals("empleado"))
+ {
+ MessageBox.Show("Usted no tiene permisos de acceder a este apartado");
+ }
+ else
+ {
+ Estadiscticas estadiscticas = new Estadiscticas();
+ estadiscticas.Owner = this;
+ estadiscticas.Show();
+ }
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ if (loginPrincipal.tipo.Equals("empleado"))
+ {
+ MessageBox.Show("Usted no tiene permisos de acceder a este apartado");
+ }
+ else
+ {
+ crud crud = new crud();
+ crud.Owner = this;
+ crud.Show();
+
+ }
}
}
}
diff --git a/RegistroVentas.Designer.cs b/RegistroVentas.Designer.cs
index e41eca2..879cde4 100644
--- a/RegistroVentas.Designer.cs
+++ b/RegistroVentas.Designer.cs
@@ -32,13 +32,15 @@
this.lbContador = new System.Windows.Forms.Label();
this.btnMenos = new System.Windows.Forms.Button();
this.btnMas = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panelVentas
//
this.panelVentas.AutoScroll = true;
- this.panelVentas.Location = new System.Drawing.Point(304, 321);
- this.panelVentas.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.panelVentas.BackColor = System.Drawing.Color.Transparent;
+ this.panelVentas.Location = new System.Drawing.Point(382, 308);
+ this.panelVentas.Margin = new System.Windows.Forms.Padding(4);
this.panelVentas.Name = "panelVentas";
this.panelVentas.Size = new System.Drawing.Size(563, 673);
this.panelVentas.TabIndex = 0;
@@ -47,7 +49,7 @@
//
this.lbContador.AutoSize = true;
this.lbContador.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbContador.Location = new System.Drawing.Point(519, 232);
+ this.lbContador.Location = new System.Drawing.Point(597, 219);
this.lbContador.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbContador.Name = "lbContador";
this.lbContador.Size = new System.Drawing.Size(125, 29);
@@ -57,8 +59,8 @@
// btnMenos
//
this.btnMenos.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnMenos.Location = new System.Drawing.Point(394, 231);
- this.btnMenos.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnMenos.Location = new System.Drawing.Point(472, 218);
+ this.btnMenos.Margin = new System.Windows.Forms.Padding(4);
this.btnMenos.Name = "btnMenos";
this.btnMenos.Size = new System.Drawing.Size(100, 37);
this.btnMenos.TabIndex = 1;
@@ -69,8 +71,8 @@
// btnMas
//
this.btnMas.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnMas.Location = new System.Drawing.Point(680, 232);
- this.btnMas.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnMas.Location = new System.Drawing.Point(758, 219);
+ this.btnMas.Margin = new System.Windows.Forms.Padding(4);
this.btnMas.Name = "btnMas";
this.btnMas.Size = new System.Drawing.Size(100, 37);
this.btnMas.TabIndex = 2;
@@ -78,6 +80,17 @@
this.btnMas.UseVisualStyleBackColor = true;
this.btnMas.Click += new System.EventHandler(this.btnMas_Click);
//
+ // button1
+ //
+ this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.button1.Location = new System.Drawing.Point(590, 998);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(147, 55);
+ this.button1.TabIndex = 3;
+ this.button1.Text = "Salir";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// RegistroVentas
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@@ -85,15 +98,16 @@
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(104)))), ((int)(((byte)(255)))));
this.BackgroundImage = global::compabetov2.Properties.Resources.Form;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.ClientSize = new System.Drawing.Size(1153, 1047);
+ this.ClientSize = new System.Drawing.Size(1294, 1077);
this.ControlBox = false;
+ this.Controls.Add(this.button1);
this.Controls.Add(this.btnMas);
this.Controls.Add(this.btnMenos);
this.Controls.Add(this.lbContador);
this.Controls.Add(this.panelVentas);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "RegistroVentas";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Load += new System.EventHandler(this.RegistroVentas_Load);
@@ -108,5 +122,6 @@
private System.Windows.Forms.Label lbContador;
private System.Windows.Forms.Button btnMenos;
private System.Windows.Forms.Button btnMas;
+ private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
diff --git a/RegistroVentas.cs b/RegistroVentas.cs
index ceb4c80..eb52eb3 100644
--- a/RegistroVentas.cs
+++ b/RegistroVentas.cs
@@ -158,5 +158,10 @@ namespace compabetov2
{
}
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
}
}
diff --git a/Ventas/vender.Designer.cs b/Ventas/vender.Designer.cs
index e0c1d82..a2ae8f2 100644
--- a/Ventas/vender.Designer.cs
+++ b/Ventas/vender.Designer.cs
@@ -257,6 +257,7 @@
this.button5.TabIndex = 12;
this.button5.Text = "Salir";
this.button5.UseVisualStyleBackColor = false;
+ this.button5.Click += new System.EventHandler(this.button5_Click);
//
// flowLayoutPanel3
//
diff --git a/Ventas/vender.cs b/Ventas/vender.cs
index d2c0ed7..7a2257d 100644
--- a/Ventas/vender.cs
+++ b/Ventas/vender.cs
@@ -16,6 +16,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
+using compabetov2.admin;
namespace compabetov2
{
@@ -891,8 +892,24 @@ namespace compabetov2
private void button3_Click(object sender, EventArgs e)
{
-
-
+ if (loginPrincipal.tipo.Equals("empleado"))
+ {
+ MessageBox.Show("Usted no tiene permisos de acceder a este apartado");
+ }
+ else
+ {
+ crud crud = new crud();
+ crud.Owner = this;
+ crud.Show();
+
+ }
+
+
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ Close();
}
}
}
diff --git a/admin/addvariante.cs b/admin/addvariante.cs
index 0945530..cbd4a97 100644
--- a/admin/addvariante.cs
+++ b/admin/addvariante.cs
@@ -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)
);
diff --git a/admin/agregarproducto.cs b/admin/agregarproducto.cs
index d68a848..add66e3 100644
--- a/admin/agregarproducto.cs
+++ b/admin/agregarproducto.cs
@@ -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)
diff --git a/bin/Debug/Resources/usuarios/TONY FACE GREEN2.png b/bin/Debug/Resources/usuarios/TONY FACE GREEN2.png
new file mode 100644
index 0000000..4c70be9
Binary files /dev/null and b/bin/Debug/Resources/usuarios/TONY FACE GREEN2.png differ
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 1682014..80da7a6 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 44fdddc..d19f7e1 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 ee414b8..9128c1a 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/bin/data.db b/bin/data.db
new file mode 100644
index 0000000..6dfd2d5
Binary files /dev/null and b/bin/data.db 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.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache
index 154ef17..c2b94a1 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 1682014..80da7a6 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 44fdddc..d19f7e1 100644
Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ