Beispiel #1
0
        public static ReqMsgBase GetReqMsgEntity(XDocument doc)
        {
            ReqMsgBase reqMsg  = null;
            string     msgType = doc.Root.Element(CommonEnum.MSG_TYPE).Value;

            switch (msgType)
            {
            case MsgTypeEnum.TEXT:
                reqMsg = new ReqMsgText();
                break;

            case MsgTypeEnum.EVENT:
                string eventType = doc.Root.Element(CommonEnum.EVENT_TYPE).Value;
                switch (eventType)
                {
                case "subscribe":
                    reqMsg = new ReqEventSubscribe();
                    break;

                case "CLICK":
                    reqMsg = new ReqEventClick();
                    break;
                }
                break;
            }
            EntityXmlHelper.FillEntityWithXml(reqMsg, doc);
            return(reqMsg);
        }
Beispiel #2
0
 public ReponseMsgCustomerService(ReqEventClick req) : this()
 {
     this.ToUserName   = req.FromUserName;
     this.FromUserName = req.ToUserName;
 }
Beispiel #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="requestXml"></param>
 public ClickEventHandler(ReqEventClick reqEvent)
 {
     this.reqEvent = reqEvent;
 }