Exemplo n.º 1
0
        protected override void AttachChildControls()
        {
            int num;

            int.TryParse(HttpContext.Current.Request.QueryString.Get("id"), out num);
            if (VshopBrowser.GetUserPrizeRecord(num) == null)
            {
                this.Context.Response.Redirect(this.Context.Request.Url.ToString().ToLower().Replace("ticket.aspx", "SignUp.aspx"));
                this.Context.Response.End();
            }
            else
            {
                LotteryTicketInfo lotteryTicket = VshopBrowser.GetLotteryTicket(num);
                if (lotteryTicket == null)
                {
                    base.GotoResourceNotFound("");
                }
                this.hdID                   = (HiddenField)this.FindControl("hdID");
                this.hdID.Value             = num.ToString();
                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("微抽奖(" + lotteryTicket.ActivityName + ")");
            }
        }
Exemplo n.º 2
0
        protected override void AttachChildControls()
        {
            int num;

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

            if (lotteryTicket == null)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                return;
            }
            if (!(HiContext.Current.User is Member))
            {
                System.Web.HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/Tocket.aspx?id=" + num);
                return;
            }
            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.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("微抽奖");
        }
Exemplo n.º 3
0
        protected override void AttachChildControls()
        {
            int num = default(int);

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

            if (user.UserId == 0)
            {
                HttpContext.Current.Response.Redirect("/Vshop/login.aspx?ReturnUrl=/Vshop/Ticket.aspx?id=" + num);
            }
            else if (lotteryTicket == null)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
            }
            else
            {
                if (lotteryTicket != null && !VshopBrowser.HasSignUp(num, HiContext.Current.UserId) && DateTime.Now >= lotteryTicket.StartTime)
                {
                    HttpContext.Current.Response.Redirect($"~/vshop/SignUp.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>");
                }
                if (lotteryTicket.OpenTime > DateTime.Now)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){hideSignUpBtn();alert_h(\"抽奖还未开始!\",function(){window.location.href=\"/vshop/default.aspx\";});});</script>");
                }
                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.hdTitle         = (HtmlInputHidden)this.FindControl("hdTitle");
                this.hdAppId         = (HtmlInputHidden)this.FindControl("hdAppId");
                this.hdDesc          = (HtmlInputHidden)this.FindControl("hdDesc");
                this.hdImgUrl        = (HtmlInputHidden)this.FindControl("hdImgUrl");
                this.hdLink          = (HtmlInputHidden)this.FindControl("hdLink");
                if (base.ClientType == ClientType.VShop)
                {
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                    string       local          = (!string.IsNullOrWhiteSpace(lotteryTicket.ActivityPic)) ? lotteryTicket.ActivityPic : Globals.FullPath(masterSettings.LogoUrl);
                    this.hdImgUrl.Value = Globals.FullPath(local);
                    this.hdTitle.Value  = lotteryTicket.ActivityName;
                    this.hdDesc.Value   = lotteryTicket.ActivityDesc;
                    this.hdLink.Value   = Globals.FullPath($"/vshop/Ticket?id={lotteryTicket.ActivityId}");
                    this.hdAppId.Value  = masterSettings.WeixinAppId;
                }
                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("微抽奖");
            }
        }
Exemplo n.º 4
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("");
            }
            if ((lotteryTicket != null) && VshopBrowser.HasSignUp(num, Globals.GetCurrentMemberUserId()))
            {
                HttpContext.Current.Response.Redirect(string.Format("~/vshop/ticket.aspx?id={0}", 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;
            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("抽奖报名");
        }
Exemplo n.º 5
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");
            PageTitle.AddSiteNameTitle("幸运大转盘");
            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(this.wid);
                member.UserName       = "";
                member.OpenId         = "";
                member.CreateDate     = DateTime.Now;
                member.SessionId      = generateId;
                member.SessionEndTime = DateTime.Now;
                member.wid            = this.wid;
                MemberProcessor.CreateMember(member);
                member = MemberProcessor.GetMember(generateId);
                HttpCookie cookie = new HttpCookie("Vshop-Member")
                {
                    Value   = member.UserId.ToString(),
                    Expires = DateTime.Now.AddDays(10)
                };
                HttpContext.Current.Response.Cookies.Add(cookie);
            }
            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 + string.Format("您一共有{0}次参与机会,目前还剩{1}次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\",function(){window.location.href=\"Default.aspx\";});});</script>");
            }
        }
