Esempio n. 1
0
        private void btnEditActivity_Click(object sender, EventArgs e)
        {
            int result = 0;

            if (!this.txtStartDate.SelectedDate.HasValue)
            {
                this.ShowMsg("请选择开始日期!", false);
            }
            else if (!this.txtEndDate.SelectedDate.HasValue)
            {
                this.ShowMsg("请选择结束日期!", false);
            }
            else if (this.txtStartDate.SelectedDate.Value.CompareTo(this.txtEndDate.SelectedDate.Value) >= 0)
            {
                this.ShowMsg("开始日期不能晚于结束日期!", false);
            }
            else if ((this.txtMaxValue.Text != "") && !int.TryParse(this.txtMaxValue.Text, out result))
            {
                this.ShowMsg("人数上限格式错误!", false);
            }
            else
            {
                ActivityInfo activity = VShopHelper.GetActivity(base.GetUrlIntParam("id"));
                if ((activity.Keys != this.txtKeys.Text.Trim()) && ReplyHelper.HasReplyKey(this.txtKeys.Text.Trim()))
                {
                    this.ShowMsg("关键字重复!", false);
                }
                else
                {
                    activity.CloseRemark = this.txtCloseRemark.Text.Trim();
                    activity.Description = this.txtDescription.Text.Trim();
                    activity.EndDate     = this.txtEndDate.SelectedDate.Value.AddMinutes(59.0).AddSeconds(59.0);
                    activity.Item1       = this.txtItem1.Text.Trim();
                    activity.Item2       = this.txtItem2.Text.Trim();
                    activity.Item3       = this.txtItem3.Text.Trim();
                    activity.Item4       = this.txtItem4.Text.Trim();
                    activity.Item5       = this.txtItem5.Text.Trim();
                    activity.Keys        = this.txtKeys.Text.Trim();
                    activity.MaxValue    = result;
                    activity.Name        = this.txtName.Text.Trim();
                    activity.PicUrl      = this.uploader1.UploadedImageUrl;
                    activity.StartDate   = this.txtStartDate.SelectedDate.Value;
                    if (VShopHelper.UpdateActivity(activity))
                    {
                        base.Response.Redirect("ManageActivity.aspx");
                    }
                    else
                    {
                        this.ShowMsg("更新失败", false);
                    }
                }
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         int          urlIntParam = base.GetUrlIntParam("id");
         ActivityInfo activity    = VShopHelper.GetActivity(urlIntParam);
         if (activity != null)
         {
             this._act           = activity;
             this.rpt.DataSource = VShopHelper.GetActivitySignUpById(urlIntParam);
             this.rpt.DataBind();
         }
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         int           urlIntParam = base.GetUrlIntParam("id");
         VActivityInfo activity    = VShopHelper.GetActivity(urlIntParam);
         if (activity != null)
         {
             this._act = activity;
             IList <ActivitySignUpInfo> activitySignUpById = VShopHelper.GetActivitySignUpById(urlIntParam);
             this.rpt.DataSource = activitySignUpById;
             this.rpt.DataBind();
             this.nodata = (this.rpt.Items.Count == 0);
         }
     }
 }
Esempio n. 4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnEditActivity.Click += new System.EventHandler(this.btnEditActivity_Click);
     if (!this.Page.IsPostBack)
     {
         ActivityInfo activity = VShopHelper.GetActivity(base.GetUrlIntParam("id"));
         this.txtCloseRemark.Text     = activity.CloseRemark;
         this.txtDescription.Text     = activity.Description;
         this.txtEndDate.SelectedDate = new System.DateTime?(activity.EndDate);
         this.txtKeys.Text            = activity.Keys;
         if (activity.MaxValue != 0)
         {
             this.txtMaxValue.Text = activity.MaxValue.ToString();
         }
         this.txtName.Text = activity.Name;
         this.txtStartDate.SelectedDate  = new System.DateTime?(activity.StartDate);
         this.uploader1.UploadedImageUrl = activity.PicUrl;
         this.txtItem1.Text = activity.Item1;
         this.txtItem2.Text = activity.Item2;
         this.txtItem3.Text = activity.Item3;
         this.txtItem4.Text = activity.Item4;
         this.txtItem5.Text = activity.Item5;
     }
 }
