public void GetMarketingSourceByTerritoryTesterForZipAssociatedToAdvTerritory()
        {
            var zipCode = "78705";

            var markettingSources = _marketingSourceService.FetchMarketingSourceByZip(zipCode);

            Assert.IsNotNull(markettingSources);
            Assert.Greater(markettingSources.Count(), 0);
        }
Esempio n. 2
0
        public List <string> FetchMarketingSourceByZip(string guid, string text)
        {
            var onlineRequestValidationModel = _tempcartService.ValidateOnlineRequest(guid);
            var model = new OnlineSchedulingCustomerInfoEditModel
            {
                RequestValidationModel = onlineRequestValidationModel
            };
            var    tempCart = onlineRequestValidationModel.TempCart;
            string zip      = "";
            var    customer = tempCart.CustomerId.HasValue ? _customerRepository.GetCustomer(tempCart.CustomerId.Value) : null;

            if (customer != null)
            {
                zip = customer.Address.ZipCode.Zip;
            }
            return(_marketingSourceService.FetchMarketingSourceByZip(zip, true).Where(x => x.ToLower().StartsWith(text.ToLower())).ToList());
        }