Esempio n. 1
0
        public bool SendMsg(SPPaymentInfoWrapper spPaymentInfo, out string errorMessage)
        {
            string requesturl = BulidUrl(spPaymentInfo);

            bool sendOk = SendRequest(requesturl, 10000, "ok", out errorMessage);

            return(sendOk);
        }
Esempio n. 2
0
        public bool SendMsgAndUpdate(SPPaymentInfoWrapper spPaymentInfoWrapper, out string errorMessage)
        {
            spPaymentInfoWrapper.SucesssToSend = SendMsg(spPaymentInfoWrapper, out errorMessage);

            SPPaymentInfoWrapper.Update(spPaymentInfoWrapper);

            return(spPaymentInfoWrapper.SucesssToSend.Value);
        }
Esempio n. 3
0
        public bool SendMsg(SPPaymentInfoWrapper spPaymentInfo)
        {
            string requesturl = "";

            //if (spPaymentInfo.IsSycnData.HasValue && spPaymentInfo.IsSycnData.Value && string.IsNullOrEmpty(spPaymentInfo.SSycnDataUrl))
            //{
            //    requesturl = spPaymentInfo.SSycnDataUrl;
            //}
            //else
            //{
            requesturl = BulidUrl(spPaymentInfo);
            //}

            spPaymentInfo.IsSycnData = true;

            spPaymentInfo.SSycnDataUrl = requesturl;

            string errorMessage = string.Empty;

            bool sendOk = SendRequest(requesturl, 10000, "ok", out errorMessage);

            return(sendOk);
        }
Esempio n. 4
0
        public string BulidUrl(SPPaymentInfoWrapper spPaymentInfo)
        {
            NameValueCollection queryString = HttpUtility.ParseQueryString(string.Empty);

            List <SPClientChannelSycnParamsWrapper> clientFieldMappings = this.GetFieldMappings();

            if (clientFieldMappings.Count > 0)
            {
                foreach (SPClientChannelSycnParamsWrapper clientFieldMapping in clientFieldMappings)
                {
                    switch (clientFieldMapping.MappingParams)
                    {
                    case "mid":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Mid);
                        break;

                    case "mobile":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.MobileNumber);
                        break;

                    case "port":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Port);
                        break;

                    case "ywid":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Ywid);
                        break;

                    case "msg":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Message);
                        break;

                    case "cpid":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Cpid);
                        break;

                    case "linkid":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Linkid);
                        break;

                    case "dest":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Dest);
                        break;

                    case "extendfield1":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField1);
                        break;

                    case "extendfield2":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField2);
                        break;

                    case "extendfield3":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField3);
                        break;

                    case "extendfield4":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField4);
                        break;

                    case "extendfield5":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField5);
                        break;

                    case "extendfield6":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField6);
                        break;

                    case "extendfield7":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField7);
                        break;

                    case "extendfield8":
                        BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField8);
                        break;
                    }
                }
            }
            else
            {
                List <SPChannelDefaultClientSycnParamsWrapper> channelFieldMappings = this.ChannelID.GetAllEnableDefaultSendParams();


                foreach (SPChannelDefaultClientSycnParamsWrapper channelDefaultClientSycnParam in channelFieldMappings)
                {
                    switch (channelDefaultClientSycnParam.MappingParams)
                    {
                    case "mid":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Mid);
                        break;

                    case "mobile":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.MobileNumber);
                        break;

                    case "port":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Port);
                        break;

                    case "ywid":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Ywid);
                        break;

                    case "msg":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Message);
                        break;

                    case "cpid":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Cpid);
                        break;

                    case "linkid":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Linkid);
                        break;

                    case "dest":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Dest);
                        break;

                    case "extendfield1":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField1);
                        break;

                    case "extendfield2":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField2);
                        break;

                    case "extendfield3":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField3);
                        break;

                    case "extendfield4":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField4);
                        break;

                    case "extendfield5":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField5);
                        break;

                    case "extendfield6":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField6);
                        break;

                    case "extendfield7":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField7);
                        break;

                    case "extendfield8":
                        BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField8);
                        break;
                    }
                }
            }

            Uri uri = new Uri(this.SyncDataUrl);

            if (string.IsNullOrEmpty(queryString.ToString()))
            {
                return(this.SyncDataUrl);
            }

            if (!string.IsNullOrEmpty(uri.Query.Trim()))
            {
                return(string.Format("{0}&{1}", this.SyncDataUrl, queryString.ToString()));
            }

            return(string.Format("{0}?{1}", this.SyncDataUrl, queryString.ToString()));
        }
