diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index db09e00..7bc366a 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -5,6 +5,6 @@ "\\Principal", "\\Ventas" ], - "SelectedNode": "\\Estadiscticas.cs", + "SelectedNode": "\\Solution.sln", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo index be97bc7..84babba 100644 Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index 62f524c..b496ff0 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 548473f..7be2964 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 107b455..7d60d30 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 abbf362..a3cfe02 100644 --- a/database/DAO.cs +++ b/database/DAO.cs @@ -942,7 +942,7 @@ namespace compabetov2.database { try { - string sqlCuenta = "INSERT INTO cuenta (total, fecha, estado, descripcion,cliente) VALUES(@total, @fecha, 'ACTIVO', @descripcion,'');"; + string sqlCuenta = "INSERT INTO cuenta (total, fecha, estado, descripcion,cliente) VALUES(@total, @fecha, 'ACTIVO', @descripcion,@cliente);"; string sqlDetalle = "INSERT INTO detalle_cuenta (fk_cuenta, fk_producto, cantidad) VALUES(@fk_cuenta, @fk_producto, @cantidad);"; string sqlIdCuenta = "SELECT idCuenta FROM cuenta ORDER BY idCuenta DESC LIMIT 1"; string sqlProductoStock = "SELECT stock FROM Producto WHERE idproducto = @idproducto"; @@ -952,6 +952,7 @@ namespace compabetov2.database commandCuenta.Parameters.AddWithValue("@fecha", DateTime.Now.ToString()); commandCuenta.Parameters.AddWithValue("@total", cuenta.total); commandCuenta.Parameters.AddWithValue("@descripcion", cuenta.descripcion); + commandCuenta.Parameters.AddWithValue("@cliente", cuenta.cliente); commandCuenta.ExecuteNonQuery(); SQLiteCommand commandConsulta = new SQLiteCommand(sqlIdCuenta, conexion); diff --git a/database/service.cs b/database/service.cs index 40a17f8..bf92be7 100644 --- a/database/service.cs +++ b/database/service.cs @@ -463,9 +463,9 @@ namespace compabetov2.database return productos; } - public static Dictionary conseguirEnvioMes(DateTime fecha) + public static Dictionary> conseguirEnvioMes(DateTime fecha) { - Dictionary dic = new Dictionary(); + Dictionary> dic = new Dictionary>(); string formato = "dd/MM/yyyy"; List enviosDia = new List(); List enviosMes = new List(); @@ -473,7 +473,7 @@ namespace compabetov2.database SQLiteDataReader reader = DAO.conseguirEnvioMesDAO(fecha); while (reader.Read()) { - Envio envio = new Envio((int)reader.GetInt64(0),"","","", "","","",0); + Envio envio = new Envio((int)reader.GetInt64(0),reader.GetString(1),"","", "","","",0); string[] fecha_hora = envio.fecha.Split(' '); string fechaVentaStr = fecha_hora[0]; @@ -482,9 +482,12 @@ namespace compabetov2.database { enviosDia.Add(envio); } - enviosDia.Add(envio); + enviosMes.Add(envio); } + dic.Add("mes", enviosMes); + dic.Add("dia", enviosDia); + return dic; } } diff --git a/obj/Debug/compabetov2.csproj.AssemblyReference.cache b/obj/Debug/compabetov2.csproj.AssemblyReference.cache index a853f99..a98f1ed 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.exe b/obj/Debug/compabetov2.exe index 62f524c..b496ff0 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 548473f..7be2964 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