Exemplo n.º 1
0
        public decimal capitalize(CAccount acc)
        {
            decimal temp = acc.GetSaldo();

            temp += temp * this.interest;
            return(temp);
        }
Exemplo n.º 2
0
 public WithDraw(decimal amount, CAccount acc)
 {
     this.operationType = "WITHDRAW";
     this.amount        = amount;
     this.sourceID      = acc.GetAccID();
     this.destinationID = -1;
 }
Exemplo n.º 3
0
 public void execute(CAccount from)
 {
     if (from.substrMoney(amount))
     {
         dest.addMoney(amount);
     }
 }
Exemplo n.º 4
0
 public PayIn(decimal amount, CAccount dest)
 {
     this.operationType = "PAYIN";
     this.amount        = amount;
     this.destinationID = dest.GetAccID();
     this.sourceID      = -1;
 }
Exemplo n.º 5
0
        public void PayIn(CAccount acc, decimal amount)
        {
            PayIn      payin = new PayIn(amount, acc);
            IOperation oper  = payin;

            acc.DoOperation(oper);
            acc.GetHistory().AddToHistory(payin);
        }
Exemplo n.º 6
0
 public Transfer(CAccount to, decimal amount, CAccount from)
 {
     this.operationType = "TRANSFER";
     this.amount        = amount;
     this.dest          = to;
     this.destinationID = to.GetAccID();
     this.sourceID      = from.GetAccID();
 }
Exemplo n.º 7
0
        public void StoreAccount(int id, int ownerID)
        {
            CAccount acc = new CAccount(id, ownerID);

            this.accounts.Add(acc);

            CCustomer c = GetCustomer(ownerID);

            c.AddAccount(acc);
        }
Exemplo n.º 8
0
        public Transfer Transfer(CAccount from, CAccount to, decimal amount)
        {
            Transfer   transfer = new Transfer(to, amount, from);
            IOperation oper     = transfer;

            from.DoOperation(oper);
            from.GetHistory().AddToHistory(transfer);
            // to.GetHistory().AddToHistory(transfer);
            return(transfer);
        }
Exemplo n.º 9
0
        public bool WithDraw(CBank bank, CAccount acc, decimal amount)
        {
            bool       positive = false;
            WithDraw   withdraw = new WithDraw(amount, acc);
            IOperation oper     = withdraw;

            if (acc.GetSaldo() >= amount)
            {
                acc.DoOperation(oper);
                acc.GetHistory().AddToHistory(withdraw);
                positive = true;
            }
            return(positive);
        }
Exemplo n.º 10
0
        public bool WithDraw(CBank bank, CAccount acc, decimal amount)
        {
            if (this.bank.WithDraw(bank, acc, amount))
            {
                return(true);
            }
            else
            {
                WithDraw   withdraw = new WithDraw(amount, acc);
                IOperation oper     = withdraw;

                acc.DoOperation(oper);
                acc.GetHistory().AddToHistory(withdraw);
                return(true);
            }
        }
Exemplo n.º 11
0
 public void execute(CAccount acc)
 {
     acc.substrMoney(amount);
 }
Exemplo n.º 12
0
 public void AddAccount(CAccount acc)
 {
     accounts.Add(acc);
 }
Exemplo n.º 13
0
 public void execute(CAccount acc)
 {
     acc.addMoney(amount);
     date = DateTime.Now;
 }