Exemplo n.º 1
0
        public void Employee_HasRequiredMembers()
        {
            Type type = typeof(Employee);

            PropertyInfo prop = type.GetProperty("EmployeeId");

            PropertyValidator.ValidateReadPrivateWrite(prop, "EmployeeId", typeof(int));

            prop = type.GetProperty("FirstName");
            PropertyValidator.ValidateReadPrivateWrite(prop, "FirstName", typeof(string));

            prop = type.GetProperty("LastName");
            PropertyValidator.ValidateReadWrite(prop, "LastName", typeof(string));

            prop = type.GetProperty("FullName");
            PropertyValidator.ValidateReadOnly(prop, "FullName", typeof(string));

            prop = type.GetProperty("Department");
            PropertyValidator.ValidateReadWrite(prop, "Department", typeof(string));

            prop = type.GetProperty("AnnualSalary");
            PropertyValidator.ValidateReadPrivateWrite(prop, "AnnualSalary", typeof(double));

            MethodInfo method = type.GetMethod("RaiseSalary");

            MethodValidator.ValidatePublicMethod(method, "RaiseSalary", typeof(void));
        }
        public Result <List <Method> > CreateMethods(CreateMethods createMethods)
        {
            List <Method> methods = createMethods.Methods.Select(m =>
                                                                 new Method(m.Creator, m.Name, m.ApplicationRate)).ToList();

            MethodValidator methodValidator = new MethodValidator();
            List <string>   errors          = new List <string>();

            foreach (var method in methods)
            {
                var validationResult = methodValidator.Validate(method);

                if (!validationResult.IsValid)
                {
                    errors.AddRange(validationResult.Errors.Select(e => e.ToString()));
                }
            }

            if (errors.Count() > 0)
            {
                return(Result.Fail <List <Method> >(string.Join(" ", errors)));
            }

            foreach (var method in methods)
            {
                method.SetId(++lastIdValue);
                methodsMemoryDatabase.Add(method);
            }

            return(Result.Ok <List <Method> >(methods));
        }
Exemplo n.º 3
0
        public void Elevator_HasRequiredMembers()
        {
            Type     type     = typeof(Elevator);
            Elevator elevator = (Elevator)Activator.CreateInstance(type, 3);

            PropertyInfo prop = type.GetProperty("CurrentLevel");

            PropertyValidator.ValidateReadOnly(prop, "CurrentLevel", typeof(int));

            prop = type.GetProperty("NumberOfLevels");
            PropertyValidator.ValidateReadOnly(prop, "NumberOfLevels", typeof(int));

            prop = type.GetProperty("DoorIsOpen");
            PropertyValidator.ValidateReadOnly(prop, "DoorIsOpen", typeof(bool));

            MethodInfo method = type.GetMethod("OpenDoor");

            MethodValidator.ValidatePublicMethod(method, "OpenDoor", typeof(void));

            method = type.GetMethod("CloseDoor");
            MethodValidator.ValidatePublicMethod(method, "CloseDoor", typeof(void));

            method = type.GetMethod("GoUp");
            MethodValidator.ValidatePublicMethod(method, "GoUp", typeof(void));
            Assert.AreEqual(1, method.GetParameters().Length, "GoUp should accept 1 parameter");

            method = type.GetMethod("GoDown");
            MethodValidator.ValidatePublicMethod(method, "GoDown", typeof(void));
            Assert.AreEqual(1, method.GetParameters().Length, "GoDown should accept 1 parameter");
        }
        public void Airplane_HasRequiredMembers()
        {
            Type     type     = typeof(Airplane);
            Airplane Airplane = (Airplane)Activator.CreateInstance(type, "ABC123", 2, 3);

            PropertyInfo prop = type.GetProperty("PlaneNumber");

            PropertyValidator.ValidateReadOnly(prop, "PlaneNumber", typeof(string));

            prop = type.GetProperty("BookedFirstClassSeats");
            PropertyValidator.ValidateReadOnly(prop, "BookedFirstClassSeats", typeof(int));

            prop = type.GetProperty("AvailableFirstClassSeats");
            PropertyValidator.ValidateReadOnly(prop, "AvailableFirstClassSeats", typeof(int));

            prop = type.GetProperty("TotalFirstClassSeats");
            PropertyValidator.ValidateReadOnly(prop, "TotalFirstClassSeats", typeof(int));


            prop = type.GetProperty("BookedCoachSeats");
            PropertyValidator.ValidateReadOnly(prop, "BookedCoachSeats", typeof(int));

            prop = type.GetProperty("AvailableCoachSeats");
            PropertyValidator.ValidateReadOnly(prop, "AvailableCoachSeats", typeof(int));

            prop = type.GetProperty("TotalCoachSeats");
            PropertyValidator.ValidateReadOnly(prop, "TotalCoachSeats", typeof(int));

            MethodInfo method = type.GetMethod("ReserveSeats");

            MethodValidator.ValidatePublicMethod(method, "ReserveSeats", typeof(bool));
        }
