Exemple #1
0
 public AccountBase(decimal initialDeposit)
 {
     ValidationHelper.NegativeTransactionValue(initialDeposit, "initialDeposit");
     this.InitialDeposit = initialDeposit;
     this.StartDate      = DateProvider.Now();
     this.Id             = IdentifierHelper.NewAccountId();
 }
Exemple #2
0
 public static DateProvider getInstance()
 {
     if (instance == null)
     {
         instance = new DateProvider();
     }
     return(instance);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 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;
 }
Exemple #9
0
 public void Withdraw(decimal amount)
 {
     this.Withdraw(amount, DateProvider.Now());
 }
Exemple #10
0
 public void Transfer(IAccount receivingAccount, decimal amount)
 {
     this.Transfer(receivingAccount, amount, DateProvider.Now());
 }
Exemple #11
0
 public void Deposit(decimal amount)
 {
     this.Deposit(amount, DateProvider.Now());
 }
Exemple #12
0
 private Bank(string name, BankingTimeZone timeZone = BankingTimeZone.Local)
 {
     this.Name = name;
     DateProvider.SetTimeZone(timeZone);
     this.Customers = new CoreList <ICustomer>();
 }
Exemple #13
0
 public double GetEffectiveRate()
 {
     return(this.GetEffectiveRate(DateProvider.Now()));
 }
Exemple #14
0
 public override decimal GetBalance()
 {
     return(this.GetBalance(DateProvider.Now()));
 }
Exemple #15
0
 public decimal InterestEarned()
 {
     return(this.InterestEarned(DateProvider.Now()));
 }