Esempio n. 5
0
 private AbstractResponse GetKeyResponse(string key, AbstractRequest request)
 {
     System.Collections.Generic.IList <ReplyInfo> replies = ReplyHelper.GetReplies(ReplyType.Topic);
     if (replies != null && replies.Count > 0)
     {
         foreach (ReplyInfo current in replies)
         {
             if (current.Keys == key)
             {
                 TopicInfo topicInfo = VShopHelper.Gettopic(current.ActivityId);
                 if (topicInfo != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = topicInfo.Title,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, topicInfo.IconUrl),
                                 Title       = topicInfo.Title,
                                 Url         = string.Format("http://{0}/vshop/Topics.aspx?TopicId={1}", System.Web.HttpContext.Current.Request.Url.Host, topicInfo.TopicId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies2 = ReplyHelper.GetReplies(ReplyType.Vote);
     if (replies2 != null && replies2.Count > 0)
     {
         foreach (ReplyInfo current2 in replies2)
         {
             if (current2.Keys == key)
             {
                 VoteInfo voteById = StoreHelper.GetVoteById((long)current2.ActivityId);
                 if (voteById != null && voteById.IsBackup)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = voteById.VoteName,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, voteById.ImageUrl),
                                 Title       = voteById.VoteName,
                                 Url         = string.Format("http://{0}/vshop/Vote.aspx?voteId={1}", System.Web.HttpContext.Current.Request.Url.Host, voteById.VoteId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies3 = ReplyHelper.GetReplies(ReplyType.Wheel);
     if (replies3 != null && replies3.Count > 0)
     {
         foreach (ReplyInfo current3 in replies3)
         {
             if (current3.Keys == key)
             {
                 LotteryActivityInfo lotteryActivityInfo = VShopHelper.GetLotteryActivityInfo(current3.ActivityId);
                 if (lotteryActivityInfo != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = lotteryActivityInfo.ActivityDesc,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityPic),
                                 Title       = lotteryActivityInfo.ActivityName,
                                 Url         = string.Format("http://{0}/vshop/BigWheel.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies4 = ReplyHelper.GetReplies(ReplyType.Scratch);
     if (replies4 != null && replies4.Count > 0)
     {
         foreach (ReplyInfo current4 in replies4)
         {
             if (current4.Keys == key)
             {
                 LotteryActivityInfo lotteryActivityInfo2 = VShopHelper.GetLotteryActivityInfo(current4.ActivityId);
                 if (lotteryActivityInfo2 != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = lotteryActivityInfo2.ActivityDesc,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo2.ActivityPic),
                                 Title       = lotteryActivityInfo2.ActivityName,
                                 Url         = string.Format("http://{0}/vshop/Scratch.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo2.ActivityId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies5 = ReplyHelper.GetReplies(ReplyType.SmashEgg);
     if (replies5 != null && replies5.Count > 0)
     {
         foreach (ReplyInfo current5 in replies5)
         {
             if (current5.Keys == key)
             {
                 LotteryActivityInfo lotteryActivityInfo3 = VShopHelper.GetLotteryActivityInfo(current5.ActivityId);
                 if (lotteryActivityInfo3 != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = lotteryActivityInfo3.ActivityDesc,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo3.ActivityPic),
                                 Title       = lotteryActivityInfo3.ActivityName,
                                 Url         = string.Format("http://{0}/vshop/SmashEgg.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo3.ActivityId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies6 = ReplyHelper.GetReplies(ReplyType.SignUp);
     if (replies6 != null && replies6.Count > 0)
     {
         foreach (ReplyInfo current6 in replies6)
         {
             if (current6.Keys == key)
             {
                 ActivityInfo activity = VShopHelper.GetActivity(current6.ActivityId);
                 if (activity != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = activity.Description,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, activity.PicUrl),
                                 Title       = activity.Name,
                                 Url         = string.Format("http://{0}/vshop/Activity.aspx?id={1}", System.Web.HttpContext.Current.Request.Url.Host, activity.ActivityId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     System.Collections.Generic.IList <ReplyInfo> replies7 = ReplyHelper.GetReplies(ReplyType.Ticket);
     if (replies7 != null && replies7.Count > 0)
     {
         foreach (ReplyInfo current7 in replies7)
         {
             if (current7.Keys == key)
             {
                 LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(current7.ActivityId);
                 if (lotteryTicket != null)
                 {
                     AbstractResponse result = new NewsResponse
                     {
                         CreateTime   = System.DateTime.Now,
                         FromUserName = request.ToUserName,
                         ToUserName   = request.FromUserName,
                         //修改1
                         Articles =
                         {
                             new Article
                             {
                                 Description = lotteryTicket.ActivityDesc,
                                 PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityPic),
                                 Title       = lotteryTicket.ActivityName,
                                 Url         = string.Format("http://{0}/vshop/SignUp.aspx?id={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityId)
                             }
                         }
                     };
                     return(result);
                 }
             }
         }
     }
     return(null);
 }
Esempio n. 6
0
        private AbstractResponse GetKeyResponse(string key, AbstractRequest request)
        {
            System.Collections.Generic.IList <ReplyInfo> replies = ReplyHelper.GetReplies(ReplyType.Topic);
            AbstractResponse result;

            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   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article item = new Article
                            {
                                Description = topic.Title,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, topic.IconUrl),
                                Title       = topic.Title,
                                Url         = string.Format("http://{0}/vshop/Topics.aspx?TopicId={1}", System.Web.HttpContext.Current.Request.Url.Host, topic.TopicId)
                            };
                            response.Articles.Add(item);
                            result = response;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list2 = ReplyHelper.GetReplies(ReplyType.Vote);
            if (list2 != null && list2.Count > 0)
            {
                foreach (ReplyInfo info2 in list2)
                {
                    if (info2.Keys == key)
                    {
                        VoteInfo voteById = StoreHelper.GetVoteById((long)info2.ActivityId);
                        if (voteById != null && voteById.IsBackup)
                        {
                            NewsResponse response2 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article2 = new Article
                            {
                                Description = voteById.VoteName,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, voteById.ImageUrl),
                                Title       = voteById.VoteName,
                                Url         = string.Format("http://{0}/vshop/Vote.aspx?voteId={1}", System.Web.HttpContext.Current.Request.Url.Host, voteById.VoteId)
                            };
                            response2.Articles.Add(article2);
                            result = response2;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list3 = ReplyHelper.GetReplies(ReplyType.Wheel);
            if (list3 != null && list3.Count > 0)
            {
                foreach (ReplyInfo info3 in list3)
                {
                    if (info3.Keys == key)
                    {
                        LotteryActivityInfo lotteryActivityInfo = VShopHelper.GetLotteryActivityInfo(info3.ActivityId);
                        if (lotteryActivityInfo != null)
                        {
                            NewsResponse response3 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article3 = new Article
                            {
                                Description = lotteryActivityInfo.ActivityDesc,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityPic),
                                Title       = lotteryActivityInfo.ActivityName,
                                Url         = string.Format("http://{0}/vshop/BigWheel.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryActivityInfo.ActivityId)
                            };
                            response3.Articles.Add(article3);
                            result = response3;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list4 = ReplyHelper.GetReplies(ReplyType.Scratch);
            if (list4 != null && list4.Count > 0)
            {
                foreach (ReplyInfo info4 in list4)
                {
                    if (info4.Keys == key)
                    {
                        LotteryActivityInfo info5 = VShopHelper.GetLotteryActivityInfo(info4.ActivityId);
                        if (info5 != null)
                        {
                            NewsResponse response4 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article4 = new Article
                            {
                                Description = info5.ActivityDesc,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, info5.ActivityPic),
                                Title       = info5.ActivityName,
                                Url         = string.Format("http://{0}/vshop/Scratch.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, info5.ActivityId)
                            };
                            response4.Articles.Add(article4);
                            result = response4;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list5 = ReplyHelper.GetReplies(ReplyType.SmashEgg);
            if (list5 != null && list5.Count > 0)
            {
                foreach (ReplyInfo info6 in list5)
                {
                    if (info6.Keys == key)
                    {
                        LotteryActivityInfo info7 = VShopHelper.GetLotteryActivityInfo(info6.ActivityId);
                        if (info7 != null)
                        {
                            NewsResponse response5 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article5 = new Article
                            {
                                Description = info7.ActivityDesc,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, info7.ActivityPic),
                                Title       = info7.ActivityName,
                                Url         = string.Format("http://{0}/vshop/SmashEgg.aspx?activityId={1}", System.Web.HttpContext.Current.Request.Url.Host, info7.ActivityId)
                            };
                            response5.Articles.Add(article5);
                            result = response5;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list6 = ReplyHelper.GetReplies(ReplyType.SignUp);
            if (list6 != null && list6.Count > 0)
            {
                foreach (ReplyInfo info8 in list6)
                {
                    if (info8.Keys == key)
                    {
                        ActivityInfo activity = VShopHelper.GetActivity(info8.ActivityId);
                        if (activity != null)
                        {
                            NewsResponse response6 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article6 = new Article
                            {
                                Description = activity.Description,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, activity.PicUrl),
                                Title       = activity.Name,
                                Url         = string.Format("http://{0}/vshop/Activity.aspx?id={1}", System.Web.HttpContext.Current.Request.Url.Host, activity.ActivityId)
                            };
                            response6.Articles.Add(article6);
                            result = response6;
                            return(result);
                        }
                    }
                }
            }
            System.Collections.Generic.IList <ReplyInfo> list7 = ReplyHelper.GetReplies(ReplyType.Ticket);
            if (list7 != null && list7.Count > 0)
            {
                foreach (ReplyInfo info9 in list7)
                {
                    if (info9.Keys == key)
                    {
                        LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(info9.ActivityId);
                        if (lotteryTicket != null)
                        {
                            NewsResponse response7 = new NewsResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                FromUserName = request.ToUserName,
                                ToUserName   = request.FromUserName,
                                Articles     = new System.Collections.Generic.List <Article>()
                            };
                            Article article7 = new Article
                            {
                                Description = lotteryTicket.ActivityDesc,
                                PicUrl      = string.Format("http://{0}{1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityPic),
                                Title       = lotteryTicket.ActivityName,
                                Url         = string.Format("http://{0}/vshop/SignUp.aspx?id={1}", System.Web.HttpContext.Current.Request.Url.Host, lotteryTicket.ActivityId)
                            };
                            response7.Articles.Add(article7);
                            result = response7;
                            return(result);
                        }
                    }
                }
            }
            result = null;
            return(result);
        }
Esempio n. 7
0
        private AbstractResponse GetKeyResponse(string key, AbstractRequest request)
        {
            IList <ReplyInfo> replies = ReplyHelper.GetReplies(ReplyType.Vote);

            if (replies != null && replies.Count > 0)
            {
                foreach (ReplyInfo item in replies)
                {
                    if (item.Keys == key)
                    {
                        VoteInfo voteById = StoreHelper.GetVoteById(item.ActivityId);
                        if (voteById != null && voteById.IsBackup)
                        {
                            NewsResponse newsResponse = new NewsResponse();
                            newsResponse.CreateTime   = DateTime.Now;
                            newsResponse.FromUserName = request.ToUserName;
                            newsResponse.ToUserName   = request.FromUserName;
                            newsResponse.Articles     = new List <Article>();
                            newsResponse.Articles.Add(new Article
                            {
                                Description = voteById.VoteName,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{voteById.ImageUrl}",
                                Title       = voteById.VoteName,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/Vote.aspx?voteId={voteById.VoteId}"
                            });
                            return(newsResponse);
                        }
                    }
                }
            }
            IList <ReplyInfo> replies2 = ReplyHelper.GetReplies(ReplyType.Wheel);

            if (replies2 != null && replies2.Count > 0)
            {
                foreach (ReplyInfo item2 in replies2)
                {
                    if (item2.Keys == key)
                    {
                        LotteryActivityInfo lotteryActivityInfo = VShopHelper.GetLotteryActivityInfo(item2.ActivityId);
                        if (lotteryActivityInfo != null)
                        {
                            NewsResponse newsResponse2 = new NewsResponse();
                            newsResponse2.CreateTime   = DateTime.Now;
                            newsResponse2.FromUserName = request.ToUserName;
                            newsResponse2.ToUserName   = request.FromUserName;
                            newsResponse2.Articles     = new List <Article>();
                            newsResponse2.Articles.Add(new Article
                            {
                                Description = lotteryActivityInfo.ActivityDesc,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{lotteryActivityInfo.ActivityPic}",
                                Title       = lotteryActivityInfo.ActivityName,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/BigWheel.aspx?activityId={lotteryActivityInfo.ActivityId}"
                            });
                            return(newsResponse2);
                        }
                    }
                }
            }
            IList <ReplyInfo> replies3 = ReplyHelper.GetReplies(ReplyType.Scratch);

            if (replies3 != null && replies3.Count > 0)
            {
                foreach (ReplyInfo item3 in replies3)
                {
                    if (item3.Keys == key)
                    {
                        LotteryActivityInfo lotteryActivityInfo2 = VShopHelper.GetLotteryActivityInfo(item3.ActivityId);
                        if (lotteryActivityInfo2 != null)
                        {
                            NewsResponse newsResponse3 = new NewsResponse();
                            newsResponse3.CreateTime   = DateTime.Now;
                            newsResponse3.FromUserName = request.ToUserName;
                            newsResponse3.ToUserName   = request.FromUserName;
                            newsResponse3.Articles     = new List <Article>();
                            newsResponse3.Articles.Add(new Article
                            {
                                Description = lotteryActivityInfo2.ActivityDesc,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{lotteryActivityInfo2.ActivityPic}",
                                Title       = lotteryActivityInfo2.ActivityName,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/Scratch.aspx?activityId={lotteryActivityInfo2.ActivityId}"
                            });
                            return(newsResponse3);
                        }
                    }
                }
            }
            IList <ReplyInfo> replies4 = ReplyHelper.GetReplies(ReplyType.SmashEgg);

            if (replies4 != null && replies4.Count > 0)
            {
                foreach (ReplyInfo item4 in replies4)
                {
                    if (item4.Keys == key)
                    {
                        LotteryActivityInfo lotteryActivityInfo3 = VShopHelper.GetLotteryActivityInfo(item4.ActivityId);
                        if (lotteryActivityInfo3 != null)
                        {
                            NewsResponse newsResponse4 = new NewsResponse();
                            newsResponse4.CreateTime   = DateTime.Now;
                            newsResponse4.FromUserName = request.ToUserName;
                            newsResponse4.ToUserName   = request.FromUserName;
                            newsResponse4.Articles     = new List <Article>();
                            newsResponse4.Articles.Add(new Article
                            {
                                Description = lotteryActivityInfo3.ActivityDesc,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{lotteryActivityInfo3.ActivityPic}",
                                Title       = lotteryActivityInfo3.ActivityName,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/SmashEgg.aspx?activityId={lotteryActivityInfo3.ActivityId}"
                            });
                            return(newsResponse4);
                        }
                    }
                }
            }
            IList <ReplyInfo> replies5 = ReplyHelper.GetReplies(ReplyType.SignUp);

            if (replies5 != null && replies5.Count > 0)
            {
                foreach (ReplyInfo item5 in replies5)
                {
                    if (item5.Keys == key)
                    {
                        VActivityInfo activity = VShopHelper.GetActivity(item5.ActivityId);
                        if (activity != null)
                        {
                            NewsResponse newsResponse5 = new NewsResponse();
                            newsResponse5.CreateTime   = DateTime.Now;
                            newsResponse5.FromUserName = request.ToUserName;
                            newsResponse5.ToUserName   = request.FromUserName;
                            newsResponse5.Articles     = new List <Article>();
                            newsResponse5.Articles.Add(new Article
                            {
                                Description = activity.Description,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{activity.PicUrl}",
                                Title       = activity.Name,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/Activity.aspx?id={activity.ActivityId}"
                            });
                            return(newsResponse5);
                        }
                    }
                }
            }
            IList <ReplyInfo> replies6 = ReplyHelper.GetReplies(ReplyType.Ticket);

            if (replies6 != null && replies6.Count > 0)
            {
                foreach (ReplyInfo item6 in replies6)
                {
                    if (item6.Keys == key)
                    {
                        LotteryTicketInfo lotteryTicket = VShopHelper.GetLotteryTicket(item6.ActivityId);
                        if (lotteryTicket != null)
                        {
                            NewsResponse newsResponse6 = new NewsResponse();
                            newsResponse6.CreateTime   = DateTime.Now;
                            newsResponse6.FromUserName = request.ToUserName;
                            newsResponse6.ToUserName   = request.FromUserName;
                            newsResponse6.Articles     = new List <Article>();
                            newsResponse6.Articles.Add(new Article
                            {
                                Description = lotteryTicket.ActivityDesc,
                                PicUrl      = $"http://{HttpContext.Current.Request.Url.Host}{lotteryTicket.ActivityPic}",
                                Title       = lotteryTicket.ActivityName,
                                Url         = $"http://{HttpContext.Current.Request.Url.Host}/vshop/SignUp.aspx?id={lotteryTicket.ActivityId}"
                            });
                            return(newsResponse6);
                        }
                    }
                }
            }
            return(null);
        }
Esempio n. 8
0
        private AbstractResponse GetKeyResponse(string key, AbstractRequest request)
        {
            IList <ReplyInfo> replies = ReplyHelper.GetReplies(ReplyType.Topic, this.wid);

            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, this.wid);

            if ((list2 != null) && (list2.Count > 0))
            {
                foreach (ReplyInfo info3 in list2)
                {
                    if (info3.Keys == key)
                    {
                        Hidistro.Entities.Promotions.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, this.wid);

            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, this.wid);

            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, this.wid);

            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, this.wid);

            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, this.wid);

            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);
        }