Beispiel #1
0
        /// <summary>
        /// The default constructor
        /// </summary>
        /// <param name="userName"></param>
        public BllBase([RequiredItem()] string userName)
        {
            ConstructorValidator validator = new ConstructorValidator(
                MethodBase.GetCurrentMethod(), userName);

            validator.Validate();
            _userName = userName;
            try
            {
                // get userInformation
                DalUser dalUser = new DalUser();
                _userId = dalUser.GetUserId(this.UserName);
            }
            catch (Exception e)
            {
                // throw this if we cannot access the Dal.
                throw new Exceptions.DataSourceUnavailableException(e);
            }
        }
Beispiel #2
0
        /// <summary>
        /// This is the primary constructor for this class. The username is
        /// passed to the base class BllConnectionManager to allow for CM
        /// credentials population.
        /// </summary>
        /// <param name="strUserName">
        /// This username is passed to the base class BllConnection Manager
        /// to populate CM credentials.
        /// </param>
        /// <param name="strAccountNumber16">
        /// This account number is used to query site information by the base
        /// class BllCustomer.
        /// </param>
        public Payment([RequiredItem()] string strUserName,
                       [RequiredItem()][StringLength(16, 16)][CustomerAccountNumber()] string strAccountNumber16)
            : base(strUserName)
        {
            // validate the parameters.
            ConstructorValidator validator = new ConstructorValidator(ConstructorInfo.GetCurrentMethod(), strUserName, strAccountNumber16);

            validator.Validate();

            // convert the accountNumber.
            m_can = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                typeof(CustomerAccountNumber)).ConvertFrom(strAccountNumber16);
            // NOTE: This is a fix to work around a Connection Manager bug.
            // When an account number has statement code equal to "000," this
            // causes Connection Manger to blow up for the entire site and
            // return the error message similar to "Cannot start IGI
            // interface". We are now kicking these references out here.
            if ("000" == m_can.StatementCode)
            {
                throw new InvalidStatementCodeException();
            }
            // Initialize the service agent
            CreateProxy(m_can);
        }