Added automatic update of business when bank account changes
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using reallife_gamemode.Server.Business;
|
using reallife_gamemode.Server.Business;
|
||||||
|
using reallife_gamemode.Server.Managers;
|
||||||
using reallife_gamemode.Server.Util;
|
using reallife_gamemode.Server.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -10,10 +11,20 @@ namespace reallife_gamemode.Server.Entities
|
|||||||
{
|
{
|
||||||
public class BusinessBankAccount : IBankAccount
|
public class BusinessBankAccount : IBankAccount
|
||||||
{
|
{
|
||||||
|
[NotMapped]
|
||||||
|
private int _balance;
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public int Balance { get; set; }
|
public int Balance {
|
||||||
|
get => _balance;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_balance = value;
|
||||||
|
BusinessManager.GetBusiness(BusinessId).Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int BusinessId { get; set; }
|
public int BusinessId { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using reallife_gamemode.Server.Util;
|
|||||||
* @copyright (c) 2008 - 2018 Life of German
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace reallife_gamemode.Server.Managers
|
namespace reallife_gamemode.Server.Managers
|
||||||
{
|
{
|
||||||
public class BankManager
|
public class BankManager
|
||||||
|
|||||||
Reference in New Issue
Block a user