Add bank interest

This commit is contained in:
SilicaAndPina 2021-01-01 22:04:07 +13:00
parent c1a0f2e370
commit 8b36407981
4 changed files with 29 additions and 10 deletions

View file

@ -2175,13 +2175,14 @@ namespace HISP.Server
}
}
public static void DoIntrestPayments()
public static void DoIntrestPayments(int intrestRate)
{
using (MySqlConnection db = new MySqlConnection(ConnectionString))
{
db.Open();
MySqlCommand sqlCommand = db.CreateCommand();
sqlCommand.CommandText = "UPDATE UserExt SET BankBalance=BankBalance * (1/@interestRate) AND NOT BankBalance * (1/@interestRate) > 9999999999.9999";
sqlCommand.CommandText = "UPDATE UserExt SET BankInterest=BankInterest * (1/@interestRate) AND NOT BankInterest * (1/@interestRate) > 9999999999.9999";
sqlCommand.Parameters.AddWithValue("@interest", intrestRate);
sqlCommand.Prepare();
sqlCommand.ExecuteNonQuery();