SEB Bank Import debugged and operational. Deploying to import financial data to production system.

This commit is contained in:
Rick Falkvinge
2012-01-02 15:05:28 +00:00
parent 0af1af9a8a
commit 1278ca803f
9 changed files with 481 additions and 49 deletions
+27 -2
View File
@@ -192,7 +192,8 @@ namespace Activizr.Database
}
}
public double GetFinancialAccountBalanceTotal (int financialAccountId)
[Obsolete("This method uses floating point for financials. Deprecated. Do not use.")]
public double GetFinancialAccountBalanceTotal(int financialAccountId)
{
using (DbConnection connection = GetMySqlDbConnection())
{
@@ -215,7 +216,30 @@ namespace Activizr.Database
}
}
public Int64 GetFinancialAccountBalanceDeltaCents (int financialAccountId, DateTime startDate, DateTime endDate)
public Int64 GetFinancialAccountBalanceTotalCents(int financialAccountId)
{
using (DbConnection connection = GetMySqlDbConnection())
{
connection.Open();
DbCommand command =
GetDbCommand(
"SELECT Sum(AmountCents) FROM FinancialTransactionRows WHERE FinancialAccountId=" +
financialAccountId + ";", connection);
using (DbDataReader reader = command.ExecuteReader())
{
if (reader.Read())
{
return reader.GetInt64(0);
}
throw new ArgumentException("Unknown Account Id");
}
}
}
public Int64 GetFinancialAccountBalanceDeltaCents(int financialAccountId, DateTime startDate, DateTime endDate)
{
using (DbConnection connection = GetMySqlDbConnection())
{
@@ -281,6 +305,7 @@ namespace Activizr.Database
}
}
[Obsolete("This method uses floating point for financials. Deprecated. Do not use.")]
public decimal GetFinancialAccountBalanceDelta(int financialAccountId, DateTime startDate, DateTime endDate)
{
return GetFinancialAccountBalanceDeltaCents(financialAccountId, startDate, endDate)/100.0m;