Example #1
0
    public ChangeUserAuthenStyleResult ChangeUserAuthenStyle(string ProvinceID, string OriginalID, string NewID,
        string DealType, AuthenRecord[] AuthenRecords, string ExtendField)
    {
        ChangeUserAuthenStyleResult Result = new ChangeUserAuthenStyleResult();
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.NewID = "";
        Result.ErrorDescription = "";
        Result.OriginalID = "";
        Result.ErrorDescription = "";
        Result.ExtendField = "";
        string SPID = "";
        try
        {

            #region 验证
            if (CommonUtility.IsEmpty(ProvinceID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            if (CommonUtility.IsEmpty(OriginalID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",OriginalID不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(DealType))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",DealType不能为空";
                return Result;
            }
            string tmp = "1;2;3";
            if (tmp.IndexOf(DealType)<0)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",DealType类型不正确!";
                return Result;
            }
             if(DealType=="1")
             {
                if (CommonUtility.IsEmpty(NewID))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",NewID不能为空";
                    return Result;
                }
            }
            if (AuthenRecords==null)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",AuthenRecords不能为空";
                return Result;
            }
            if (AuthenRecords.Length <= 0)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",AuthenRecords数组长度为小于0";
                return Result;
            }

            if (!CommonUtility.IsEmpty(ExtendField))
            {
                SPID = CommonBizRules.GetValueFromXmlStr(ExtendField, "SPID");
            }

            #endregion

            Result.Result = BTForCrmBizRules.ChangeUserAuthenStyle(ProvinceID,OriginalID, NewID, DealType, AuthenRecords,SPID, out Result.NewID, out Result.OriginalID, out Result.ErrorDescription);

        }
        catch (Exception ex)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + "," + ex.Message;
        }
        finally
        {
            #region WriteLog
            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("认证方式变更接口 " + DateTime.Now.ToString("u") + "\r\n");
            msg.Append(";ProvinceID - " + ProvinceID);
            msg.Append(";OriginalID - " + OriginalID);
            msg.Append(";NewID - " + NewID);
            msg.Append(";DealType - " + DealType);
            if (AuthenRecords != null)
            {
                if (AuthenRecords.Length > 0)
                {
                    for (int i = 0; i < AuthenRecords.Length; i++)
                    {
                        msg.Append(";AuthenType - " + AuthenRecords[i].AuthenType);
                        msg.Append(";AuthenName - " + AuthenRecords[i].AuthenName);
                    }
                }
            }
            msg.Append(";ExtendField - " + ExtendField);

            msg.Append("\r\n");
            msg.Append("处理结果 - " + Result.Result);
            msg.Append("; 错误描述 - " + Result.ErrorDescription);

            msg.Append("; NewID - " + Result.NewID);
            msg.Append("; OriginalID - " + Result.OriginalID);
            msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForCRM("ChangeUserAuthenStyle", msg);
            #endregion
        }

        return Result;
    }
Example #2
0
    public UserAuthenStyleUploadResult UserAuthenStyleUpload(string ProvinceID, string ID,
         string AreaID, AuthenRecord[] AuthenRecords, string ExtendField)
    {
        UserAuthenStyleUploadResult Result = new UserAuthenStyleUploadResult();

        Result.Result = ErrorDefinition.IError_Result_UnknowError_Code;
        Result.ErrorDescription = "";
        Result.ID = ID;
        Result.ExtendField = "";
        Result.CustID = "";
        //string strXML = "";
        string SPID = "";

        try
        {
            #region 数据校验

            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = "ProvinceID不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(AreaID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidAreaCode_Code;
                Result.ErrorDescription =ErrorDefinition.BT_IError_Result_InValidAreaCode_Msg+",AreaID不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(ID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + ",不能为空";
                return Result;
            }

            if (!CommonUtility.IsEmpty(ExtendField))
            {
                SPID = CommonBizRules.GetValueFromXmlStr(ExtendField, "SPID");
            }
            #endregion

            Result.Result = BTForCrmBizRules.UserAuthenStyleUpload(ProvinceID, ID, AreaID,ExtendField, AuthenRecords,SPID, out Result.CustID, out Result.ErrorDescription);

        }
        catch (Exception ex)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + "," + ex.Message;

        }
        finally
        {
            #region WriteLog
            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("Crm客户认证信息同步接口 " + DateTime.Now.ToString("u") + "\r\n");
            msg.Append(";ProvinceID - " + ProvinceID);
            msg.Append(";ID - " + ID);
             msg.Append(";AreaID - " + AreaID);

            if(AuthenRecords != null )
            {
                if (AuthenRecords.Length > 0)
                {
                    for (int i = 0; i < AuthenRecords.Length; i++)
                    {
                        msg.Append(";AuthenType - " + AuthenRecords[i].AuthenType);
                        msg.Append(";AuthenName - " + AuthenRecords[i].AuthenName);
                    }
                }
            }
            msg.Append(";ExtendField - " + ExtendField);
            msg.Append("\r\n");
            msg.Append("处理结果 - " + Result.Result);
            msg.Append("; 错误描述 - " + Result.ErrorDescription);
            msg.Append("; CustID - " + Result.CustID);
            msg.Append("; ID - " + Result.ID);
            msg.Append("; ErrorDescription - " + Result.ErrorDescription);
            msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForCRM("UserAuthenStyleUpload", msg);
            #endregion

        }

        return Result;
    }
