예제 #1
0
        public static string DoSubscribe(PubRecEventSubscribe instanse)
        {
            PubSendMsgText msg = new PubSendMsgText("test1\ntest2", instanse.FromUserName);

            pubCore.SendMsg(msg);
            return("success");
        }
예제 #2
0
        public static string DoClick(PubRecEventClick instanse)
        {
            string strResult = string.Empty;

            if ("32".Equals(instanse.EventKey))
            {
                return(pubCore.TransferCustomerService(instanse));
            }
            else if ("31".Equals(instanse.EventKey))
            {
                try
                {
                    PubResMsgText msg  = new PubResMsgText();
                    string        flag = HTTPHelper.GetRequest(logoutURL + "?openid=" + instanse.FromUserName);
                    if (bool.Parse(flag))
                    {
                        msg.Content      = "解除绑定成功!";
                        msg.CreateTime   = instanse.CreateTime;
                        msg.FromUserName = instanse.ToUserName;
                        msg.ToUserName   = instanse.FromUserName;
                        strResult        = pubCore.AutoResponse(msg);
                    }
                }
                catch (Exception e)
                {
                    log.Error("PubWeChatSues DoClick Logout Err:", e);
                }
            }
            else
            {
                //PubResMsgText msg = new PubResMsgText();
                //msg.Content = "开发中,敬请期待!";
                //msg.CreateTime = instanse.CreateTime;
                //msg.FromUserName = instanse.ToUserName;
                //msg.ToUserName = instanse.FromUserName;
                //strResult = pubCore.AutoResponse(msg);
                PubSendMsgText msg = new PubSendMsgText("开发中,敬请期待!", instanse.FromUserName);
                pubCore.SendMsg(msg);
                return("success");
            }
            return(strResult);
        }