haus-konto geld abheben (30% steuern)
alten hausmanager entfernt
interiormanager in core verschoben
This commit is contained in:
hydrant
2020-03-30 22:25:09 +02:00
parent 4159043348
commit 73bd04b84f
21 changed files with 1930 additions and 753 deletions

View File

@@ -97,8 +97,20 @@ namespace ReallifeGamemode.Server.Finance
{
using (var dbContext = new DatabaseContext())
{
client.GetUser(dbContext).BankAccount.Balance += paycheck.Amount;
client.GetUser(dbContext).Wage = 0;
User u = client.GetUser(dbContext);
u.BankAccount.Balance += paycheck.Amount;
u.Wage = 0;
var rentals = dbContext.HouseRentals
.Include(hR => hR.House)
.ThenInclude(h => h.BankAccount)
.Where(hR => hR.UserId == u.Id);
foreach (var rental in rentals)
{
rental.House.BankAccount.Balance += (int)(rental.House.RentalFee * 0.7);
}
dbContext.SaveChanges();
}
if (paycheck.Amount > 0)