Example #3
0
    public CustInfoUploadResult CustInfoUpload(string ProvinceID, string ID, string CustType, string CustAccount, string CustLevel,
         string RealName, string ContactTel, string Address, string ZipCode, string CertificateCode,
         string CertificateType, string AreaID, string Sex, string Email, string dealType,AuthenRecord[] AuthenRecords, string ExtendField)
    {
        CustInfoUploadResult Result = new CustInfoUploadResult();
        string SPID = "";
        Result.Result = ErrorDefinition.IError_Result_UnknowError_Code;
        Result.ErrorDescription = "";
        Result.ID = ID;
        Result.ExtendField = "";
        Result.CustID = "";
        string strXML = "";

        try
        {
            #region 数据校验

            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = "ProvinceID不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(CustType))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code;
                Result.ErrorDescription = "CUstType不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(CustLevel))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustLevel_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustLevel_Msg + ",不能为空";
                return Result;
            }
            if (CustType.Length != 2)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code;
                Result.ErrorDescription = "CustType无效,长度不为2";
                return Result;
            }

            if (CommonUtility.IsEmpty(RealName))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidPassword_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidRealName_Msg + ",不能为空";
                return Result;
            }

            if (!CommonUtility.IsEmpty(ExtendField))
            {
                SPID = CommonBizRules.GetValueFromXmlStr(ExtendField, "SPID");
            }

            switch(CustType)
            {
                case "01":
                    CustType = "14";
                    break;
                case "02":
                    CustType = "20";
                    break;
                case "03":
                    CustType = "12";
                    break;
                case "09":
                    CustType = "90";
                    break;
                case "11":
                    CustType = "30";
                    break;
                case "00":
                    CustType = "42";
                    break;
            }

            Result.Result = BTForCrmBizRules.CustInfoUpload(ProvinceID, ID, CustType, CustAccount, CustLevel,
              RealName, ContactTel, Address, ZipCode, CertificateCode,
              CertificateType, AreaID, Sex, Email, dealType, ExtendField, AuthenRecords,SPID, out Result.CustID,out Result.ErrorDescription);

            if (Result.Result == 0)
            {
                //通知积分系统
                CIP2BizRules.InsertCustInfoNotify(Result.CustID, "2", System.Configuration.ConfigurationManager.AppSettings["ScoreBesttoneSPID"], "", dealType, out Result.ErrorDescription);

            }
           strXML = BTBizRules.GenerateResultXml(Result.Result.ToString(), Result.ErrorDescription);
            #endregion
        }
        catch (Exception ex)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + "," + ex.Message;

        }
        finally
        {
            #region WriteLog
            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("Crm客户同步接口 " + DateTime.Now.ToString("u") + "\r\n");
            msg.Append(";ProvinceID - " + ProvinceID);
            msg.Append(";ID - " + ID);
            msg.Append(";CustType - " + CustType);
             msg.Append(";CustAccount - " + CustAccount);
             msg.Append(";CustLevel - " + CustLevel);
             msg.Append(";RealName - " + RealName);
             msg.Append(";ContactTel - " + ContactTel);
             msg.Append(";Address - " + Address);
             msg.Append(";ZipCode - " + ZipCode);
             msg.Append(";CertificateCode - " + CertificateCode);
             msg.Append(";CertificateType - " + CertificateType);
             msg.Append(";AreaID - " + AreaID);
             msg.Append(";Sex - " + Sex);
             msg.Append(";Email - " + Email);
             msg.Append(";dealType - " + dealType);
             msg.Append(";ExtendField - " + ExtendField);
             msg.Append(";strXML - " + strXML);

            if(AuthenRecords != null )
            {
                if (AuthenRecords.Length > 0)
                {
                    for (int i = 0; i < AuthenRecords.Length; i++)
                    {
                        msg.Append(";AuthenType - " + AuthenRecords[i].AuthenType);
                        msg.Append(";AuthenName - " + AuthenRecords[i].AuthenName);
                    }
                }
            }
            msg.Append(";ExtendField - " + ExtendField);
            msg.Append("\r\n");
            msg.Append("处理结果 - " + Result.Result);
            msg.Append("; 错误描述 - " + Result.ErrorDescription);
            msg.Append("; CustID - " + Result.CustID);
            msg.Append("; ID - " + Result.ID);
            msg.Append("; ErrorDescription - " + Result.ErrorDescription);
            msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForCRM("CustInfoUpload", msg);
            #endregion
        }

        return Result;
    }