diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 2d1c3d9..6b61141 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,10 +1,6 @@ { "ExpandedNodes": [ - "", - "\\admin", - "\\Empleados", - "\\Ventas" + "" ], - "SelectedNode": "\\admin\\crud.cs", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo index 5f74366..7cda0f2 100644 Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ diff --git a/Estadiscticas.cs b/Estadiscticas.cs index 3b8bfdf..a085cd8 100644 --- a/Estadiscticas.cs +++ b/Estadiscticas.cs @@ -415,16 +415,24 @@ namespace compabetov2 private void btnVentasDia_Click(object sender, EventArgs e) { - RegistroVentas ventana = new RegistroVentas(resumen["dia"],this); - ventana.Owner = this; - ventana.Show(); + if(resumen != null) + { + RegistroVentas ventana = new RegistroVentas(resumen["dia"], this); + ventana.Owner = this; + ventana.Show(); + } + } private void btnVentasMes_Click(object sender, EventArgs e) { - RegistroVentas ventana = new RegistroVentas(resumen["mes"], this); - ventana.Owner = this; - ventana.Show(); + if(resumen != null) + { + RegistroVentas ventana = new RegistroVentas(resumen["mes"], this); + ventana.Owner = this; + ventana.Show(); + } + } private void lbTotalDia_Click(object sender, EventArgs e) diff --git a/RegistroVentas.Designer.cs b/RegistroVentas.Designer.cs index 2d5e92a..30b1451 100644 --- a/RegistroVentas.Designer.cs +++ b/RegistroVentas.Designer.cs @@ -98,11 +98,12 @@ this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.Image = global::compabetov2.Properties.Resources.cancel1; - this.pictureBox1.Location = new System.Drawing.Point(3, 2); + this.pictureBox1.Location = new System.Drawing.Point(777, 105); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(112, 77); this.pictureBox1.TabIndex = 23; this.pictureBox1.TabStop = false; + this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click_1); // // RegistroVentas // diff --git a/RegistroVentas.cs b/RegistroVentas.cs index fa9ce16..389de64 100644 --- a/RegistroVentas.cs +++ b/RegistroVentas.cs @@ -168,5 +168,15 @@ namespace compabetov2 { Close(); } + + private void button2_Click(object sender, EventArgs e) + { + Close(); + } + + private void pictureBox1_Click_1(object sender, EventArgs e) + { + Close(); + } } } diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 068b31b..e7f4857 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 67f7996..02129c7 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 3b51c8b..e8a21c7 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ diff --git a/database/DAO.cs b/database/DAO.cs index 5c00c03..f49af23 100644 --- a/database/DAO.cs +++ b/database/DAO.cs @@ -1239,7 +1239,7 @@ namespace compabetov2.database try { string sqlVenta = "INSERT INTO venta (fecha, total) VALUES(@fecha, @total);"; - string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad) VALUES(@idVenta, @fk_variante, @cantidada);"; + string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad, precioCompra, precioVenta) VALUES(@idVenta, @fk_variante, @cantidada,@precioCompra,@precioVenta);"; string sqlCuenta = "UPDATE cuenta SET estado ='SALDADO' WHERE idCuenta = @idCuenta;"; string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1"; string sqlImporte = "INSERT INTO detalle_importe (fk_importe,cantidad,precio,fk_venta) VALUES (@fk_importe,@cantidad,@precio,@fk_venta)"; @@ -1269,6 +1269,8 @@ namespace compabetov2.database commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta); commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleCuenta.producto.idVariante); commandEmpleado.Parameters.AddWithValue("@cantidada", detalleCuenta.cantidad); + commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleCuenta.producto.precioCompra); + commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleCuenta.producto.precio); commandEmpleado.ExecuteNonQuery(); } @@ -1697,7 +1699,7 @@ namespace compabetov2.database try { string sqlVenta = "INSERT INTO venta (fecha, total,responzable) VALUES(@fecha, @total,@responzable);"; - string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad) VALUES(@idVenta, @fk_variante, @cantidada);"; + string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad, precioCompra, precioVenta) VALUES(@idVenta, @fk_variante, @cantidada,@precioCompra,@precioVenta);"; string sqlEnvio = "UPDATE envios SET estado ='CONCLUIDO' WHERE idEnvios = @idEnvios;"; string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1"; string sqlStock = "select stock from Producto p where idproducto = @idProducto"; @@ -1726,6 +1728,8 @@ namespace compabetov2.database commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta); commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleEnvio.producto.idVariante); commandEmpleado.Parameters.AddWithValue("@cantidada", detalleEnvio.cantidad); + commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleEnvio.producto.precioCompra); + commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleEnvio.producto.precio); commandEmpleado.ExecuteNonQuery(); //actualizar stock diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index f1beae7..c9e7664 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 3a36b37..03950da 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -7667a5999934c1a74b47acd40b7c90e3bc381844d0d29d1440ec77954ef70622 +6a22a36c0265b88bc3f6a8149bb506605fc8ddf4703d40c20fff9c23a270cc8f diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index 54089ce..30ee1d3 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -169,3 +169,14 @@ C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.RegistroVentas.res C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.addvariante.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.agregarproducto.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.crud.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.editar.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.editarvariante.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.Variantes.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.Ventas.Importe.resources +C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.Ventas.Importe1.resources diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 65ab9c3..3da8f48 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 068b31b..e7f4857 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 67f7996..02129c7 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