/// IM工单入口-经销商
        /// <summary>
        /// IM工单入口-经销商
        /// </summary>
        /// <returns></returns>
        public static WOrderRequest AddWOrderComeIn_IMJXS(CallSourceEnum callsource, ModuleSourceEnum module, string phone, long relatedid,
                                                          string cbname, int cbsex, int province, int city, int county, string membercode)
        {
            if (callsource != CallSourceEnum.C03_IM对话 && callsource != CallSourceEnum.C04_IM留言)
            {
                return(null);
            }
            if (module != ModuleSourceEnum.M06_IM经销商_新车 && module != ModuleSourceEnum.M07_IM经销商_二手车)
            {
                return(null);
            }
            WOrderRequest info = new WOrderRequest(callsource, module);

            info.Phone                 = phone.Replace("-", "").Replace(" ", ""); //去掉座机的中杠和空格
            info.IsPhoneCanModify      = string.IsNullOrEmpty(phone);
            info.IsShowCallOutBtn      = false;
            info.CustType              = CustTypeEnum.T02_经销商;
            info.DataSource            = WorkOrderDataSource.IMOnLine;
            info.IsDataSourceCanModify = false;

            info.RelatedData = relatedid.ToString();

            info.CBName     = cbname;
            info.CBSex      = cbsex;
            info.CBProvince = province;
            info.CBCity     = city;
            info.CBCounty   = county;
            info.CBMember   = membercode;
            return(info);
        }
        public WOrderRequest(CallSourceEnum call, ModuleSourceEnum module)
        {
            CallSource   = call;
            ModuleSource = module;

            //设置默认值
            IsPhoneCanModify      = true;
            IsShowCallOutBtn      = true;
            IsCustTypeCanModify   = true;
            IsDataSourceCanModify = true;
            IsCategoryCanModify   = true;

            CustType   = CustTypeEnum.None;
            DataSource = WorkOrderDataSource.None;
            Category   = WOrderCategoryEnum.None;

            BusinessType = -1;
            BusinessTag  = -1;
        }
        /// 无电话号码入口-客户池&工单
        /// <summary>
        /// 无电话号码入口-客户池&工单
        /// </summary>
        /// <returns></returns>
        public static WOrderRequest AddWOrderComeIn_NoPhone(ModuleSourceEnum module)
        {
            WOrderRequest info = new WOrderRequest(CallSourceEnum.C00_无, module);

            return(info);
        }
        /// 从URL参数中解析具体值
        /// <summary>
        /// 从URL参数中解析具体值
        /// </summary>
        /// <returns></returns>
        public static WOrderRequest GetWOrderRequestFromRequest()
        {
            string callsource   = BLL.Util.GetCurrentRequestStr("CallSource");
            string modulesource = BLL.Util.GetCurrentRequestStr("ModuleSource");

            if (string.IsNullOrEmpty(callsource) || string.IsNullOrEmpty(modulesource))
            {
                return(null);
            }

            CallSourceEnum   CallSource   = (CallSourceEnum)Enum.Parse(typeof(CallSourceEnum), callsource);
            ModuleSourceEnum ModuleSource = (ModuleSourceEnum)Enum.Parse(typeof(ModuleSourceEnum), modulesource);

            string Phone                 = BLL.Util.GetCurrentRequestStr("Phone");
            string IsPhoneCanModify      = BLL.Util.GetCurrentRequestStr("IsPhoneCanModify");
            string IsShowCallOutBtn      = BLL.Util.GetCurrentRequestStr("IsShowCallOutBtn");
            string CustType              = BLL.Util.GetCurrentRequestStr("CustType");
            string IsCustTypeCanModify   = BLL.Util.GetCurrentRequestStr("IsCustTypeCanModify");
            string CRMCustID             = BLL.Util.GetCurrentRequestStr("CRMCustID");
            string DataSource            = BLL.Util.GetCurrentRequestStr("DataSource");
            string Category              = BLL.Util.GetCurrentRequestStr("Category");
            string IsDataSourceCanModify = BLL.Util.GetCurrentRequestStr("IsDataSourceCanModify");
            string IsCategoryCanModify   = BLL.Util.GetCurrentRequestStr("IsCategoryCanModify");
            string BusinessType          = BLL.Util.GetCurrentRequestStr("BusinessType");
            string BusinessTag           = BLL.Util.GetCurrentRequestStr("BusinessTag");
            string RelatedData           = BLL.Util.GetCurrentRequestStr("RelatedData");

            string CBName     = BLL.Util.GetCurrentRequestStr("CBName");
            string CBSex      = BLL.Util.GetCurrentRequestStr("CBSex");
            string CBProvince = BLL.Util.GetCurrentRequestStr("CBProvince");
            string CBCity     = BLL.Util.GetCurrentRequestStr("CBCity");
            string CBCounty   = BLL.Util.GetCurrentRequestStr("CBCounty");
            string CBMember   = BLL.Util.GetCurrentRequestStr("CBMember");

            string MaxName   = BLL.Util.GetCurrentRequestStr("MaxName");
            string MaxSex    = BLL.Util.GetCurrentRequestStr("MaxSex");
            string MaxMember = BLL.Util.GetCurrentRequestStr("MaxMember");

            string key = BLL.Util.GetCurrentRequestStr("key");

            WOrderRequest info = new WOrderRequest(CallSource, ModuleSource);

            info.Phone = Phone;
            if (!string.IsNullOrEmpty(IsPhoneCanModify))
            {
                info.IsPhoneCanModify = bool.Parse(IsPhoneCanModify);
            }
            if (!string.IsNullOrEmpty(IsShowCallOutBtn))
            {
                info.IsShowCallOutBtn = bool.Parse(IsShowCallOutBtn);
            }
            if (!string.IsNullOrEmpty(CustType))
            {
                info.CustType = (CustTypeEnum)Enum.Parse(typeof(CustTypeEnum), CustType);
            }
            if (!string.IsNullOrEmpty(IsCustTypeCanModify))
            {
                info.IsCustTypeCanModify = bool.Parse(IsCustTypeCanModify);
            }
            info.CRMCustID = CRMCustID;

            if (!string.IsNullOrEmpty(DataSource))
            {
                info.DataSource = (WorkOrderDataSource)Enum.Parse(typeof(WorkOrderDataSource), DataSource);
            }
            if (!string.IsNullOrEmpty(Category))
            {
                info.Category = (WOrderCategoryEnum)Enum.Parse(typeof(WOrderCategoryEnum), Category);
            }
            if (!string.IsNullOrEmpty(IsDataSourceCanModify))
            {
                info.IsDataSourceCanModify = bool.Parse(IsDataSourceCanModify);
            }
            if (!string.IsNullOrEmpty(IsCategoryCanModify))
            {
                info.IsCategoryCanModify = bool.Parse(IsCategoryCanModify);
            }
            info.BusinessType = CommonFunction.ObjectToInteger(BusinessType, -1);
            info.BusinessTag  = CommonFunction.ObjectToInteger(BusinessTag, -1);
            info.RelatedData  = RelatedData;

            info.MaxName   = MaxName;
            info.MaxSex    = CommonFunction.ObjectToInteger(MaxSex, -1);
            info.MaxMember = MaxMember;

            info.CBName     = CBName;
            info.CBSex      = CommonFunction.ObjectToInteger(CBSex, -1);
            info.CBProvince = CommonFunction.ObjectToInteger(CBProvince, -1);
            info.CBCity     = CommonFunction.ObjectToInteger(CBCity, -1);
            info.CBCounty   = CommonFunction.ObjectToInteger(CBCounty, -1);
            info.CBMember   = CBMember;

            //yiche 测试秘钥
            if (info.GetKey() != key && key != "yiche")
            {
                return(null);
            }
            else if ((CallSource == CallSourceEnum.C03_IM对话 || CallSource == CallSourceEnum.C04_IM留言) &&
                     info.RelatedData == "")
            {
                //IM工单没有对应的对话id
                return(null);
            }
            else if (ModuleSource == ModuleSourceEnum.M04_未接来电 && info.RelatedData == "")
            {
                //未接来电没有recid
                return(null);
            }
            else
            {
                return(info);
            }
        }