示例#1
0
        public decimal capitalize(CAccount acc)
        {
            decimal temp = acc.GetSaldo();

            temp += temp * this.interest;
            return(temp);
        }
示例#2
0
 public WithDraw(decimal amount, CAccount acc)
 {
     this.operationType = "WITHDRAW";
     this.amount        = amount;
     this.sourceID      = acc.GetAccID();
     this.destinationID = -1;
 }
示例#3
0
 public void execute(CAccount from)
 {
     if (from.substrMoney(amount))
     {
         dest.addMoney(amount);
     }
 }
示例#4
0
 public PayIn(decimal amount, CAccount dest)
 {
     this.operationType = "PAYIN";
     this.amount        = amount;
     this.destinationID = dest.GetAccID();
     this.sourceID      = -1;
 }
示例#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);
        }
示例#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();
 }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
            }
        }
示例#11
0
 public void execute(CAccount acc)
 {
     acc.substrMoney(amount);
 }
示例#12
0
 public void AddAccount(CAccount acc)
 {
     accounts.Add(acc);
 }
示例#13
0
 public void execute(CAccount acc)
 {
     acc.addMoney(amount);
     date = DateTime.Now;
 }