Esempio n. 5
0
        public bool CaculteIsIntercept(SPPaymentInfoWrapper paymentInfo)
        {
            //if(this.InterceptRate.HasValue && this.InterceptRate.Value==0)
            //    return false;



            int interceptRate = 0;

            if (this.DefaultNoInterceptCount < 0)
            {
                this.DefaultNoInterceptCount = 0;
            }

            if (this.DefaultNoInterceptCount > 0)
            {
                this.DefaultNoInterceptCount = this.DefaultNoInterceptCount - 1;

                Update(this);

                return(false);
            }

            if (this.InterceptRate.HasValue)
            {
                interceptRate = this.InterceptRate.Value;
            }

            bool isIntercept = CaculteRandom(interceptRate);

            //如果没有扣除,如果该通道日总量有限制,超过了日总量,必须改成扣除
            if (!isIntercept && this.HasDayTotalLimit.HasValue && this.HasDayTotalLimit.Value)
            {
                if (this.DayTotalLimit.HasValue && this.DayTotalLimit.Value > 0)
                {
                    int todayPaymentCount = 0;

                    if (this.DayTotalLimitInProvince.HasValue && this.DayTotalLimitInProvince.Value)
                    {
                        if (this.LimitAreaAssigneds != null && LimitAreaAssigneds.Count > 0)
                        {
                            PhoneLimitAreaAssigned provincePhoneLimitAreaAssigneds = LimitAreaAssigneds.Find(p => (p.AreaName == paymentInfo.Province));

                            if (provincePhoneLimitAreaAssigneds != null)
                            {
                                todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id, paymentInfo.Province);
                            }
                            else
                            {
                                List <string> notInprovinces = new List <string>();

                                List <PhoneLimitAreaAssigned> allprovincePhoneLimitAreaAssigneds = LimitAreaAssigneds.FindAll(p => (p.AreaName != "其他"));

                                foreach (var allprovincePhoneLimitAreaAssigned in allprovincePhoneLimitAreaAssigneds)
                                {
                                    notInprovinces.Add(allprovincePhoneLimitAreaAssigned.AreaName);
                                }

                                todayPaymentCount = CacultePaymentCountNotInProvince(System.DateTime.Now.Date, this.Id, notInprovinces);
                            }
                        }
                        else
                        {
                            todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id, paymentInfo.Province);
                        }
                    }
                    else
                    {
                        todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id);
                    }

                    if (this.DayTotalLimitInProvince.HasValue && this.DayTotalLimitInProvince.Value && this.LimitAreaAssigneds != null && LimitAreaAssigneds.Count > 0)
                    {
                        var provinceAreaLimit = LimitAreaAssigneds.Find(p => (p.AreaName == paymentInfo.Province));

                        if (provinceAreaLimit != null)
                        {
                            if (todayPaymentCount >= provinceAreaLimit.LimitCount)
                            {
                                isIntercept = true;
                            }
                        }
                        else
                        {
                            var otherAreaLimit = LimitAreaAssigneds.Find(p => (p.AreaName == "其他"));

                            if (otherAreaLimit != null)
                            {
                                if (todayPaymentCount >= otherAreaLimit.LimitCount)
                                {
                                    isIntercept = true;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (todayPaymentCount >= this.DayTotalLimit.Value)
                        {
                            isIntercept = true;
                        }
                    }
                }
            }

            //限制时间强制扣除(无条件全扣)
            if (!isIntercept && this.HasDayTimeLimit.HasValue && this.HasDayTimeLimit.Value && !string.IsNullOrEmpty(this.DayTimeLimit))
            {
                TimeSpan ts = DaylimitEndTime;

                if (ts.Hours == 0)
                {
                    ts = DaylimitEndTime.Add(new TimeSpan(24, 0, 0));
                }

                if (DateTime.Now.TimeOfDay < DaylimitStartTime || DateTime.Now.TimeOfDay > ts)
                {
                    isIntercept = true;
                }
            }

            return(isIntercept);

            //if(interceptRate==0)
            //    return false;

            //decimal rate = GetToDayRate(this.ClinetID.Id, this.ChannelID.Id);

            //if (rate < Convert.ToDecimal(interceptRate))
            //{
            //    return CaculteRandom(Math.Min(interceptRate + AddRate, MaxInterceptRate));
            //}
            //else
            //{
            //    return false;
            //}
        }