Exemplo n.º 5
0
        public void ValidateRegexTest()
        {
            IMethod m = new MockMethod();
            var dict = new JsonDictionary { { "name", "test" }, { "pattern", ".+" } };

            var p = ServiceFactory.Default.CreateParameter("test", dict);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);
            Assert.IsTrue(validator.ValidateRegex(p, "Test"));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Validates the debit card number against the BIN file
        /// </summary>
        /// <param name="debitCardNumber"></param>
        /// <returns></returns>
        public bool IsDebitCardNumberValid(
            [RequiredItem()][RegEx(@"^\d{12,19}$", RegexOptions.None)] string debitCardNumber)
        {
            //Validate the arguments
            MethodValidator validator = new MethodValidator(
                MethodBase.GetCurrentMethod(), debitCardNumber);

            validator.Validate();

            return(_IsDebitCardNumberValid(debitCardNumber));
        }
Exemplo n.º 7
0
        public void ValidateRegexTest()
        {
            IMethod m = new MockMethod();
            var dict = new JsonDictionary { { "name", "test" }, { "pattern", ".+" } };

            var jsonObj = new KeyValuePair<string, object>("test", dict);

            var p = new ParameterFactory.BaseParameter(jsonObj);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);
            Assert.IsTrue(validator.ValidateRegex(p, "Test"));
        }
        /// <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);
                }
            }
        }
        public void ValidateRegexTest()
        {
            IMethod m    = new MockMethod();
            var     dict = new JsonDictionary {
                { "name", "test" }, { "pattern", ".+" }
            };

            var p         = ServiceFactory.Default.CreateParameter("test", dict);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);

            Assert.IsTrue(validator.ValidateRegex(p, "Test"));
        }
Exemplo n.º 10
0
        /// <summary>
        /// This method returns the account address information for the given Phone Number.
        /// </summary>
        /// <param name="phoneNumber10"></param>
        /// <returns></returns>
        public List <CustomerContactInformation> getAccountAddressesbyPhoneNumber(
            [RequiredItem()][StringLength(10, 10)][RegEx(@"\d{10}", RegexOptions.Compiled)] string phoneNumber10,
            bool getNeverAndFormerAsWell)
        {
            //create log and begin logging
            CustomerAccountLogEntry logEntry = new CustomerAccountLogEntry(eCustomerAccountActivityType.GetCustomerAccountInformation, phoneNumber10);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    //Assigned note property of logEntry object to log the phonenumber10 on 4-Feb-2010
                    logEntry.Note = "PhoneNumber10:" + phoneNumber10;
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), phoneNumber10);
                    validator.Validate();
                    try
                    {
                        if (Convert.ToUInt64(phoneNumber10) == 0)
                        {
                            throw new Exception();
                        }
                    }
                    catch
                    {
                        throw new ValidationException("Invalid PhoneNumber");
                    }

                    // setup the return
                    List <CustomerContactInformation> contactInformation = new List <CustomerContactInformation>();
                    CustomerAccountInfo.MultipleReturns(contactInformation, phoneNumber10, getNeverAndFormerAsWell);
                    return(contactInformation);
                }
                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);
                }
            }
        }
        //[23-02-2009] End Changes for improving performance of CustomerAccount service

        #endregion ctors

        #region inquireAccount
        /// <summary>
        /// This method returns account and statement information for the given account.
        /// </summary>
        /// <param name="accountNumber13"></param>
        /// <returns></returns>
        public Account InquireAccount([RequiredItem()][StringLength(13, 13)][CustomerAccountNumberAttribute()] string accountNumber13)
        {
            BillingLogEntry logEntry = new BillingLogEntry(eBillingActivityType.AccountInquiry, accountNumber13 != null?accountNumber13.PadLeft(16, '0'):string.Empty);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber13);
                    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;

                    // setup return
                    Account account = new Account();

                    // setup adapter and fill account object.
                    AccountAdapter adapter = new AccountAdapter(accountNumber, _userName, _siteId, _siteCode);
                    adapter.Fill(account);

                    //set the AllowOnlineOrdering flag
                    SetAllowOnlineOrderingFlag(ref account);

                    // all done.
                    return(account);
                }
                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);
                }
            }
        }
Exemplo n.º 12
0
        public void ValidateRegexTest()
        {
            IMethod m    = new MockMethod();
            var     dict = new JsonDictionary {
                { "name", "test" }, { "pattern", ".+" }
            };

            var jsonObj = new KeyValuePair <string, object>("test", dict);


            var p         = new ParameterFactory.BaseParameter(jsonObj);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);

            Assert.IsTrue(validator.ValidateRegex(p, "Test"));
        }
        /// <summary>
        /// This method returns the account address information for the given account.
        /// </summary>
        /// <param name="accountNumber13"></param>
        /// <returns></returns>
        public AccountAddress InquireServiceAddress(
            [RequiredItem()][StringLength(13, 13)]
            [CustomerAccountNumber()] string accountNumber13)
        {
            BillingLogEntry logEntry = new BillingLogEntry(
                eBillingActivityType.AccountAddress,
                accountNumber13.PadLeft(16, '0'));

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber13);
                    validator.Validate();

                    // convert the accountNumber.
                    CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                        typeof(CustomerAccountNumber)).ConvertFrom(accountNumber13);

                    // setup site information.
                    PopulateSiteInfo(accountNumber);
                    logEntry.SiteId = SiteId;

                    // setup the return
                    AccountAddress accountAddress = new AccountAddress();
                    AccountAdapter adapter        = new AccountAdapter(accountNumber, _userName, _siteId, _siteCode);
                    adapter.Fill(accountAddress);
                    return(accountAddress);
                }
                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);
                }
            }
        }
        public Result <Method> CreateMethod(CreateMethod createMethod)
        {
            Method method = new Method(createMethod.Creator, createMethod.Name, createMethod.ApplicationRate);

            MethodValidator methodValidator  = new MethodValidator();
            var             validationResult = methodValidator.Validate(method);

            if (!validationResult.IsValid)
            {
                return(Result.Fail <Method>(string.Join(" ", validationResult.Errors)));
            }

            method.SetId(++lastIdValue);
            methodsMemoryDatabase.Add(method);

            return(Result.Ok <Method>(method));
        }
