Пример #1
0
 public static void MonthlyDeposit(TypeTwoAccount account, double amount)
 {
     if (!account.Active)
     {
         throw new Exception(ErrorMessage.InactiveAccount);
     }
     if (amount <= 0)
     {
         throw new Exception(ErrorMessage.InvalidAmount);
     }
 }
Пример #2
0
 public static Account CreateAccount(int accountType, ulong accountID, Customer owner, DateTime openedDate, double initBalance = 0)
 {
     try
     {
         Validation.OpenedDate(openedDate);
         if (accountType == 1)
         {
             return(TypeOneAccount.CreateTypeOneAccount(accountID, owner, openedDate, initBalance));
         }
         else if (accountType == 2)
         {
             return(TypeTwoAccount.CreateTypeTwoAccount(accountID, owner, openedDate, initBalance));
         }
         else
         {
             throw new Exception(ErrorMessage.InvalidAccountType);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }