Add TransferMoney Test

This commit is contained in:
VegaZ
2018-10-09 21:02:05 +02:00
parent 25a37f03f9
commit e11d453e27
6 changed files with 111 additions and 1 deletions

View File

@@ -34,6 +34,22 @@ namespace reallife_gamemode.Server.Extensions
}
}
public static UserBankAccount GetUserBankAccount(this User user, DatabaseContext context = null)
{
using (DatabaseContext dbContext = new DatabaseContext())
if (context == null)
{
using (context = new DatabaseContext())
{
return context.UserBankAccounts.FirstOrDefault(u => u.UserId == user.Id);
}
}
else
{
return context.UserBankAccounts.FirstOrDefault(u => u.UserId == user.Id);
}
}
public static bool IsLoggedIn(this Client player)
{
return player.HasData("isLoggedIn") ? player.GetData("isLoggedIn") : false;