public AccountBase(decimal initialDeposit) { ValidationHelper.NegativeTransactionValue(initialDeposit, "initialDeposit"); this.InitialDeposit = initialDeposit; this.StartDate = DateProvider.Now(); this.Id = IdentifierHelper.NewAccountId(); }
public static DateProvider getInstance() { if (instance == null) { instance = new DateProvider(); } return(instance); }
public InterestBearingAccount(decimal initialDeposit, InterestCounpoundType compoundType = InterestCounpoundType.Daily) : base(initialDeposit) { MonetaryCycles = new CoreList <MonetaryCycle>(); this._CreateCycle(DateProvider.Now().Date); RateLimits = new List <IRateLimit>(); this.CompoundType = compoundType; this.RegisterRateProviders(); this.Transactions_OnAdd(this.Transactions[0], null); }
private bool HasWithdraw() { bool result = false; if (this.transactions != null) { List <Transaction> withdraws = this.transactions.Where(x => x.amount < 0).ToList(); foreach (Transaction trans in withdraws) { if (trans.GetTransactionDate().Date.AddDays(10) > DateProvider.getInstance().Now().Date) { result = true; } } } return(result); }
public string GetStatement() { DateTime _date = DateProvider.Now(); UpdateCycle(_date); String _report = this.TypeName + "\n"; foreach (Transaction transaction in this.Transactions) { _report += " " + transaction.Type.ToString() + " " + transaction.Value.ToDollars() + "\n"; } _report += "Total " + this.MonetaryCycles.Last().AvailableBalance.ToDollars(); return(_report); }
public Transaction(decimal amount, TransactionType type) : this(amount, type, DateProvider.Now()) { }
public Transaction(double amount) { this.amount = amount; this.transactionDate = DateProvider.getInstance().Now(); }
public static DateProvider getInstance() { if (instance == null) instance = new DateProvider(); return instance; }
public void Withdraw(decimal amount) { this.Withdraw(amount, DateProvider.Now()); }
public void Transfer(IAccount receivingAccount, decimal amount) { this.Transfer(receivingAccount, amount, DateProvider.Now()); }
public void Deposit(decimal amount) { this.Deposit(amount, DateProvider.Now()); }
private Bank(string name, BankingTimeZone timeZone = BankingTimeZone.Local) { this.Name = name; DateProvider.SetTimeZone(timeZone); this.Customers = new CoreList <ICustomer>(); }
public double GetEffectiveRate() { return(this.GetEffectiveRate(DateProvider.Now())); }
public override decimal GetBalance() { return(this.GetBalance(DateProvider.Now())); }
public decimal InterestEarned() { return(this.InterestEarned(DateProvider.Now())); }