Esempio n. 6
0
        public bool CaculteIsIntercept(SPPaymentInfoWrapper paymentInfo)
        {
            int interceptRate = 0;

            if (this.DefaultNoInterceptCount < 0)
            {
                this.DefaultNoInterceptCount = 0;
            }

            if (this.DefaultNoInterceptCount > 0)
            {
                this.DefaultNoInterceptCount = this.DefaultNoInterceptCount - 1;

                Update(this);

                return(false);
            }

            if (this.InterceptRate.HasValue)
            {
                interceptRate = this.InterceptRate.Value;
            }



            bool isIntercept = CaculteRandom(interceptRate);



            //如果是扣除的,如果该通道有号码日限制月限制,超过日限月限制的,先检查月限制,超过月限制乘以扣率,则放行(直接返回不检查日限制)
            //没有超过,在检查日限制,超过日限制乘以扣率,则放行

            if (isIntercept)
            {
                bool monthPhoneCount = false;

                if (this.HasDayMonthLimit.HasValue && this.HasDayMonthLimit.Value && this.MonthLimitCount.HasValue && this.MonthLimitCount.Value > 0)
                {
                    int todayMonthPhoneCount = CaculteMonthPhoneCount(System.DateTime.Now.Date, this.Id, paymentInfo.MobileNumber);

                    int maxMonthPhoneCount = this.MonthLimitCount.Value;

                    if (todayMonthPhoneCount + 1 > maxMonthPhoneCount)
                    {
                        isIntercept     = false;
                        monthPhoneCount = true;
                    }
                }
                if (!monthPhoneCount && this.HasDayMonthLimit.HasValue && this.HasDayMonthLimit.Value && this.DayLimitCount.HasValue && this.DayLimitCount.Value > 0)
                {
                    int todayDayPhoneCount = CaculteDayPhoneCount(System.DateTime.Now.Date, this.Id, paymentInfo.MobileNumber);

                    int maxDayPhoneCount = this.DayLimitCount.Value;

                    if (todayDayPhoneCount + 1 > maxDayPhoneCount)
                    {
                        isIntercept = false;
                    }
                }
            }


            //如果没有扣除,如果该通道日总量有限制,超过了日总量,必须改成扣除
            if (!isIntercept && this.HasDayTotalLimit.HasValue && this.HasDayTotalLimit.Value)
            {
                if (this.DayTotalLimit.HasValue && this.DayTotalLimit.Value > 0)
                {
                    int todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id);

                    if (todayPaymentCount >= this.DayTotalLimit.Value)
                    {
                        isIntercept = true;
                    }
                }
            }

            return(isIntercept);
        }
Esempio n. 7
0
 public static void Delete(SPPaymentInfoWrapper instance)
 {
     businessProxy.Delete(instance.entity);
 }
Esempio n. 8
0
 public static void Refresh(SPPaymentInfoWrapper instance)
 {
     businessProxy.Refresh(instance.entity);
 }
