Exemplo n.º 1
0
 public AbstractResponse GotoManyCustomerService(AbstractRequest requestMessage)
 {
     if (!this.IsOpenManyService())
     {
         return null;
     }
     return new AbstractResponse { FromUserName = requestMessage.ToUserName, ToUserName = requestMessage.FromUserName, MsgType = ResponseMsgType.transfer_customer_service };
 }
Exemplo n.º 2
0
 public override AbstractResponse DefaultResponse(AbstractRequest requestMessage)
 {
     ReplyInfo mismatchReply = ReplyHelper.GetMismatchReply();
     if ((mismatchReply == null) || this.IsOpenManyService())
     {
         return this.GotoManyCustomerService(requestMessage);
     }
     AbstractResponse response = this.GetResponse(mismatchReply, requestMessage.FromUserName);
     if (response == null)
     {
         return this.GotoManyCustomerService(requestMessage);
     }
     response.ToUserName = requestMessage.FromUserName;
     response.FromUserName = requestMessage.ToUserName;
     return response;
 }
Exemplo n.º 3
0
 public abstract AbstractResponse DefaultResponse(AbstractRequest requestMessage);
Exemplo n.º 4
0
 private AbstractResponse GetKeyResponse(string key, AbstractRequest request)
 {
     IList<ReplyInfo> replies = ReplyHelper.GetReplies(ReplyType.Topic);
     if ((replies != null) && (replies.Count > 0))
     {
         foreach (ReplyInfo info in replies)
         {
             if (info.Keys == key)
             {
                 TopicInfo topic = VShopHelper.Gettopic(info.ActivityId);
                 if (topic != null)
                 {
                     NewsResponse response = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article item = new Article {
                         Description = topic.Title,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, topic.IconUrl),
                         Title = topic.Title,
                         Url = string.Format("http://{0}/vshop/Topics.aspx?TopicId={1}", HttpContext.Current.Request.Url.Host, topic.TopicId)
                     };
                     response.Articles.Add(item);
                     return response;
                 }
             }
         }
     }
     IList<ReplyInfo> list2 = ReplyHelper.GetReplies(ReplyType.Vote);
     if ((list2 != null) && (list2.Count > 0))
     {
         foreach (ReplyInfo info3 in list2)
         {
             if (info3.Keys == key)
             {
                 VoteInfo voteById = StoreHelper.GetVoteById((long) info3.ActivityId);
                 if ((voteById != null) && voteById.IsBackup)
                 {
                     NewsResponse response2 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article2 = new Article {
                         Description = voteById.VoteName,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, voteById.ImageUrl),
                         Title = voteById.VoteName,
                         Url = string.Format("http://{0}/vshop/Vote.aspx?voteId={1}", HttpContext.Current.Request.Url.Host, voteById.VoteId)
                     };
                     response2.Articles.Add(article2);
                     return response2;
                 }
             }
         }
     }
     IList<ReplyInfo> list3 = ReplyHelper.GetReplies(ReplyType.Wheel);
     if ((list3 != null) && (list3.Count > 0))
     {
         foreach (ReplyInfo info5 in list3)
         {
             if (info5.Keys == key)
             {
                 LotteryActivityInfo lotteryActivityInfo = VShopHelper.GetLotteryActivityInfo(info5.ActivityId);
                 if (lotteryActivityInfo != null)
                 {
                     NewsResponse response3 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article3 = new Article {
                         Description = lotteryActivityInfo.ActivityDesc,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityPic),
                         Title = lotteryActivityInfo.ActivityName,
                         Url = string.Format("http://{0}/vshop/BigWheel.aspx?activityId={1}", HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityId)
                     };
                     response3.Articles.Add(article3);
                     return response3;
                 }
             }
         }
     }
     IList<ReplyInfo> list4 = ReplyHelper.GetReplies(ReplyType.Scratch);
     if ((list4 != null) && (list4.Count > 0))
     {
         foreach (ReplyInfo info7 in list4)
         {
             if (info7.Keys == key)
             {
                 LotteryActivityInfo info8 = VShopHelper.GetLotteryActivityInfo(info7.ActivityId);
                 if (info8 != null)
                 {
                     NewsResponse response4 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article4 = new Article {
                         Description = info8.ActivityDesc,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, info8.ActivityPic),
                         Title = info8.ActivityName,
                         Url = string.Format("http://{0}/vshop/Scratch.aspx?activityId={1}", HttpContext.Current.Request.Url.Host, info8.ActivityId)
                     };
                     response4.Articles.Add(article4);
                     return response4;
                 }
             }
         }
     }
     IList<ReplyInfo> list5 = ReplyHelper.GetReplies(ReplyType.SmashEgg);
     if ((list5 != null) && (list5.Count > 0))
     {
         foreach (ReplyInfo info9 in list5)
         {
             if (info9.Keys == key)
             {
                 LotteryActivityInfo info10 = VShopHelper.GetLotteryActivityInfo(info9.ActivityId);
                 if (info10 != null)
                 {
                     NewsResponse response5 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article5 = new Article {
                         Description = info10.ActivityDesc,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, info10.ActivityPic),
                         Title = info10.ActivityName,
                         Url = string.Format("http://{0}/vshop/SmashEgg.aspx?activityId={1}", HttpContext.Current.Request.Url.Host, info10.ActivityId)
                     };
                     response5.Articles.Add(article5);
                     return response5;
                 }
             }
         }
     }
     IList<ReplyInfo> list6 = ReplyHelper.GetReplies(ReplyType.SignUp);
     if ((list6 != null) && (list6.Count > 0))
     {
         foreach (ReplyInfo info11 in list6)
         {
             if (info11.Keys == key)
             {
                 ActivityInfo activity = VShopHelper.GetActivity(info11.ActivityId);
                 if (activity != null)
                 {
                     NewsResponse response6 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article6 = new Article {
                         Description = activity.Description,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, activity.PicUrl),
                         Title = activity.Name,
                         Url = string.Format("http://{0}/vshop/Activity.aspx?id={1}", HttpContext.Current.Request.Url.Host, activity.ActivityId)
                     };
                     response6.Articles.Add(article6);
                     return response6;
                 }
             }
         }
     }
     IList<ReplyInfo> list7 = ReplyHelper.GetReplies(ReplyType.Ticket);
     if ((list7 != null) && (list7.Count > 0))
     {
         foreach (ReplyInfo info13 in list7)
         {
             if (info13.Keys == key)
             {
                 LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(info13.ActivityId);
                 if (lotteryTicket != null)
                 {
                     NewsResponse response7 = new NewsResponse {
                         CreateTime = DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName = request.FromUserName,
                         Articles = new List<Article>()
                     };
                     Article article7 = new Article {
                         Description = lotteryTicket.ActivityDesc,
                         PicUrl = string.Format("http://{0}{1}", HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityPic),
                         Title = lotteryTicket.ActivityName,
                         Url = string.Format("http://{0}/vshop/SignUp.aspx?id={1}", HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityId)
                     };
                     response7.Articles.Add(article7);
                     return response7;
                 }
             }
         }
     }
     return null;
 }
Exemplo n.º 5
0
 public override AbstractResponse DefaultResponse(AbstractRequest requestMessage)
 {
     return null;
 }