GreaterThan() 공개 메소드

public GreaterThan ( int limit ) : bool
limit int
리턴 bool
 public Transfer MakeTransfer(string counterAccount, Money amount) {
     // 1. Check withdrawal limit:
     if (amount.GreaterThan(this.transferLimit)) {
         throw new BusinessException("Limit exceeded!");
     }
     if (Accounts.IsValid(counterAccount)) { // <1>
         // 2. Look up counter account and make transfer object:
         CheckingAccount acct = Accounts.FindAcctByNumber(counterAccount);
         Transfer result = new Transfer(this, acct, amount); // <2>
         return result;
     } else {
         throw new BusinessException("Invalid account number!");
     }
 }
 public Transfer MakeTransfer(String counterAccount, Money amount) {
     // 1. Check withdrawal limit:
     if (amount.GreaterThan(this.transferLimit)) {
         throw new BusinessException("Limit exceeded!");
     }
     // 2. Assuming result is 9-digit bank account number, validate 11-test:
     int sum = 0;
     for (int i = 0; i < counterAccount.Length; i++) {
         sum = sum + (9 - i) * (int)Char.GetNumericValue(
             counterAccount[i]);
     }
     if (sum % 11 == 0) {
         // 3. Look up counter account and make transfer object:
         CheckingAccount acct = Accounts.FindAcctByNumber(counterAccount);
         Transfer result = new Transfer(this, acct, amount);
         return result;
     } else {
         throw new BusinessException("Invalid account number!");
     }
 }
 public override Transfer MakeTransfer(string counterAccount, Money amount) {
     if (amount.GreaterThan(this.transferLimit)) {
         throw new BusinessException("Limit exceeded!");
     }
     return base.MakeTransfer(counterAccount, amount);
 }