示例#1
0
        public static bool IsWebAliasAvailable(int customerID, string webalias)
        {
            try
            {
                // Get the current webalias to see if it matches what we passed. If so, it's still valid.
                var currentWebAlias = Exigo.GetCustomerSite(customerID).WebAlias;
                if (webalias.Equals(currentWebAlias, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(true);
                }

                // Validate the web alias
                // cannot use SQL due to delay in update to replicated database
                var customerSite = Exigo.WebService().GetCustomerSite(new GetCustomerSiteRequest()
                {
                    WebAlias = webalias
                });

                return(customerSite == null);
            }
            catch (Exception ex)
            {
                // the GetCustomerSite throws an exception if no matching web alias is found
                // return the web alias is available in this case so return true
                return(true);
            }
        }
示例#2
0
        public static bool IsWebAliasAvailable(int customerID, string webalias)
        {
            // Get the current webalias to see if it matches what we passed. If so, it's still valid.
            var currentWebAlias = Exigo.GetCustomerSite(customerID).WebAlias;

            if (webalias.Equals(currentWebAlias, StringComparison.InvariantCultureIgnoreCase))
            {
                return(true);
            }


            // Validate the web alias
            return(Exigo.WebService().Validate(new IsLoginNameAvailableValidateRequest
            {
                LoginName = webalias
            }).IsValid);
        }