inserta cuenta

This commit is contained in:
carlos
2024-01-22 00:57:40 -06:00
17 changed files with 328 additions and 73 deletions
+30
View File
@@ -222,5 +222,35 @@ namespace compabetov2.database
{
return DAO.actualizarMermaDAO(merma);
}
public static bool crearCuenta(Cuenta cuenta, List<DetalleCuentaModel> detalleCuentas)
{
return DAO.crearCuentaDAO(cuenta, detalleCuentas);
}
public static List<Cuenta> conseguirCuentaDAO()
{
List<Cuenta> cuentas = new List<Cuenta>();
SQLiteDataReader reader = DAO.conseguirCuentaDAO();
while(reader.Read())
{
long idCuenta = reader.GetInt64(0);
long total = reader.GetInt64(1);
string fecha = reader["fecha"].ToString();
string estado = reader["estado"].ToString();
string descripcion = reader["descripcion"].ToString();
Cuenta cuenta = new Cuenta(
(int) total,
fecha,
estado,
descripcion,
(int)idCuenta
);
cuentas.Add(cuenta);
}
return cuentas;
}
}
}