Exemplo n.º 15
0
        public void ValidateEnumNullTest()
        {
            IMethod m = new MockMethod();
            var dict = new JsonDictionary { { "name", "test" } };

            // Create the parameter.
            var p = ServiceFactory.Default.CreateParameter("test", dict);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);

            // Confirm that the method validates enumerations correctly.
            Assert.IsTrue(validator.ValidateEnum(p, "one"));
            Assert.IsTrue(validator.ValidateEnum(p, "two"));
            Assert.IsTrue(validator.ValidateEnum(p, "three"));
            Assert.IsTrue(validator.ValidateEnum(p, "One"));
            Assert.IsTrue(validator.ValidateEnum(p, ""));
        }
Exemplo n.º 16
0
        /// <summary>GetCustomerAcount</summary>
        /// <param name="siteId">Site Id for the customer</param>
        /// <param name="accountNumber9">9 digit customer account</param>
        /// <returns><CategoryActiveOutage></returns>
        public CustomerAccountProfile GetCustomerAcount(
            [RequiredItem()][SiteId()] int siteId,
            [RequiredItem()][RegEx(@"^(\d{7}(?<=\d*?[1-9]{1}\d*?)(?=\d*?[1-9]{1}\d*?)\d{2})?$", RegexOptions.None)] string accountNumber9)
        {
            //create log and begin logging
            CustomerAccountLogEntry logEntry = new CustomerAccountLogEntry(eCustomerAccountActivityType.GetCustomerAccountByAccountNumberAndSiteId, siteId, accountNumber9);

            using (Log log = CreateLog(logEntry))

                try
                {
                    //perform validation
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), siteId, accountNumber9);
                    validator.Validate();

                    //start changes for activity logging on 4-Feb-2010
                    logEntry.SiteId = siteId;
                    //get a data access obj to work with
                    CustomerAccountProfile customerAccountProfile = GetCustomerAccountProfile(siteId, accountNumber9);
                    //End changes for activity logging on 4-Feb-2010
                    // Changes for Self Reg **END**//
                    return(customerAccountProfile);
                }
                catch (ValidationException vex)
                {
                    logEntry.SetError(new ExceptionFormatter(vex).Format());
                    throw vex;
                }
            catch (BusinessLogicLayerException bllex)
            {
                logEntry.SetError(new ExceptionFormatter(bllex).Format());
                throw bllex;
            }
            catch (DataSourceException dse)
            {
                logEntry.SetError(new ExceptionFormatter(dse).Format());
                throw new DataSourceUnavailableException(dse);
            }
            catch (Exception e)
            {
                logEntry.SetError(new ExceptionFormatter(e).Format());
                //need to convert to bll exception
                throw new UnexpectedSystemException(e);
            }
        }
Exemplo n.º 17
0
        public void ValidateEnumNullTest()
        {
            IMethod m = new MockMethod();
            var dict = new JsonDictionary { { "name", "test" } };

            // Create the parameter.
            var jsonObj = new KeyValuePair<string, object>("test", dict);
            var p = new ParameterFactory.BaseParameter(jsonObj);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);

            // Confirm that the method validates enumerations correctly.
            Assert.IsTrue(validator.ValidateEnum(p, "one"));
            Assert.IsTrue(validator.ValidateEnum(p, "two"));
            Assert.IsTrue(validator.ValidateEnum(p, "three"));
            Assert.IsTrue(validator.ValidateEnum(p, "One"));
            Assert.IsTrue(validator.ValidateEnum(p, ""));
        }
        public void ValidateEnumNullTest()
        {
            IMethod m    = new MockMethod();
            var     dict = new JsonDictionary {
                { "name", "test" }
            };

            // Create the parameter.
            var p         = ServiceFactory.Default.CreateParameter("test", dict);
            var inputData = new ParameterCollection();
            var validator = new MethodValidator(m, inputData);

            // Confirm that the method validates enumerations correctly.
            Assert.IsTrue(validator.ValidateEnum(p, "one"));
            Assert.IsTrue(validator.ValidateEnum(p, "two"));
            Assert.IsTrue(validator.ValidateEnum(p, "three"));
            Assert.IsTrue(validator.ValidateEnum(p, "One"));
            Assert.IsTrue(validator.ValidateEnum(p, ""));
        }
