Beispiel #1
0
 public async Task <DbResponse> RunScriptAsync(string scriptText)
 {
     if (_account.canRunScript(scriptText))
     {
         var res = _account.RunScript(scriptText);
         _account.Accept(new ReportTXT());
         return(res);
     }
     return(new DbResponse()
     {
         Message = "Access denied",
         Table = ""
     });
 }
Beispiel #2
0
        public static void Main()
        {
            Bank bank = new Bank();
            Account jhonAccount = new Account("0000121", "Jhon Doe", 10000m);
            Account fooAccount = new Account("0000169", "Foo", 2000m);

            bank.AddAccount(jhonAccount);
            bank.AddAccount(fooAccount);

            jhonAccount.Accept(new DepositVisitor(400m));

            bank.Accept(new RemunerationAccountVisitor());
            bank.Accept(new WithDrawVisitor(100m));
            bank.Accept(new LogVisitor());
        }
 public override void PayInterest()
 {
     _account.Accept(new InterestVisitor());
 }