diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo index 2b65c7c..be97bc7 100644 Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ diff --git a/Estadiscticas.cs b/Estadiscticas.cs index 52909db..17cae3a 100644 --- a/Estadiscticas.cs +++ b/Estadiscticas.cs @@ -43,18 +43,47 @@ namespace compabetov2 { "productos", productosMes }, { "productoMasVendido", prodctoMasVendido(productosMes) }, { "mejorVendedor", mejorVenderdorMes() }, + { "totalMes", totalMes() }, } }, { "dia", new Dictionary{ { "productos", productosDia }, { "productoMasVendido", prodctoMasVendido(productosDia) }, { "mejorVendedor", mejorVenderdorDia() }, + { "totalDia", totalDia()} } } }; mostrarDatos(estadisticas); } + private decimal totalMes() + { + List> mes = resumen["mes"]; + + return calcularTotal(mes); + } + + private decimal totalDia() + { + List> dia = resumen["dia"]; + + return calcularTotal(dia); + } + + private decimal calcularTotal(List> resumen) + { + decimal total = 0; + foreach (Dictionary venta_y_detalles in resumen) + { + VentaModel venta = venta_y_detalles["venta"]; + + total += venta.total; + } + + return total; + } + private List estadisticasDia() { //solo copie y pegue le metodo estadisticas dia y cambie el key en resumen de mes a dia @@ -133,7 +162,7 @@ namespace compabetov2 dgvMes.Rows.Add(nuevaFila); } - lbTotalMes.Text = $"Total de mes: ${totalVendidoMes}"; + lbTotalMes.Text = $"Total de mes: ${estadisticas["mes"]["totalMes"]}"; lbProductoMes.Text = $"Producto mas vendido: {estadisticas["mes"]["productoMasVendido"]}"; lbVendedorMes.Text = $"Mejor vendedor: {estadisticas["mes"]["mejorVendedor"]}"; @@ -168,7 +197,7 @@ namespace compabetov2 dgvDia.Rows.Add(nuevaFila); } - lbTotalDia.Text = $"Total de dia: ${totalVendidoDia}"; + lbTotalDia.Text = $"Total de dia: ${estadisticas["dia"]["totalDia"]}"; lbProductDia.Text = $"Producto mas vendido: {estadisticas["dia"]["productoMasVendido"]}"; lbVendedorDia.Text = $"Mejor vendedor: {estadisticas["dia"]["mejorVendedor"]}"; } diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 7668b7e..38693df 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 1ba4872..f11994a 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 5d8b9bb..d19483d 100644 Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ 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/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 5f3125c..951a680 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index a853f99..e1562b1 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 9a7d607..8b5645f 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -02f8dd8032cdd900c4c7a30e0d2445335e555a7c7084d974934c829cadebfeb5 +139b4fcf6da88d898310192ac1940949355dbb22e52e62b98f67cedee395686d diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index d71a87b..d7959f2 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -96,3 +96,4 @@ C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.exe C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.pdb >>>>>>> c401f0a5d425880eadaf1bd65205d8559b5d39bc C:\Users\Googl\Documents\compabetoOG\obj\Debug\compabetov2.Ventas.datosEnvio.resources +C:\Users\carsu\Source\Repos\compabetoOG\obj\Debug\compabetov2.Ventas.datosEnvio.resources diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 55e9b1b..a0d2f93 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 7668b7e..38693df 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 1ba4872..f11994a 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