Exemplo n.º 1
0
        /// <summary>
        /// Function to add customer phones
        /// </summary>
        /// <param name="phones"></param>
        /// <returns></returns>
        public List <Tuple <string, string> > AddCustomerPhones(List <Phone> phones)
        {
            newPhones = new List <Tuple <string, string> >();

            //Input phones
            for (int counter = 0; counter < phones.Count; counter++)
            {
                string phone     = CommonFunctions.AppendMaxRangeRandomString(phones[counter].PhoneNumber);
                string phoneType = phones[counter].PhoneType;
                EnterPhone(phone, counter).SelectPhoneType(phoneType, counter);

                try
                {
                    if ((counter < phones.Count - 1) && saveButton.Displayed)
                    {
                        AddPhone();
                    }
                }
                catch
                {
                    _logger.Info("Save button is not displayed and User is updating the phone number of customer details");
                }

                newPhones.Add(new Tuple <string, string>(phone, phoneType));
            }

            return(newPhones);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Function to add tax numbers
        /// </summary>
        /// <param name="taxNumbers"></param>
        public List <Tuple <string, string> > AddCustomerTaxNumbers(List <TaxNumber> taxNumbers)
        {
            newTax = new List <Tuple <string, string> >();
            if (!TaxCheckBox.Selected)
            {
                ClickTaxExemptionCheckBox();
            }
            else
            {
                _logger.Info("TaxExemtion Checkbox is already selected in customer edit mode");
            }

            //Input Taxid and Tax state
            for (int counter = 0; counter < taxNumbers.Count; counter++)
            {
                string taxId    = CommonFunctions.AppendMaxRangeRandomString(taxNumbers[counter].TaxIdNumber);
                string taxState = taxNumbers[counter].TaxState;

                EnterTaxIDNumber(taxId, counter + 1).SelectTaxState(taxState, counter + 1).ClickDoesntExpireCheckBox(counter + 1);

                try
                {
                    if ((counter < taxNumbers.Count - 1) && saveButton.Displayed)
                    {
                        AddTax();
                    }
                }
                catch
                {
                    _logger.Info("Save button is not displayed and User is updating the tax number of customer details");
                }

                newTax.Add(new Tuple <string, string>(taxId, taxState));
            }
            return(newTax);
        }