public override AbstractResponse OnEvent_ClickRequest(ClickEventRequest clickEventRequest) { MenuInfo menu = VShopHelper.GetMenu(Convert.ToInt32(clickEventRequest.EventKey)); if (menu == null) { return null; } ReplyInfo reply = ReplyHelper.GetReply(menu.ReplyId); if (reply == null) { return null; } AbstractResponse keyResponse = this.GetKeyResponse(reply.Keys, clickEventRequest); if (keyResponse != null) { return keyResponse; } AbstractResponse response = this.GetResponse(reply, clickEventRequest.FromUserName); if (response == null) { this.GotoManyCustomerService(clickEventRequest); } response.ToUserName = clickEventRequest.FromUserName; response.FromUserName = clickEventRequest.ToUserName; return response; }
public virtual AbstractResponse OnEvent_ClickRequest(ClickEventRequest clickEventRequest) { return this.DefaultResponse(clickEventRequest); }
public static AbstractRequest GetRequestEntity(XDocument doc) { RequestMsgType msgType = MsgTypeHelper.GetMsgType(doc); AbstractRequest entity = null; switch (msgType) { case RequestMsgType.Text: entity = new TextRequest(); break; case RequestMsgType.Image: entity = new ImageRequest(); break; case RequestMsgType.Voice: entity = new VoiceRequest(); break; case RequestMsgType.Video: entity = new VideoRequest(); break; case RequestMsgType.Location: entity = new LocationRequest(); break; case RequestMsgType.Link: entity = new LinkRequest(); break; case RequestMsgType.Event: switch (EventTypeHelper.GetEventType(doc)) { case RequestEventType.Subscribe: entity = new SubscribeEventRequest(); goto Label_00C5; case RequestEventType.UnSubscribe: entity = new UnSubscribeEventRequest(); goto Label_00C5; case RequestEventType.Scan: entity = new ScanEventRequest(); goto Label_00C5; case RequestEventType.Location: entity = new LocationEventRequest(); goto Label_00C5; case RequestEventType.Click: entity = new ClickEventRequest(); goto Label_00C5; } throw new ArgumentOutOfRangeException(); default: throw new ArgumentOutOfRangeException(); } Label_00C5: EntityHelper.FillEntityWithXml<AbstractRequest>(entity, doc); return entity; }