Exemplo n.º 19
0
        //[02-02-09] Start Changes for Q-matic

        #region GetCustomerAccountByAccountNumber

        /// <summary>
        ///
        /// </summary>
        /// <param name="accountNumber13"></param>
        /// <returns></returns>
        public CustomerAccountProfile GetCustomerAccountByAccountNumber([RequiredItem()][StringLength(13, 13)][CustomerAccountNumberAttribute()] string accountNumber13)
        {
            //create log and begin logging
            CustomerAccountLogEntry logEntry = new CustomerAccountLogEntry();

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    logEntry.CustomerAccountActivityType =
                        eCustomerAccountActivityType.GetCustomerAccountByAccountNumber;
                    logEntry.CustomerAccountNumber = accountNumber13;
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber13);
                    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;
                    string accountNumber9 = accountNumber13.Substring(4);
                    return(GetCustomerAccountProfile(SiteId, accountNumber9));
                }
                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);
                }
            }
        }
        /// <summary>
        /// This method updates the given account with the correct BillingOption code.
        /// </summary>
        /// <param name="accountNumber16"></param>
        /// <param name="billingOption"></param>
        public void UpdateBillingOption(
            [RequiredItem()][CustomerAccountNumber()] string accountNumber16,
            [RequiredItem()] eBillingOption billingOption)
        {
            BillingLogEntry logEntry = new BillingLogEntry(
                eBillingActivityType.UpdateBillOption,
                accountNumber16);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber16, billingOption);
                    validator.Validate();

                    // convert the accountNumber.
                    CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                        typeof(CustomerAccountNumber)).ConvertFrom(accountNumber16);

                    // create the proxy
                    CreateProxy(accountNumber);
                    logEntry.SiteId = SiteId;

                    // invoke it. if an error occurs, one will be thrown.
                    Invoke((Request.STOPPB) new StopPbHelper(_siteId.ToString(),
                                                             accountNumber.AccountNumber9, new SpbHelper(
                                                                 toInt32(accountNumber.StatementCode),
                                                                 (int)billingOption, eSpbFunctionAction.Add)));
                }
                catch (CmErrorException eCm)
                {
                    logEntry.SetError(eCm.Message, eCm.ErrorCode);
                    throw TranslateCmException(eCm);
                }
                catch (Exception e)
                {
                    logEntry.SetError(e.Message);
                    throw;
                }
            }
        }
        public void Television_HasRequiredMembers()
        {
            Type       type = typeof(Television);
            Television tv   = (Television)Activator.CreateInstance(type);

            PropertyInfo prop = type.GetProperty("IsOn");

            PropertyValidator.ValidateReadPrivateWrite(prop, "IsOn", typeof(bool));

            prop = type.GetProperty("CurrentChannel");
            PropertyValidator.ValidateReadPrivateWrite(prop, "CurrentChannel", typeof(int));

            prop = type.GetProperty("CurrentVolume");
            PropertyValidator.ValidateReadPrivateWrite(prop, "CurrentVolume", typeof(int));

            MethodInfo method = type.GetMethod("TurnOff");

            MethodValidator.ValidatePublicMethod(method, "TurnOff", typeof(void));

            method = type.GetMethod("TurnOn");
            MethodValidator.ValidatePublicMethod(method, "TurnOn", typeof(void));

            method = type.GetMethod("ChangeChannel");
            MethodValidator.ValidatePublicMethod(method, "ChangeChannel", typeof(void));
            Assert.AreEqual(1, method.GetParameters().Length, "ChangeChannel should accept 1 parameter");

            method = type.GetMethod("ChannelUp");
            MethodValidator.ValidatePublicMethod(method, "ChannelUp", typeof(void));

            method = type.GetMethod("ChannelDown");
            MethodValidator.ValidatePublicMethod(method, "ChannelDown", typeof(void));

            method = type.GetMethod("RaiseVolume");
            MethodValidator.ValidatePublicMethod(method, "RaiseVolume", typeof(void));

            method = type.GetMethod("LowerVolume");
            MethodValidator.ValidatePublicMethod(method, "LowerVolume", typeof(void));
        }
Exemplo n.º 22
0
        /// <summary>
        /// Common initialization routine
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="mopCode"></param>
        protected void construct([RequiredItem()] string userName, int mopCode)
        {
            // default to unknown
            _paymentType = ePaymentType.Unknown;

            // load validator to validate if the call is valid. if it's not
            // do not throw an error, in other words, just use IsValid().
            MethodValidator validator = new MethodValidator(
                MethodBase.GetCurrentMethod(), userName, mopCode);

            if (validator.IsValid())
            {
                _userName = userName;
                // Test for negative value or zero... these are invalid
                if (mopCode > 0)
                {
                    try
                    {
                        // Now translate it using DAL
                        DalMethodOfPayment dalMop = new DalMethodOfPayment();
                        // get the integer value
                        int paymentType = dalMop.GetPaymentTypeByUserMop(userName, mopCode);
                        // set internal enumerated type
                        _paymentType = (ePaymentType)TypeDescriptor.GetConverter(typeof(
                                                                                     ePaymentType)).ConvertFrom(paymentType);;
                    }                     // try
                    catch                 //( Exception ex )
                    {
                        // Publish to allow support staff to correct the problem
                        // throw away exceptions because we have already set
                        // _paymentType = Unknown
                        //ExceptionManager.Publish( ex );
                    }
                }
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action <IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);

            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            // Begin a new request and when it is completed being assembled, execute it asynchronously.
            CreateWebRequest((request) =>
            {
                // When the request is completed constructing, execute it.
                var state = new AsyncExecutionState()
                {
                    ResponseHandler = responseHandler,
                    Try             = 1,
                    WaitTime        = RetryInitialWaitTime,
                    CurrentRequest  = request
                };
                InternalBeginExecuteRequest(state);
            });
        }
