importe funcional sin haber hecho pruebas exaustivas
This commit is contained in:
+49
-11
@@ -222,9 +222,9 @@ namespace compabetov2.database
|
||||
return DAO.actualizarMermaDAO(merma);
|
||||
}
|
||||
|
||||
public static bool crearCuenta(Cuenta cuenta, List<DetalleCuentaModel> detalleCuentas)
|
||||
public static bool crearCuenta(Cuenta cuenta, List<DetalleCuentaModel> detalleCuentas, List<DetalleImporte> importes)
|
||||
{
|
||||
return DAO.crearCuentaDAO(cuenta, detalleCuentas);
|
||||
return DAO.crearCuentaDAO(cuenta, detalleCuentas, importes);
|
||||
}
|
||||
|
||||
public static List<Cuenta> conseguirCuentaDAO()
|
||||
@@ -273,14 +273,35 @@ namespace compabetov2.database
|
||||
return detallesCuentas;
|
||||
}
|
||||
|
||||
public static List<DetalleImporteCuenta> conseguirImportesCuenta(int idCuenta)
|
||||
{
|
||||
List<DetalleImporteCuenta> importes = new List<DetalleImporteCuenta>();
|
||||
|
||||
SQLiteDataReader reader = DAO.conseguirImportesCuentaDAO(idCuenta);
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
int idImporte = (int)reader.GetInt64(1);
|
||||
DetalleImporteCuenta importe = new DetalleImporteCuenta(
|
||||
idImporte,
|
||||
(int)reader.GetInt64(2),//cantidad
|
||||
(int)reader.GetDecimal(3),// precio
|
||||
(int)reader.GetInt64(4)//fk_cuenta
|
||||
);
|
||||
importes.Add(importe);
|
||||
}
|
||||
|
||||
return importes;
|
||||
}
|
||||
|
||||
public static bool cancelarCuenta(int idCuenta)
|
||||
{
|
||||
return DAO.cancelarCuentaDAO(idCuenta);
|
||||
}
|
||||
|
||||
public static bool saldarCuenta(Cuenta cuenta, List<DetalleCuentaModel> detallesCuentas)
|
||||
public static bool saldarCuenta(Cuenta cuenta, List<DetalleCuentaModel> detallesCuentas, List<DetalleImporteCuenta> importes)
|
||||
{
|
||||
return DAO.saldarCuentaDAO(cuenta, detallesCuentas);
|
||||
return DAO.saldarCuentaDAO(cuenta, detallesCuentas, importes);
|
||||
}
|
||||
|
||||
/*public static Dictionary<string, dynamic> filtrarVentaFechaMes(DateTime fecha)
|
||||
@@ -314,18 +335,19 @@ namespace compabetov2.database
|
||||
return estadisticas;
|
||||
}*/
|
||||
|
||||
public static bool crearEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio)
|
||||
public static bool crearEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio, List<DetalleImporte> importes)
|
||||
{
|
||||
return DAO.crearEnvio(envio, detallesEnvio);
|
||||
return DAO.crearEnvio(envio, detallesEnvio,importes);
|
||||
}
|
||||
|
||||
public static List<Envio> conseguirEnvio()
|
||||
public static List<Dictionary<string, dynamic>> conseguirEnvio()
|
||||
{
|
||||
List<Envio> envios = new List<Envio>();
|
||||
List<Dictionary<string, dynamic>> envios = new List<Dictionary<string, dynamic>>();
|
||||
SQLiteDataReader reader = DAO.conseguirEnvioDAO();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
Dictionary<string,dynamic> dict = new Dictionary<string,dynamic>();
|
||||
decimal total = reader.GetDecimal(6);
|
||||
Envio envio = new Envio(
|
||||
(int)reader.GetInt64(0),
|
||||
@@ -338,7 +360,23 @@ namespace compabetov2.database
|
||||
total
|
||||
) ;
|
||||
|
||||
envios.Add(envio);
|
||||
dict.Add("envio", envio);
|
||||
|
||||
List<DetalleImporteEnvio> importes = new List<DetalleImporteEnvio>();
|
||||
SQLiteDataReader readerImporte = DAO.conseguirImporteEnvio(envio.id);
|
||||
while (readerImporte.Read())
|
||||
{
|
||||
decimal precio = readerImporte.GetDecimal(3);
|
||||
importes.Add(new DetalleImporteEnvio(
|
||||
(int)readerImporte.GetInt64(1),//id
|
||||
(int)readerImporte.GetInt64(2),//cantidad
|
||||
precio,//precio
|
||||
(int)readerImporte.GetInt64(4)//fk_envio
|
||||
));
|
||||
}
|
||||
|
||||
dict.Add("importes",importes);
|
||||
envios.Add(dict);
|
||||
}
|
||||
|
||||
return envios;
|
||||
@@ -375,9 +413,9 @@ namespace compabetov2.database
|
||||
return DAO.cancelarEnvioDAO(envio, detalles);
|
||||
}
|
||||
|
||||
public static bool concluirEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio)
|
||||
public static bool concluirEnvio(Envio envio, List<DetalleEnvioModel> detallesEnvio, List<DetalleImporteEnvio> importes)
|
||||
{
|
||||
return DAO.concluirEnvioDAO(envio, detallesEnvio);
|
||||
return DAO.concluirEnvioDAO(envio, detallesEnvio, importes);
|
||||
}
|
||||
|
||||
public static Dictionary<string, List<Dictionary<string,dynamic>>> estadisticas(DateTime fecha)
|
||||
|
||||
Reference in New Issue
Block a user