public static void MonthlyDeposit(TypeTwoAccount account, double amount) { if (!account.Active) { throw new Exception(ErrorMessage.InactiveAccount); } if (amount <= 0) { throw new Exception(ErrorMessage.InvalidAmount); } }
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; } }