Beispiel #1
0
 public static bool IsValid(string sBIC)
 {
     if (sBIC == null)
     {
         return(false);
     }
     if ((sBIC.Length != 8) && (sBIC.Length != 11))
     {
         return(false);
     }
     if (!SepaUtil.IsAlpha(sBIC.Substring(0, 6)))
     {
         return(false);
     }
     if (!SepaUtil.IsAlphaNumeric(sBIC.Substring(6)))
     {
         return(false);
     }
     return(true);
 }
Beispiel #2
0
 public SepaIBAN(string sCountryCode, string sBankCode, string sAcctNo)
 {
     if ((sCountryCode == null) || (sAcctNo == null))
     {
         throw new ArgumentNullException();
     }
     if (sBankCode == null)
     {
         sBankCode = "";
     }
     if ((((sCountryCode.Length != 2) || !SepaUtil.IsAlpha(sCountryCode)) || (!SepaUtil.IsAlphaNumeric(sBankCode) || (sAcctNo.Length == 0))) || (!SepaUtil.IsAlphaNumeric(sAcctNo) || ((sBankCode.Length + sAcctNo.Length) > 30)))
     {
         throw new ArgumentException();
     }
     if (sCountryCode == "DE")
     {
         if ((!SepaUtil.IsNumeric(sBankCode) || (sBankCode.Length != 8)) || (!SepaUtil.IsNumeric(sAcctNo) || (sAcctNo.Length > 10)))
         {
             throw new ArgumentException();
         }
         sAcctNo = sAcctNo.PadLeft(10, '0');
     }
     this.f_sIBAN = SepaUtil.BuildID(sCountryCode, sBankCode + sAcctNo);
 }