Exemplo n.º 24
0
        /// <summary>
        /// This method returns the account address information for the given Phone Number.
        /// </summary>
        /// <param name="phoneNumber10"></param>
        /// <param name="streetNumber"></param>
        /// <returns></returns>
        public CustomerAccountProfile GetCustomerAccountByPhoneNbrAndStreetNbr([RequiredItem()][StringLength(10, 10)][RegEx(@"\d{10}", RegexOptions.Compiled)] string phoneNumber10
                                                                               , string streetNumber)
        {
            //create log and begin logging
            CustomerAccountLogEntry logEntry = new CustomerAccountLogEntry(eCustomerAccountActivityType.GetCustomerAccountByPhoneNbrAndStreetNbr, phoneNumber10, streetNumber);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    logEntry.Note = "phoneNumber10:" + phoneNumber10 + " and street#:" + streetNumber;
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), phoneNumber10);
                    validator.Validate();
                    try
                    {
                        if (Convert.ToUInt64(phoneNumber10) == 0)
                        {
                            throw new ValidationException();
                        }
                    }
                    catch
                    {
                        throw new ValidationException("Invalid Phonenumber");
                    }

                    //create dal to get customer accounts for given phone number ad street address
                    DalCustomerPhone dalCustomerPhone = new DalCustomerPhone();
                    CustomerAccountProfileSchema.AccountMatchesDataTable accountMatches = dalCustomerPhone.GetCustomerAccountMatches(phoneNumber10, streetNumber);

                    if (String.IsNullOrEmpty(streetNumber))
                    {
                        if (accountMatches.Rows.Count > 1)
                        {
                            throw new MultipleMatchsFoundException(String.Format(_multipleMatchesWithPhoneOnly, phoneNumber10));
                        }
                        else if (accountMatches.Rows.Count == 0)
                        {
                            throw new NoMatchFoundException(String.Format(_noMatchWithPhoneOnly, phoneNumber10));
                        }
                        else
                        {
                            return(GetCustomerAccountProfile(accountMatches[0].Site_ID,
                                                             accountMatches[0].Account_Number));
                        }
                    }
                    else
                    {
                        if (accountMatches.Rows.Count > 1)
                        {
                            throw new MultipleMatchsFoundException(String.Format(_multipleMatchesWithStreet, phoneNumber10, streetNumber));
                        }
                        else if (accountMatches.Rows.Count == 0)
                        {
                            throw new NoMatchFoundException(String.Format(_noMatchWithStreet, phoneNumber10, streetNumber));
                        }
                        else
                        {
                            return(GetCustomerAccountProfile(accountMatches[0].Site_ID,
                                                             accountMatches[0].Account_Number));
                        }
                    }
                }
                catch (ValidationException ve)
                {
                    logEntry.SetError(new ExceptionFormatter(ve).Format());
                    throw;
                }
                catch (InvalidAccountNumberException)
                {
                    logEntry.SetError(new ExceptionFormatter(new NoMatchFoundException(String.Format(_noMatchWithPhoneOnly, phoneNumber10))).Format());
                    throw new NoMatchFoundException(String.Format(_noMatchWithPhoneOnly, phoneNumber10));
                }
                catch (BusinessLogicLayerException blle)
                {
                    logEntry.SetError(new ExceptionFormatter(blle).Format());
                    throw;
                }
                catch (Exception e)
                {
                    logEntry.SetError(new ExceptionFormatter(e).Format());
                    throw new UnexpectedSystemException(e);
                }
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action<IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);
            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            // Begin a new request and when it is completed being assembled, execute it asynchronously.
            CreateWebRequest((request) =>
            {
                // When the request is completed constructing, execute it.
                var state = new AsyncExecutionState()
                {
                    ResponseHandler = responseHandler,
                    Try = 1,
                    WaitTime = RetryInitialWaitTime,
                    CurrentRequest = request
                };
                InternalBeginExecuteRequest(state);
            });
        }
Exemplo n.º 26
0
 public ValidationResponse ConsultarFacturaUNODOS()
 {
     return(MethodValidator.ValidateBusinessMethod(CallBack().ConsultarFacturaUNODOSCallBack));
 }
Exemplo n.º 27
0
 public ValidationResponse ConsultarBoletaTRES()
 {
     return(MethodValidator.ValidateBusinessMethod(CallBack().ConsultarBoletaTRESCallBack));
 }
