Beispiel #1
0
        /// <summary>
        /// 根据手机号、服务空间id获取客户信息
        /// </summary>
        /// <param name="serviceSpaceId">服务空间Id</param>
        /// <param name="phoneNum">手机号</param>
        /// <returns>客户信息</returns>
        public Customer GetByPhone(string serviceSpaceId, string phoneNum)
        {
            //参数验证
            if (string.IsNullOrEmpty(phoneNum) || string.IsNullOrEmpty(serviceSpaceId))
            {
                ErrorMsg = ErrorCode.ParameterNull;
                return(null);
            }

            //数据获取
            Customer   customer       = null;
            DataEntity customerEntity = _customerProvider.GetByPhone(serviceSpaceId, phoneNum);

            if (customerEntity != null)
            {
                customer = GetCustomerFromEntity(customerEntity);
            }
            return(customer);
        }