Bajo Cambio 605

This commit is contained in:
Michael Robles
2024-02-03 06:05:22 -07:00
10 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -5,6 +5,6 @@
"\\Principal",
"\\Ventas"
],
"SelectedNode": "\\Estadiscticas.cs",
"SelectedNode": "\\Solution.sln",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -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);
+7 -4
View File
@@ -463,9 +463,9 @@ namespace compabetov2.database
return productos;
}
public static Dictionary<string, dynamic> conseguirEnvioMes(DateTime fecha)
public static Dictionary<string, List<Envio>> conseguirEnvioMes(DateTime fecha)
{
Dictionary<string,dynamic> dic = new Dictionary<String,dynamic>();
Dictionary<string, List<Envio>> dic = new Dictionary<string, List<Envio>>();
string formato = "dd/MM/yyyy";
List<Envio> enviosDia = new List<Envio>();
List<Envio> enviosMes = new List<Envio>();
@@ -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;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.