Exemplo n.º 28
0
 public ValidationResponse ConsultarPendiente()
 {
     return(MethodValidator.ValidateBusinessMethod(CallBack().ConsultarPendienteCallBack));
 }
        /// <summary>
        /// This method returns the StatementActivity for the given account
        /// since the last statement.
        /// </summary>
        /// <param name="accountNumber16"></param>
        /// <returns></returns>
        public StatementActivity InquireStatementActivity(
            [RequiredItem()][StringLength(16, 16)]
            [CustomerAccountNumber()] string accountNumber16)
        {
            BillingLogEntry logEntry = new BillingLogEntry(
                eBillingActivityType.StatementActivity, accountNumber16);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber16);
                    validator.Validate();
                    // convert the accountNumber.
                    CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                        typeof(CustomerAccountNumber)).ConvertFrom(accountNumber16);

                    // setup the return
                    StatementActivity statementActivity = new StatementActivity();
                    statementActivity.AccountNumber16 = accountNumber.AccountNumber16;
                    statementActivity.StatementCode   = accountNumber.StatementCode;

                    // create proxy
                    CreateProxy(accountNumber);

                    // get the sitecode/siteId information
                    // NOTE: CreateProxy above populates enough data for this
                    // purpose as well
                    logEntry.SiteId = SiteId;

                    // get ACSUM from proxy
                    Response.MAC00010 mac10Output =
                        (Response.MAC00010) this.Invoke(
                            (Request.MAC00010)
                            new Mac00010Helper(
                                SiteId.ToString(),
                                accountNumber.AccountNumber9,
                                accountNumber.StatementCode));

                    if (mac10Output.Items != null)
                    {
                        foreach (object item in mac10Output.Items)
                        {
                            if (item is Response.INL00008)
                            {
                                Response.INL00008 inline8     = (Response.INL00008)item;
                                Transaction       transaction = new Transaction();
                                transaction.Amount          = toDouble(inline8.TRNSCTNAMNT);
                                transaction.Description     = inline8.DETLDSCRPTN;
                                transaction.FromDate        = new IcomsDate(inline8.TRNSCTNFROMDATE8).Date;
                                transaction.ToDate          = new IcomsDate(inline8.TRNSCTNTODATE8).Date;
                                transaction.TransactionType = (eTransactionType)TypeDescriptor.GetConverter(typeof(
                                                                                                                eTransactionType)).ConvertFrom(inline8.TRNSCTNTYPE);;
                                transaction.ServiceCategory = (eServiceCategory)TypeDescriptor.GetConverter(typeof(
                                                                                                                eServiceCategory)).ConvertFrom(inline8.SRVCCTGRY);;
                                statementActivity.Transactions.Add(transaction);
                            }
                        }
                    }
                    // all done.
                    return(statementActivity);
                }
                catch (ValidationException ve)
                {
                    logEntry.SetError(new ExceptionFormatter(ve).Format());
                    throw;
                }
                catch (BusinessLogicLayerException blle)
                {
                    logEntry.SetError(new ExceptionFormatter(blle).Format());
                    throw;
                }
                catch (CmErrorException eCm)
                {
                    logEntry.SetError(eCm.Message, eCm.ErrorCode);
                    throw TranslateCmException(eCm);
                }
                catch (Exception e)
                {
                    logEntry.SetError(new ExceptionFormatter(e).Format());
                    throw new UnexpectedSystemException(e);
                }
            }
        }
        /// <summary>
        /// This method returns account and statement information for the given account.
        /// </summary>
        /// <param name="siteId"></param>
        /// <param name="setTopBoxId"></param>
        /// <returns></returns>
        public Account InquireAccount([RequiredItem()] int siteId, [RequiredItem()][StringLength(1, 16)] string setTopBoxId)
        {
            BillingLogEntry logEntry = new BillingLogEntry(eBillingActivityType.AccountInquiry, siteId, setTopBoxId);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), siteId, setTopBoxId);
                    validator.Validate();

                    //look up the sitecode
                    string siteCode = DalSiteCode.Instance.GetSiteCode(siteId);

                    //get account number
                    string       accountNumber9 = null;
                    DalEquipment dalEquipment   = new DalEquipment();
                    accountNumber9 = dalEquipment.GetAccountFromSetTopBoxId(siteId, siteCode,
                                                                            setTopBoxId).PadLeft(9, '0');

                    if (accountNumber9 == null || accountNumber9 == string.Empty)
                    {
                        throw new InvalidSetTopBoxIdException(string.Format(
                                                                  __setTopBoxIdToAccountNumberException, setTopBoxId));
                    }

                    //look up division for this account
                    DalAccount dalAccount = new DalAccount();
                    CompanyDivisionFranchise companyDivisionFranchise = dalAccount.GetCompanyDivisionFranchise(siteId,
                                                                                                               siteCode, accountNumber9);

                    //turn accountNumber9 into accountNumber13
                    string accountNumber13 = companyDivisionFranchise.Company.ToString().PadLeft(2, '0') + companyDivisionFranchise.Division.ToString().PadLeft(2, '0') + accountNumber9;

                    // convert to CustomerAccountNumber
                    CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                        typeof(CustomerAccountNumber)).ConvertFrom(accountNumber13);

                    // get the siteid/sitecode information
                    PopulateSiteInfo(accountNumber);
                    logEntry.CustomerAccountNumber = accountNumber.AccountNumber16;

                    // setup return
                    Account account = new Account();

                    // setup adapter and fill account object.
                    AccountAdapter adapter = new AccountAdapter(accountNumber, _userName, _siteId, _siteCode);
                    adapter.Fill(account);

                    //set the AllowOnlineOrdering flag
                    SetAllowOnlineOrderingFlag(ref account);

                    // all done.
                    return(account);
                }
                catch (ValidationException ve)
                {
                    logEntry.SetError(ve.Message);
                    throw;
                }
                catch (BusinessLogicLayerException blle)
                {
                    logEntry.SetError(new ExceptionFormatter(blle).Format());
                    throw;
                }
                catch (DataSourceException de)
                {
                    logEntry.SetError(de.Message);
                    throw new DataSourceUnavailableException(de);
                }
                catch (Exception e)
                {
                    logEntry.SetError(e.Message);
                    throw new UnexpectedSystemException(e);
                }
            }
        }
        /// <summary>
        /// This method returns account and statement information for the given account.
        /// </summary>
        /// <param name="accountNumber9"></param>
        /// <param name="siteId"></param>
        /// <returns></returns>
        public Account InquireAccount([RequiredItem()][StringLength(9, 9)] string accountNumber9, [RequiredItem()] int siteId)
        {
            BillingLogEntry logEntry = new BillingLogEntry(eBillingActivityType.AccountInquiry, accountNumber9 == null?string.Empty:accountNumber9.PadLeft(16, '0'));

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    // validate the parameters.
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(), accountNumber9, siteId);
                    validator.Validate();

                    //log the site id
                    logEntry.SiteId = siteId;

                    //look up the company and division for this account
                    string     siteCode   = DalSiteCode.Instance.GetSiteCode(siteId);
                    DalAccount dalAccount = new DalAccount();
                    CompanyDivisionFranchise companyDivisionFranchise = dalAccount.GetCompanyDivisionFranchise(siteId, siteCode, accountNumber9);

                    //turn accountNumber9 into accountNumber13
                    string accountNumber13 = companyDivisionFranchise.Company.ToString().PadLeft(2, '0') + companyDivisionFranchise.Division.ToString().PadLeft(2, '0') + accountNumber9;

                    // convert to CustomerAccountNumber
                    CustomerAccountNumber accountNumber = (CustomerAccountNumber)TypeDescriptor.GetConverter(
                        typeof(CustomerAccountNumber)).ConvertFrom(accountNumber13);

                    PopulateSiteInfo(accountNumber);

                    //log the account number
                    logEntry.CustomerAccountNumber = accountNumber.AccountNumber16;

                    // setup return
                    Account account = new Account();

                    // setup adapter and fill account object.
                    AccountAdapter adapter = new AccountAdapter(accountNumber, _userName, _siteId, _siteCode);
                    adapter.Fill(account);

                    //set the AllowOnlineOrdering flag
                    SetAllowOnlineOrderingFlag(ref account);

                    // all done.
                    return(account);
                }
                catch (ValidationException ve)
                {
                    logEntry.SetError(ve.Message);
                    throw;
                }
                catch (InvalidAccountNumberException ie)
                {
                    logEntry.SetError(ie.Message);
                    throw;
                }
                catch (DataSourceException de)
                {
                    logEntry.SetError(de.Message);
                    throw new DataSourceUnavailableException(de);
                }
                catch (UnexpectedSystemException ue)
                {
                    logEntry.SetError(ue.Message);
                    throw;
                }
                catch (Exception e)
                {
                    logEntry.SetError(e.Message);
                    throw new UnexpectedSystemException(e);
                }
            }
        }