Esempio n. 9
0
 private bool CheckPaymentIsDataType(SPPaymentInfoWrapper payment, string dataType)
 {
     if (dataType == DataType.Down.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else if (dataType == DataType.DownNotSycn.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.IsSycnData.HasValue && !payment.IsSycnData.Value)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else if (dataType == DataType.DownSycn.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.SucesssToSend.HasValue && payment.SucesssToSend.Value)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else if (dataType == DataType.SycnFailed.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.SucesssToSend.HasValue && !payment.SucesssToSend.Value && payment.IsSycnData.HasValue && payment.IsSycnData.Value && payment.SycnRetryTimes.HasValue && payment.SycnRetryTimes.Value > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     return false;
 }
Esempio n. 10
0
 public static void SaveOrUpdate(SPPaymentInfoWrapper obj)
 {
     businessProxy.SaveOrUpdate(obj.entity);
 }
Esempio n. 11
0
        public bool SendMsgAndUpdate(SPPaymentInfoWrapper spPaymentInfoWrapper, out string errorMessage)
        {
            spPaymentInfoWrapper.SucesssToSend = SendMsg(spPaymentInfoWrapper, out errorMessage);

            SPPaymentInfoWrapper.Update(spPaymentInfoWrapper);

            return spPaymentInfoWrapper.SucesssToSend.Value;
        }
Esempio n. 12
0
        public bool SendMsg(SPPaymentInfoWrapper spPaymentInfo, out string errorMessage)
        {
            string requesturl = BulidUrl(spPaymentInfo);

            bool sendOk = SendRequest(requesturl, 10000, "ok", out errorMessage);

            return sendOk;
        }
Esempio n. 13
0
        public bool SendMsg(SPPaymentInfoWrapper spPaymentInfo)
        {
            string requesturl = "";

            //if (spPaymentInfo.IsSycnData.HasValue && spPaymentInfo.IsSycnData.Value && string.IsNullOrEmpty(spPaymentInfo.SSycnDataUrl))
            //{
            //    requesturl = spPaymentInfo.SSycnDataUrl;
            //}
            //else
            //{
               requesturl = BulidUrl(spPaymentInfo);
            //}

            spPaymentInfo.IsSycnData = true;

            spPaymentInfo.SSycnDataUrl = requesturl;

            string errorMessage = string.Empty;

            bool sendOk = SendRequest(requesturl, 10000, "ok", out errorMessage);

            return sendOk;
        }
Esempio n. 14
0
        public bool CaculteIsIntercept(SPPaymentInfoWrapper paymentInfo)
        {
            //if(this.InterceptRate.HasValue && this.InterceptRate.Value==0)
            //    return false;

            int interceptRate = 0;

            if(this.DefaultNoInterceptCount<0)
            {
                this.DefaultNoInterceptCount = 0;
            }

            if (this.DefaultNoInterceptCount>0)
            {
                this.DefaultNoInterceptCount = this.DefaultNoInterceptCount - 1;

                Update(this);

                return false;
            }

            if (this.InterceptRate.HasValue)
            {
                interceptRate = this.InterceptRate.Value;
            }

            bool isIntercept = CaculteRandom(interceptRate);

            //���û�п۳��������ͨ�������������ƣ�������������������ijɿ۳�
            if (!isIntercept && this.HasDayTotalLimit.HasValue && this.HasDayTotalLimit.Value)
            {
                if (this.DayTotalLimit.HasValue && this.DayTotalLimit.Value > 0)
                {
                    int todayPaymentCount = 0;

                    if(this.DayTotalLimitInProvince.HasValue && this.DayTotalLimitInProvince.Value)
                    {
                        if (this.LimitAreaAssigneds != null && LimitAreaAssigneds.Count > 0)
                        {
                            PhoneLimitAreaAssigned provincePhoneLimitAreaAssigneds = LimitAreaAssigneds.Find(p => (p.AreaName == paymentInfo.Province));

                            if (provincePhoneLimitAreaAssigneds!=null)
                            {
                                todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id, paymentInfo.Province);
                            }
                            else
                            {
                                List<string> notInprovinces = new List<string>();

                                List<PhoneLimitAreaAssigned> allprovincePhoneLimitAreaAssigneds = LimitAreaAssigneds.FindAll(p => (p.AreaName != "����"));

                                foreach (var allprovincePhoneLimitAreaAssigned in allprovincePhoneLimitAreaAssigneds)
                                {
                                    notInprovinces.Add(allprovincePhoneLimitAreaAssigned.AreaName);
                                }

                                todayPaymentCount = CacultePaymentCountNotInProvince(System.DateTime.Now.Date, this.Id, notInprovinces);

                            }

                        }
                        else
                        {
                            todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id, paymentInfo.Province);
                        }
                    }
                    else
                    {
                        todayPaymentCount = CacultePaymentCount(System.DateTime.Now.Date, this.Id);
                    }

                    if (this.DayTotalLimitInProvince.HasValue && this.DayTotalLimitInProvince.Value && this.LimitAreaAssigneds != null && LimitAreaAssigneds.Count > 0)
                    {
                        var provinceAreaLimit = LimitAreaAssigneds.Find(p => (p.AreaName == paymentInfo.Province));

                        if(provinceAreaLimit!=null)
                        {
                            if (todayPaymentCount >= provinceAreaLimit.LimitCount)
                                isIntercept = true;
                        }
                        else
                        {
                            var otherAreaLimit = LimitAreaAssigneds.Find(p => (p.AreaName == "����"));

                            if (otherAreaLimit != null)
                            {
                                if (todayPaymentCount >= otherAreaLimit.LimitCount)
                                    isIntercept = true;
                            }
                        }
                    }
                    else
                    {
                        if (todayPaymentCount >= this.DayTotalLimit.Value)
                            isIntercept = true;
                    }

                }
            }

            //����ʱ��ǿ�ƿ۳�(������ȫ��)
            if (!isIntercept && this.HasDayTimeLimit.HasValue && this.HasDayTimeLimit.Value && !string.IsNullOrEmpty(this.DayTimeLimit))
            {
                TimeSpan ts = DaylimitEndTime;

                if(ts.Hours==0)
                {
                    ts = DaylimitEndTime.Add(new TimeSpan(24, 0, 0));
                }

                if (DateTime.Now.TimeOfDay < DaylimitStartTime || DateTime.Now.TimeOfDay > ts)
                {
                    isIntercept = true;
                }
            }

            return isIntercept;

            //if(interceptRate==0)
            //    return false;

            //decimal rate = GetToDayRate(this.ClinetID.Id, this.ChannelID.Id);

            //if (rate < Convert.ToDecimal(interceptRate))
            //{
            //    return CaculteRandom(Math.Min(interceptRate + AddRate, MaxInterceptRate));
            //}
            //else
            //{
            //    return false;
            //}
        }
