/// <summary> /// This method returns the telephone numbers for digital telephone service for a statement. /// </summary> /// <param name="accountNumber13"></param> /// <param name="phoneNumber"></param> /// <returns></returns> public string InquireStatementCode( [RequiredItem()][StringLength(13, 13)][CustomerAccountNumber()] string accountNumber13, [RequiredItem()][StringLength(4, 4)] string phoneNumber) { BillingLogEntry logEntry = new BillingLogEntry(eBillingActivityType.StatementCodeInquiry, accountNumber13, phoneNumber); using (Log log = CreateLog(logEntry)) { try { // validate the parameters. MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber13, phoneNumber); validator.Validate(); // convert the accountNumber. CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter( typeof(CustomerAccountNumber)).ConvertFrom(accountNumber13); // get the siteid/sitecode information PopulateSiteInfo(accountNumber); logEntry.SiteId = this.SiteId; // use dal to get statement code string statementCode = null; DalAccount dalAccount = new DalAccount(); statementCode = dalAccount.GetStatementCode(SiteId, SiteCode, accountNumber.AccountNumber9, phoneNumber); // if no statement code is found throw ex if (statementCode == null || statementCode == string.Empty) { throw new InvalidAccountNumberException( string.Format(__noStatementCodeForAccountExceptionMessage, accountNumber.AccountNumber13, phoneNumber)); } return(statementCode.PadLeft(3, '0')); } catch (ValidationException ve) { logEntry.SetError(new ExceptionFormatter(ve).Format()); throw; } catch (BusinessLogicLayerException blle) { logEntry.SetError(new ExceptionFormatter(blle).Format()); throw; } catch (Exception e) { logEntry.SetError(new ExceptionFormatter(e).Format()); throw new UnexpectedSystemException(e); } } }