Exemplo n.º 32
0
        /// <summary>
        /// Sets up the CustomerAccount to pay for services on a recurring basis
        /// using a credit card.
        /// </summary>
        /// <param name="strCustomerName"></param>
        /// <param name="strBankRouteNumber"></param>
        /// <param name="strBankAccountNumber"></param>
        /// <param name="ebatAccountType"></param>
        public void ActivateRecurringUsingDirectDebit(
            string strCustomerName,
            [RequiredItem()][StringLength(1, 9)][NumericAttribute()] string strBankRouteNumber,
            [RequiredItem()][StringLength(1, 20)] string strBankAccountNumber,
            [RequiredItem()] eBankAccountType ebatAccountType)
        {
            BillingLogEntry logEntry = new BillingLogEntry(
                eBillingActivityType.RecurringCheck,
                this.m_can.AccountNumber16);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(),
                                                                    strCustomerName, strBankRouteNumber, strBankAccountNumber, ebatAccountType);
                    validator.Validate();

                    // In this case, we are hard-coding the payment type
                    ePaymentType ept = ePaymentType.RecurringDirectDebit;
                    logEntry.PaymentType = ept;

                    // set the siteId information
                    logEntry.SiteId = SiteId;

                    int intStatementCode = 0;
                    try{ intStatementCode = int.Parse(m_can.StatementCode); }
                    catch { /*don't care*/ }

                    //use stopped check dal to verfiy the account does not have a stop on it
                    DalStoppedCheck dalSC = new DalStoppedCheck();
                    if (dalSC.IsStoppedCheck(strBankRouteNumber, strBankAccountNumber))
                    {
                        //the account has a stop placed on it
                        throw new MopAuthorizationFailedException(string.Format(__stoppedCheckErrorMessage + "\nBank Routing Number: {0} \nBank Account Number: {1}", strBankRouteNumber, strBankAccountNumber));
                    }

                    checkNSFStatus(false);

                    // Create a DAL to transalate Mop codes
                    DalMethodOfPayment dal = new DalMethodOfPayment();

                    // need to get the customer's name.
                    if (strCustomerName != null)
                    {
                        strCustomerName = strCustomerName.Trim();
                    }
                    if (strCustomerName == null || strCustomerName.Length == 0)
                    {
                        DalAccount dalAccount = new DalAccount();
                        CustomerAccountSchema.CustomerName custName =
                            dalAccount.GetCustomerName(_siteId, _siteCode, m_can.AccountNumber9);
                        if (custName == null)
                        {
                            throw new InvalidAccountNumberException();
                        }
                        strCustomerName = (string)new CustomerName(custName.FirstName, custName.MiddleInitial, custName.LastName);
                        if (strCustomerName == null || strCustomerName.Length == 0)
                        {
                            strCustomerName = CmConstant.kstrDefaultAccountTitle;
                        }
                    }

                    // assure that the length of the customer name does NOT exceed 32 characters!
                    if (strCustomerName.Length >= 32)
                    {
                        strCustomerName = strCustomerName.Substring(0, 31);
                    }

                    // Build input elements
                    Request.INL00074 inl74 =
                        new INL00074Helper(dal.GetMopByUserPaymentType(UserName, (int)ept),
                                           strBankAccountNumber, strBankRouteNumber, strCustomerName,
                                           (char)TypeDescriptor.GetConverter(typeof(eBankAccountType)).ConvertTo(ebatAccountType, typeof(char)),
                                           intStatementCode, false);
                    Request.MAC00027 mac27 = new Mac00027Helper(SiteId.ToString(),
                                                                m_can.AccountNumber9, CmConstant.kstrDefaultTaskCode, inl74);

                    this.Invoke((Request.MAC00027)mac27);
                }
                catch (BusinessLogicLayerException blle)
                {
                    //the dal threw an exception
                    logEntry.SetError(blle.Message);
                    throw;
                }
                catch (DataSourceException excDSE)
                {
                    //the dal threw an exception
                    logEntry.SetError(excDSE.Message);
                    throw new DataSourceUnavailableException(excDSE);
                }
                catch (CmErrorException excCm)
                {
                    logEntry.SetError(excCm.Message, excCm.ErrorCode);
                    throw TranslateCmException(excCm);
                }
                catch (Exception exc)
                {
                    logEntry.SetError(exc.Message);
                    throw;
                }
            }
        }
