예제 #1
0
        public Entity.BaseResponse <bool> ValidateCompany(Entity.ValidateCompanyRequest requestData)
        {
            InitSubscriptionToken();
            Entity.BaseResponse <bool> response = new Entity.BaseResponse <bool>(false);
            //bool IsCompanyExists = false;
            bool IsEmailExists = false;

            if (!string.IsNullOrEmpty(requestData.Email))
            {
                Entity.SubsciberCompanyDetails existingConsumer = GetSubscriberDetails(SolutionConfiguration.Configuration.SubscriptionAPI.SolutionCode, requestData.Email);
                if (existingConsumer != null && string.IsNullOrEmpty(existingConsumer.email))//Check email exists or not
                {
                    IsEmailExists = false;
                }
                else
                {
                    IsEmailExists = true;
                }
            }
            //if (!string.IsNullOrEmpty(requestData.CompanyName))
            //{
            //    if (GetCompanyDetails(SolutionConfiguration.Configuration.SubscriptionAPI.SolutionCode, requestData.CompanyName))
            //    {
            //        IsCompanyExists = false;
            //    }
            //    else
            //    {
            //        IsCompanyExists = true;
            //    }
            //}
            if (IsEmailExists)
            {
                response.IsSuccess = false;
                response.Message   = "Email address already registered!";
            }
            //else if (IsCompanyExists)
            //{
            //    response.IsSuccess = false;
            //    response.Message = "Company name already registered!";
            //}
            //else if (IsEmailExists)
            //{
            //    response.IsSuccess = false;
            //    response.Message = "Email address already registered!";
            //}
            else
            {
                response.IsSuccess = true;
                response.Message   = "";
            }
            return(response);
        }
예제 #2
0
        public Entity.ActionStatus ValidateCompany(Entity.ValidateCompanyRequest requestData)
        {
            Entity.ActionStatus response = new Entity.ActionStatus(true);
            try
            {
                Entity.BaseResponse <bool> validateResult = new Entity.BaseResponse <bool>(false);
                validateResult = _subscriberHelper.ValidateCompany(requestData);

                response.Success = validateResult.IsSuccess;
                response.Message = validateResult.Message;
            }
            catch (Exception ex)
            {
                _logger.ErrorLog(ex);
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }