示例#1
0
        private string GetEventValue(string eventKey)
        {
            string         eventValue = string.Empty;
            ReponseMsgText mt         = new ReponseMsgText();

            mt.ToUserName   = reqEvent.FromUserName;
            mt.FromUserName = reqEvent.ToUserName;
            PlanningCertificateMsg pcMsg = new PlanningCertificateMsg();

            switch (eventKey)
            {
            //case "birth":
            //    eventValue =  pcMsg.GetBirthList();
            //    break;
            //case "marriage":
            //    eventValue =  pcMsg.GetMarriageList();
            //    break;
            //case "planning":
            //    eventValue =  pcMsg.GetPlanningList();
            //    break;
            //case "aids":
            //    eventValue =  pcMsg.GetAidsList();
            //    break;
            //case "otherPlanning":
            //    eventValue =  pcMsg.getOtherPlanningMsg();
            //    break;
            //case "oneTwo":
            //    eventValue =  pcMsg.getOneTwoList();
            //    break;
            //case "cooperative":
            //    eventValue =  pcMsg.getCooperativeList();
            //    break;
            //case "reward":
            //    eventValue =  pcMsg.getRewardList();
            //    break;
            //case "law":
            //    eventValue =  pcMsg.GetDefaultMsg();
            //    break;
            //case "activity":
            //    eventValue =  pcMsg.GetDefaultMsg();
            //    break;
            case "phone":
                eventValue = pcMsg.getPhoneServiceMsg();
                break;

            case "online":
                eventValue = pcMsg.getOnlineMsg();
                break;
                //case "health":
                //    eventValue = pcMsg.GetDefaultMsg();
                //    break;
                //case "characteristic":
                //    eventValue =  pcMsg.GetDefaultMsg();
                //    break;
            }
            mt.Content = eventValue;
            return(mt.ToXml());
        }
示例#2
0
        /// <summary>
        /// 处理请求
        /// </summary>
        /// <returns></returns>
        public string HandleRequest()
        {
            string response = string.Empty;

            //回复欢迎消息
            ReponseMsgText mt = new ReponseMsgText();

            mt.ToUserName   = reqEvent.FromUserName;
            mt.FromUserName = reqEvent.ToUserName;
            //mt.CreateTime = DateTimeHelper.GetNowTime();
            //mt.MsgType = MsgTypeEnum.TEXT;
            PlanningCertificateMsg pcMsg = new PlanningCertificateMsg();

            mt.Content = pcMsg.GetAttentionMsg();
            response   = mt.ToXml();
            return(response);
        }
示例#3
0
        /// <summary>
        /// 处理请求
        /// </summary>
        /// <returns></returns>
        public string HandleRequest()
        {
            string response = string.Empty;
            string content  = reqMsg.Content.Trim();

            if (string.IsNullOrEmpty(content))
            {
                PlanningCertificateMsg pcMsg = new PlanningCertificateMsg();
                ReponseMsgText         mt    = new ReponseMsgText();
                mt.ToUserName   = reqMsg.FromUserName;
                mt.FromUserName = reqMsg.ToUserName;
                mt.Content      = pcMsg.GetDefaultMsg();
                response        = mt.ToXml();
            }
            else
            {
                response = HandleOther(content);
            }
            return(response);
        }
示例#4
0
        /// <summary>
        /// 处理消息
        /// </summary>
        /// <param name="mt"></param>
        /// <returns></returns>
        private string HandleOther(string requestContent)
        {
            string         responseContent = string.Empty;
            ReponseMsgText mt = new ReponseMsgText();

            //进行发送者、接收者转换
            mt.ToUserName   = reqMsg.FromUserName;
            mt.FromUserName = reqMsg.ToUserName;
            PlanningCertificateMsg pcMsg = new PlanningCertificateMsg();

            if (requestContent.EndsWith("11"))
            {
                responseContent = pcMsg.GetOneBabyMsg();
            }
            else if (requestContent.EndsWith("12"))
            {
                responseContent = pcMsg.GetReBirthMsg();
            }
            else if (requestContent.EndsWith("13"))
            {
                responseContent = pcMsg.GetPlanBirthMsg();
            }
            else if (requestContent.EndsWith("21"))
            {
                responseContent = pcMsg.GetFlowWebBirthMsg();
            }
            else if (requestContent.EndsWith("22"))
            {
                responseContent = pcMsg.GetMarriedWebBirthMsg();
            }
            else if (requestContent.EndsWith("23"))
            {
                responseContent = pcMsg.GetFloatingPopulationWebBirthMsg();
            }
            else if (requestContent.EndsWith("31"))
            {
                responseContent = pcMsg.GetEveryPlanProveMsg();
            }
            else if (requestContent.EndsWith("32"))
            {
                responseContent = pcMsg.GetInProvinceFloatingPopulationPalnMsg();
            }
            else if (requestContent.EndsWith("33"))
            {
                responseContent = pcMsg.GetFloatingPopulationPalnMsg();
            }
            else if (requestContent.ToLower().EndsWith("34"))
            {
                responseContent = pcMsg.GetOneChildParentsMsg();
            }
            else if (requestContent.ToLower().EndsWith("41"))
            {
                responseContent = pcMsg.GetCountryFamilyBonusMsg();
            }
            else if (requestContent.ToLower().EndsWith("42"))
            {
                responseContent = pcMsg.GetCountryPlanBonusMsg();
            }
            else if (requestContent.ToLower().EndsWith("43"))
            {
                responseContent = pcMsg.GetCityParentPlanBonusMsg();
            }
            else if (requestContent.ToLower().EndsWith("44"))
            {
                responseContent = pcMsg.GetPlanFamilySpecialBonusMsg();
            }
            else if (requestContent.ToLower().EndsWith("51"))
            {
                responseContent = pcMsg.getDefinitionOnlyChildMsg();
            }
            else if (requestContent.ToLower().EndsWith("52"))
            {
                responseContent = pcMsg.getOnlyTowChildJoinMsg();
            }
            else if (requestContent.ToLower().EndsWith("53"))
            {
                responseContent = pcMsg.getMarriedAgainBirthMsg();
            }
            else if (requestContent.ToLower().EndsWith("54"))
            {
                responseContent = pcMsg.getMarriedAgainBirthApprovalMsg();
            }
            else if (requestContent.ToLower().EndsWith("61"))
            {
                responseContent = pcMsg.getRuralCooperativeApplicationMsg();
            }
            else if (requestContent.ToLower().EndsWith("62"))
            {
                responseContent = pcMsg.getRuralCooperativeAppliedDataMsg();
            }
            else if (requestContent.ToLower().EndsWith("63"))
            {
                responseContent = pcMsg.getRuralCooperativeGoThroughMsg();
            }
            else if (requestContent.ToLower().EndsWith("71"))
            {
                responseContent = pcMsg.getRuralFamilyPlanningRewardMsg();
            }
            else if (requestContent.ToLower().EndsWith("72"))
            {
                responseContent = pcMsg.getRuralPlanningBirthControlRewardMsg();
            }
            else if (requestContent.ToLower().EndsWith("73"))
            {
                responseContent = pcMsg.getTownFamilyPlanningRewardMsg();
            }
            else if (requestContent.ToLower().EndsWith("74"))
            {
                responseContent = pcMsg.getFamilyPlanningSpecialAssistanceMsg();
            }
            else
            {
                responseContent = pcMsg.GetDefaultMsg();
            }
            mt.Content = responseContent;
            string response = mt.ToXml();

            return(response);
        }