Fixed money display #1
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
using GTANetworkAPI;
|
||||
using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Services;
|
||||
using reallife_gamemode.Server.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Entities UserBankAccount (UserBankAccount.cs)
|
||||
@@ -16,6 +19,8 @@ namespace reallife_gamemode.Server.Entities
|
||||
{
|
||||
public class UserBankAccount
|
||||
{
|
||||
private float _balance;
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
@@ -26,7 +31,17 @@ namespace reallife_gamemode.Server.Entities
|
||||
public string Bic { get; set; }
|
||||
[StringLength(32)]
|
||||
public string Iban { get; set; }
|
||||
public float Balance { get; set; }
|
||||
public float Balance {
|
||||
get => _balance;
|
||||
set
|
||||
{
|
||||
_balance = value;
|
||||
using(var dbContext = new DatabaseContext())
|
||||
{
|
||||
ClientService.GetClientByName(dbContext.Users.First(u => u.Id == UserId).Name).TriggerEvent("updateMoney", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user