Esempio n. 1
0
        /// <summary>
        /// 菜单点击事件
        /// </summary>
        /// <param name="xmldoc"></param>
        /// <returns></returns>
        private async Task <string> ClickHandle(XmlDocument xmldoc)
        {
            MessgeText messgeText = new MessgeText();

            messgeText.ToUserName   = xmldoc.SelectSingleNode("/xml/FromUserName").InnerText;
            messgeText.FromUserName = xmldoc.SelectSingleNode("/xml/ToUserName").InnerText;
            string strEventKey = xmldoc.SelectSingleNode("/xml/EventKey").InnerText;

            switch (strEventKey)
            {
            case "HongBao":
                messgeText.Content = MsgContent.HongBao();
                break;

            case "Free":
                messgeText.Content = MsgContent.Free();
                break;

            default:
                messgeText.Content = "我只能默认了……。" + strEventKey;
                break;
            }

            await Task.Run(() => {
                new UserInfoBll().Update(messgeText.ToUserName);
            });

            return(await Task.Run(() => { return messgeText.Messge; }));
        }
Esempio n. 2
0
        /// <summary>
        /// 消息处理
        /// </summary>
        /// <param name="xmldoc"></param>
        /// <returns></returns>
        public string Handle(XmlDocument xmldoc)
        {
            MessgeText messgeText = new MessgeText();

            messgeText.ToUserName   = xmldoc.SelectSingleNode("/xml/FromUserName").InnerText;
            messgeText.FromUserName = xmldoc.SelectSingleNode("/xml/ToUserName").InnerText;
            messgeText.Content      = "您们的信息已收到,我们会及时回复😋";
            new UserInfoBll().Update(messgeText.ToUserName);
            return(messgeText.Messge);
        }
Esempio n. 3
0
        /// <summary>
        /// 关注
        /// </summary>
        private string Subscribe(XmlDocument xmldoc)
        {
            MessgeText messgeText = new MessgeText();

            messgeText.ToUserName   = xmldoc.SelectSingleNode("/xml/FromUserName").InnerText;
            messgeText.FromUserName = xmldoc.SelectSingleNode("/xml/ToUserName").InnerText;
            string lvParenOpenID = xmldoc.SelectSingleNode("/xml/EventKey").InnerText;

            if (!string.IsNullOrEmpty(lvParenOpenID))
            {
                lvParenOpenID = lvParenOpenID.Split('_')[1];
            }
            else
            {
                lvParenOpenID = "";
            }
            messgeText.Content = MsgContent.Subscribe();
            return(messgeText.Messge);
        }