Exemplo n.º 6
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("抽奖报名");
                }
            }
        }
Exemplo n.º 7
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>");
        }
Exemplo n.º 8
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("微抽奖");
        }
Exemplo n.º 9
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>");
            }
        }
Exemplo n.º 10
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("抽奖报名");
        }
Exemplo n.º 11
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            MemberInfo user = HiContext.Current.User;

            if (user.UserId == 0)
            {
                HttpContext.Current.Response.Redirect($"login.aspx?ReturnUrl=SmashEgg.aspx?activityid={this.activityid}");
            }
            else
            {
                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");
                this.hidIsUsePoint   = (HtmlInputHidden)this.FindControl("hidIsUsePoint");
                this.hidFreeTimes    = (HtmlInputHidden)this.FindControl("hidFreeTimes");
                PageTitle.AddSiteNameTitle("砸金蛋");
                this.hdTitle  = (HtmlInputHidden)this.FindControl("hdTitle");
                this.hdAppId  = (HtmlInputHidden)this.FindControl("hdAppId");
                this.hdDesc   = (HtmlInputHidden)this.FindControl("hdDesc");
                this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl");
                this.hdLink   = (HtmlInputHidden)this.FindControl("hdLink");
                ActivityInfo activityInfo = ActivityHelper.GetActivityInfo(this.activityid);
                if (activityInfo == null || activityInfo.ActivityType != 3)
                {
                    base.GotoResourceNotFound("活动不存在");
                }
                else
                {
                    Literal  literal  = this.litStartDate;
                    DateTime dateTime = activityInfo.StartDate;
                    literal.Text = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    Literal literal2 = this.litEndDate;
                    dateTime                      = activityInfo.EndDate;
                    literal2.Text                 = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    this.litActivityDesc.Text     = activityInfo.Description;
                    this.litPrizeNames.ActivityId = this.activityid;
                    this.litPrizeUsers.ActivityId = this.activityid;
                    if (activityInfo.StartDate < DateTime.Now && DateTime.Now < activityInfo.EndDate)
                    {
                        string arg = "您一共有";
                        int    num = activityInfo.FreeTimes;
                        ActivityJoinStatisticsInfo currUserActivityStatisticsInfo = ActivityHelper.GetCurrUserActivityStatisticsInfo(user.UserId, this.activityid);
                        if (currUserActivityStatisticsInfo == null)
                        {
                            num = activityInfo.FreeTimes;
                        }
                        else if (activityInfo.ResetType == 2)
                        {
                            arg      = "您每天有";
                            dateTime = DateTime.Now;
                            DateTime date = dateTime.Date;
                            dateTime = currUserActivityStatisticsInfo.LastJoinDate;
                            num      = ((!(date == dateTime.Date)) ? activityInfo.FreeTimes : (activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum));
                        }
                        else
                        {
                            num = activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum;
                        }
                        this.hidFreeTimes.Value = num.ToString();
                        if (num <= 0)
                        {
                            this.hidIsUsePoint.Value = "1";
                            Literal literal3 = this.litActivityDesc;
                            literal3.Text += $"{arg}{activityInfo.FreeTimes}次免费参与机会,目前还剩0次,如要继续抽奖,则会消耗{activityInfo.ConsumptionIntegral}积分一次";
                        }
                        else
                        {
                            this.hidIsUsePoint.Value = "0";
                            Literal literal4 = this.litActivityDesc;
                            literal4.Text += $"{arg}{activityInfo.FreeTimes}次免费参与机会,目前还剩{num}次。";
                        }
                    }
                    else
                    {
                        this.ShowMessage("活动还未开始或者已经结束!", false, "", 1);
                    }
                    if (base.ClientType == ClientType.VShop)
                    {
                        SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                        string       local          = (!string.IsNullOrWhiteSpace(activityInfo.SharePic)) ? activityInfo.SharePic : Globals.FullPath("Templates/common/images/process/egg1.png");
                        this.hdImgUrl.Value = Globals.FullPath(local);
                        this.hdTitle.Value  = activityInfo.ActivityName;
                        this.hdDesc.Value   = activityInfo.ShareDetail;
                        this.hdLink.Value   = Globals.FullPath($"/vshop/SmashEgg.aspx?ActivityId={this.activityid}");
                        this.hdAppId.Value  = masterSettings.WeixinAppId;
                    }
                }
            }
        }
