Example #1
0
    public CustStatusChangeResult CustStatusChange(string ProvinceID, string CRMID, string CustType, string CRMAccount, string Status,
        string Description, string ExtendField)
    {
        CustStatusChangeResult Result = new CustStatusChangeResult();
        string SPID = "";
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ErrorDescription = "";
        Result.ExtendField = "";
        Result.CRMID = "";
        Result.ProvinceID = "";
        try
        {
            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(CRMID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",CRMID不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(CustType))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserType_Msg + ",CustType不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(Status))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidStatus_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidStatus_Msg + ",不能为空";
                return Result;
            }
            if (!CommonUtility.IsEmpty(ExtendField))
            {
                SPID = CommonBizRules.GetValueFromXmlStr(ExtendField, "SPID");
            }
            //if (CommonUtility.IsEmpty(CRMAccount))
            //{
            //    Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
            //    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",CRMAccount不能为空";
            //    return Result;
            //}

            Result.Result = BTForCrmBizRules.CustStatusChange(ProvinceID, CRMID, CustType, CRMAccount, Status,SPID, out Result.ErrorDescription, out Result.ProvinceID, out Result.CRMID);
            Result.ProvinceID = ProvinceID;

        }
        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(";CRMID - " + CRMID);
            msg.Append(";CRMAccount - " + CRMAccount);
            msg.Append(";CustType - " + CustType);
            msg.Append(";Status - " + Status);
            msg.Append(";Description - " + Description);
            msg.Append(";ExtendField - " + ExtendField);

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

            BTUCenterInterfaceLog.CenterForCRM("CustStatusChange", msg);
            #endregion
        }
        return Result;
    }