Exemplo n.º 33
0
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action<IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);
            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            InternalBeginExecuteRequest(new AsyncExecutionState
                                        {
                                            ResponseHandler = responseHandler,
                                            Try = 1,
                                            WaitTime = RetryInitialWaitTime,
                                            CurrentRequest =  CreateWebRequest()
                                        });
        }
Exemplo n.º 34
0
 public ValidationResponse ActualizarAlerta(VMComprobante oComprobante)
 {
     return(MethodValidator.ValidateBusinessMethod(CallBack().ActualizarAlertaCallBack,
                                                   new object[] { oComprobante }));
 }
Exemplo n.º 35
0
 public ValidationResponse ConsultarDetalle(VMComprobante oComprobante)
 {
     return(MethodValidator.ValidateBusinessMethod(CallBack().ConsultarDetalleCallBack,
                                                   new object[] { oComprobante }));
 }
Exemplo n.º 36
0
        /// <summary>
        /// Sets up the CustomerAccount to pay for services on a recurring basis
        /// using a credit card.
        /// </summary>
        /// <param name="strCreditCardNumber"></param>
        /// <param name="strNameOnCard"></param>
        /// <param name="strExpirationDate"></param>
        public void ActivateRecurringUsingCreditCard(
            [RequiredItem()][CreditCardNumber()] string strCreditCardNumber,
            [RequiredItem()] string strNameOnCard,
            [RequiredItem()][ValidCCDate()] string strExpirationDate)
        {
            BillingLogEntry logEntry = new BillingLogEntry(
                eBillingActivityType.RecurringCredit,
                this.m_can.AccountNumber16);

            using (Log log = CreateLog(logEntry))
            {
                try
                {
                    MethodValidator validator = new MethodValidator(MethodBase.GetCurrentMethod(),
                                                                    strCreditCardNumber, strNameOnCard, strExpirationDate);
                    validator.Validate();

                    // convert the accountNumber.
                    CreditCardNumber creditCardNumber = (CreditCardNumber)TypeDescriptor.GetConverter(
                        typeof(CreditCardNumber)).ConvertFrom(strCreditCardNumber);

                    // Credit card validation
                    logEntry.PaymentType = creditCardNumber.PaymentType;
                    DateTime dttmExpirationDate = ValidCCDateAttribute.ToDate(strExpirationDate);
                    // set the siteId information
                    logEntry.SiteId = SiteId;

                    // Create a DAL to transalate Mop codes
                    DalMethodOfPayment dal = new DalMethodOfPayment();

                    int intStatementCode = 0;
                    try{ intStatementCode = int.Parse(m_can.StatementCode); }catch { /*don't care*/ }

                    // check nsf status
                    checkNSFStatus(true);

                    // assure that the length of the customer name does NOT exceed 32 characters!
                    if (strNameOnCard.Length >= 32)
                    {
                        strNameOnCard = strNameOnCard.Substring(0, 31);
                    }

                    // Build input elements
                    Request.INL00073 inl73 = new INL00073Helper(dal.GetMopByUserPaymentType(
                                                                    UserName, (int)creditCardNumber.PaymentType), creditCardNumber.AccountNumber,
                                                                strNameOnCard, dttmExpirationDate, intStatementCode, false);
                    Request.MAC00027 mac27 = new Mac00027Helper(SiteId.ToString(),
                                                                m_can.AccountNumber9, CmConstant.kstrDefaultTaskCode, inl73);

                    // invoke and get the response object.
                    this.Invoke((Request.MAC00027)mac27);
                }
                catch (BusinessLogicLayerException blle)
                {
                    //the dal threw an exception
                    logEntry.SetError(blle.Message);
                    throw;
                }
                catch (DataSourceException excDSE)
                {
                    //the dal threw an exception
                    logEntry.SetError(excDSE.Message);
                    throw new DataSourceUnavailableException(excDSE);
                }
                catch (CmErrorException excCm)
                {
                    logEntry.SetError(excCm.Message, excCm.ErrorCode);
                    throw TranslateCmException(excCm);
                }
                catch (Exception exc)
                {
                    logEntry.SetError(exc.Message);
                    throw;
                }
            }
        }