version 1.0
This commit is contained in:
+16
-5
@@ -38,6 +38,7 @@ namespace compabetov2
|
||||
List<DetalleVentaModel> productosDia = estadisticasDia();
|
||||
decimal totalmes = totalMes();
|
||||
decimal totaldia = totalDia();
|
||||
Dictionary<string, List<Envio>> envios = service.conseguirEnvioMes(fechaBuscar);
|
||||
|
||||
Dictionary<string,dynamic> estadisticas = new Dictionary<string, dynamic>
|
||||
{
|
||||
@@ -46,23 +47,30 @@ namespace compabetov2
|
||||
{ "productoMasVendido", prodctoMasVendido(productosMes) },
|
||||
{ "mejorVendedor", mejorVenderdorMes() },
|
||||
{ "totalMes", totalmes },
|
||||
{ "totalMesSinEnvio", totalMesSinEnvio(totalmes) },
|
||||
{ "EnvioCantidad", totalMesSinEnvio(envios) },
|
||||
}
|
||||
},
|
||||
{ "dia", new Dictionary<string, dynamic>{
|
||||
{ "productos", productosDia },
|
||||
{ "productoMasVendido", prodctoMasVendido(productosDia) },
|
||||
{ "mejorVendedor", mejorVenderdorDia() },
|
||||
{ "totalDia", totalDia()}
|
||||
{ "totalDia", totalDia()},
|
||||
{ "EnvioCantidad", totalDiaSinEnvio(envios) },
|
||||
}
|
||||
}
|
||||
};
|
||||
mostrarDatos(estadisticas);
|
||||
}
|
||||
|
||||
private dynamic totalMesSinEnvio(decimal total)
|
||||
private int totalMesSinEnvio(Dictionary<string, List<Envio>> envios)
|
||||
{
|
||||
return 0;
|
||||
|
||||
return envios["mes"].Count;
|
||||
}
|
||||
|
||||
private int totalDiaSinEnvio(Dictionary<string, List<Envio>> envios)
|
||||
{
|
||||
return envios["dia"].Count;
|
||||
}
|
||||
|
||||
private decimal totalMes()
|
||||
@@ -169,10 +177,11 @@ namespace compabetov2
|
||||
// Agregar la nueva fila al DataGridView
|
||||
dgvMes.Rows.Add(nuevaFila);
|
||||
}
|
||||
|
||||
decimal totalSinEnvioMes = estadisticas["mes"]["totalMes"] - (estadisticas["mes"]["EnvioCantidad"] *10);
|
||||
lbTotalMes.Text = $"Total de mes: ${estadisticas["mes"]["totalMes"]}";
|
||||
lbProductoMes.Text = $"Producto mas vendido: {estadisticas["mes"]["productoMasVendido"]}";
|
||||
lbVendedorMes.Text = $"Mejor vendedor: {estadisticas["mes"]["mejorVendedor"]}";
|
||||
lbMesSEnvio.Text = $"Total del mes sin envios: ${totalSinEnvioMes}";
|
||||
|
||||
//dia
|
||||
List<DetalleVentaModel> detallesDia = estadisticas["dia"]["productos"];
|
||||
@@ -205,9 +214,11 @@ namespace compabetov2
|
||||
dgvDia.Rows.Add(nuevaFila);
|
||||
}
|
||||
|
||||
decimal totalSinEnvioDia = estadisticas["dia"]["totalDia"] - (estadisticas["dia"]["EnvioCantidad"] * 10);
|
||||
lbTotalDia.Text = $"Total de dia: ${estadisticas["dia"]["totalDia"]}";
|
||||
lbProductDia.Text = $"Producto mas vendido: {estadisticas["dia"]["productoMasVendido"]}";
|
||||
lbVendedorDia.Text = $"Mejor vendedor: {estadisticas["dia"]["mejorVendedor"]}";
|
||||
lbDiaSEnvio.Text = $"Total del dia sin envios: ${totalSinEnvioDia}";
|
||||
}
|
||||
|
||||
private List<DetalleVentaModel> estadisticasMes()
|
||||
|
||||
Reference in New Issue
Block a user