Ejemplo n.º 1
0
    public IsUserNameExistResult IsUserNameExist(string SPID, string UserName)
    {
        IsUserNameExistResult Result = new IsUserNameExistResult();
        StringBuilder strLog = new StringBuilder();
        strLog.AppendFormat("{0}\r\n",DateTime.Now.ToString("u"));
        strLog.AppendFormat("参数:SPID:{0},UserName:{1}\r\n",SPID,UserName);
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ErrMsg = "";
        Result.isExist = "";
        if (CommonUtility.IsEmpty(SPID))
        {
            Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
            Result.ErrMsg = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + "不能为空";
            strLog.Append(Result.ErrMsg + "\r\n");
            return Result;
        }

        if (SPID.Length != ConstDefinition.Length_SPID)
        {
            Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
            Result.ErrMsg = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + "长度有误";
            strLog.Append(Result.ErrMsg + "\r\n");
            return Result;
        }
        String appId = UDBConstDefinition.DefaultInstance.UnifyPlatformAppId;
        String appSecret = UDBConstDefinition.DefaultInstance.UnifyPlatformAppSecret;
        String version = UDBConstDefinition.DefaultInstance.UnifyPlatformVersion;
        String clientType = UDBConstDefinition.DefaultInstance.UnifyPlatformClientType;
        String clientIp = HttpContext.Current.Request.UserHostAddress;
        String clientAgent = HttpContext.Current.Request.UserAgent;
        try
        {
            UDBMBOSS _udbBoss = new UDBMBOSS();
            _udbBoss.IsUserNameExists(appId, appSecret, version, clientType, clientIp, clientAgent, UserName, out Result.Result, out Result.isExist,out Result.ErrMsg);
            strLog.AppendFormat("结果:{0},{1}\r\n",Result.Result,Result.ErrMsg);
        }
        catch (Exception e)
        {
            Result.ErrMsg = e.Message;
            strLog.AppendFormat("异常:{0}\r\n",e.Message);
        }
        finally
        {
            BTUCenterInterfaceLog.CenterForBizTourLog("IsUserNameExist", strLog);
        }
        return Result;
    }