Exemplo n.º 12
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>");
            }
        }
Exemplo n.º 13
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            MemberInfo user = HiContext.Current.User;

            if (user.UserId == 0)
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"请先登入后抽奖!\",function(){ToLogin();});});</script>");
            }
            else
            {
                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");
                this.hidIsUsePoint   = (HtmlInputHidden)this.FindControl("hidIsUsePoint");
                this.hidFreeTimes    = (HtmlInputHidden)this.FindControl("hidFreeTimes");
                PageTitle.AddSiteNameTitle("砸金蛋");
                ActivityInfo activityInfo = ActivityHelper.GetActivityInfo(this.activityid);
                if (activityInfo == null || activityInfo.ActivityType != 3)
                {
                    base.GotoResourceNotFound("活动不存在");
                }
                else
                {
                    Literal  literal  = this.litStartDate;
                    DateTime dateTime = activityInfo.StartDate;
                    literal.Text = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    Literal literal2 = this.litEndDate;
                    dateTime                      = activityInfo.EndDate;
                    literal2.Text                 = dateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
                    this.litActivityDesc.Text     = activityInfo.Description;
                    this.litPrizeNames.ActivityId = this.activityid;
                    this.litPrizeUsers.ActivityId = this.activityid;
                    if (activityInfo.StartDate < DateTime.Now && DateTime.Now < activityInfo.EndDate)
                    {
                        string arg = "您一共有";
                        int    num = activityInfo.FreeTimes;
                        ActivityJoinStatisticsInfo currUserActivityStatisticsInfo = ActivityHelper.GetCurrUserActivityStatisticsInfo(user.UserId, this.activityid);
                        if (currUserActivityStatisticsInfo == null)
                        {
                            num = activityInfo.FreeTimes;
                        }
                        else if (activityInfo.ResetType == 2)
                        {
                            arg      = "您每天有";
                            dateTime = DateTime.Now;
                            DateTime date = dateTime.Date;
                            dateTime = currUserActivityStatisticsInfo.LastJoinDate;
                            num      = ((!(date == dateTime.Date)) ? activityInfo.FreeTimes : (activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum));
                        }
                        else
                        {
                            num = activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum;
                        }
                        this.hidFreeTimes.Value = num.ToString();
                        if (num <= 0)
                        {
                            this.hidIsUsePoint.Value = "1";
                            Literal literal3 = this.litActivityDesc;
                            literal3.Text += $"{arg}{activityInfo.FreeTimes}次免费参与机会,目前还剩0次,如要继续抽奖,则会消耗{activityInfo.ConsumptionIntegral}积分一次";
                        }
                        else
                        {
                            this.hidIsUsePoint.Value = "0";
                            Literal literal4 = this.litActivityDesc;
                            literal4.Text += $"{arg}{activityInfo.FreeTimes}次免费参与机会,目前还剩{num}次。";
                        }
                    }
                    else
                    {
                        this.ShowMessage("活动还未开始或者已经结束!", false, "", 1);
                    }
                }
            }
        }