Esempio n. 15
0
        public string BulidUrl(SPPaymentInfoWrapper spPaymentInfo)
        {
            NameValueCollection queryString = HttpUtility.ParseQueryString(string.Empty);

            List<SPClientChannelSycnParamsWrapper> clientFieldMappings = this.GetFieldMappings();

            if (clientFieldMappings.Count > 0)
            {
                foreach (SPClientChannelSycnParamsWrapper clientFieldMapping in clientFieldMappings)
                {
                    switch (clientFieldMapping.MappingParams)
                    {
                        case "mid":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Mid);
                            break;
                        case "mobile":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.MobileNumber);
                            break;
                        case "port":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Port);
                            break;
                        case "ywid":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Ywid);
                            break;
                        case "msg":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Message);
                            break;
                        case "cpid":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Cpid);
                            break;
                        case "linkid":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Linkid);
                            break;
                        case "dest":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.Dest);
                            break;
                        case "extendfield1":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField1);
                            break;
                        case "extendfield2":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField2);
                            break;
                        case "extendfield3":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField3);
                            break;
                        case "extendfield4":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField4);
                            break;
                        case "extendfield5":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField5);
                            break;
                        case "extendfield6":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField6);
                            break;
                        case "extendfield7":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField7);
                            break;
                        case "extendfield8":
                            BulidParams(queryString, clientFieldMapping.Name, spPaymentInfo.ExtendField8);
                            break;
                    }
                }
            }
            else
            {
                List<SPChannelDefaultClientSycnParamsWrapper> channelFieldMappings = this.ChannelID.GetAllEnableDefaultSendParams();

                foreach (SPChannelDefaultClientSycnParamsWrapper channelDefaultClientSycnParam in channelFieldMappings)
                {
                    switch (channelDefaultClientSycnParam.MappingParams)
                    {
                        case "mid":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Mid);
                            break;
                        case "mobile":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.MobileNumber);
                            break;
                        case "port":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Port);
                            break;
                        case "ywid":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Ywid);
                            break;
                        case "msg":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Message);
                            break;
                        case "cpid":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Cpid);
                            break;
                        case "linkid":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Linkid);
                            break;
                        case "dest":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.Dest);
                            break;
                        case "extendfield1":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField1);
                            break;
                        case "extendfield2":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField2);
                            break;
                        case "extendfield3":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField3);
                            break;
                        case "extendfield4":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField4);
                            break;
                        case "extendfield5":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField5);
                            break;
                        case "extendfield6":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField6);
                            break;
                        case "extendfield7":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField7);
                            break;
                        case "extendfield8":
                            BulidParams(queryString, channelDefaultClientSycnParam.Name, spPaymentInfo.ExtendField8);
                            break;
                    }
                }
            }

            Uri uri = new Uri(this.SyncDataUrl);

            if (string.IsNullOrEmpty(queryString.ToString()))
            {
                return this.SyncDataUrl;
            }

            if (!string.IsNullOrEmpty(uri.Query.Trim()))
                return string.Format("{0}&{1}", this.SyncDataUrl, queryString.ToString());

            return string.Format("{0}?{1}", this.SyncDataUrl, queryString.ToString());
        }