Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FillDate();



        if (!Page.IsPostBack)
        {
            var             member   = PrizeMemberAuthUtils.GetMemberData();
            PrizeDataAccess dbAccess = new PrizeDataAccess();
            var             plan     = dbAccess.GetCurrentOrStartingExercisePlanInfo(member.UmbracoId);
            if (plan != null && plan.IsTrialPlan == 1)
            {
                divComing.Visible = false;
                divTrial.Visible  = true;
            }
            var memberPlanWeek = dbAccess.GetCurrentMemberPlanWeek(member.UmbracoId);
            if (memberPlanWeek != null && memberPlanWeek.Week > 0)
            {
                if (PrizeMemberAuthUtils.GetMemberWeek1NotifiedTimes(member) < 3)
                {
                    if (Session["firstWeek1111"] == null)
                    {
                        string tempScript = @"<script>$(window).load(function() {
                                                $('#weekModal').modal('show');
                                            });</script>";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "modalWelcome", tempScript, false);

                        Session["firstWeek1111"] = 1;
                        PrizeMemberAuthUtils.AddMemberWeek1NotifiedTimes(member);
                    }
                }
            }
        }
    }
Exemple #2
0
    private void BindDropDownList()
    {
        PrizeExercisePlan plan = dbAccess.GetCurrentOrStartingExercisePlanInfo(memberId);

        if (plan == null)
        {
            return;
        }

        using (DIYPTEntities db = new DIYPTEntities())
        {
            db.Database.Connection.Open();
            {
                var ProgramQuery = from c in db.PrizePlanPrograms
                                   select new { c.Name, c.Id };
                ddlProgram.DataValueField = "Id";
                ddlProgram.DataTextField  = "Name";
                ddlProgram.DataSource     = ProgramQuery.ToList();

                ddlProgram.DataBind();

                ddlProgram.Items.FindByValue("" + plan.ProgramId).Selected = true;

                var LevelQuery = from e in db.PrizePlanLevels
                                 select new { e.Name, e.Id };
                ddlLevel.DataValueField = "Id";
                ddlLevel.DataTextField  = "Name";
                ddlLevel.DataSource     = LevelQuery.ToList();

                ddlLevel.DataBind();

                ddlLevel.Items.FindByValue("" + plan.LevelId).Selected = true;

                var planQuery = from a in db.PrizeExercisePlans
                                join Program in db.PrizePlanPrograms on a.ProgramId equals Program.Id
                                join Location in db.PrizePlanLocations on a.LocationId equals Location.Id
                                join Level in db.PrizePlanLevels on a.LevelId equals Level.Id
                                join Experience in db.PrizePlanExperiences on a.ExperienceId equals Experience.Id
                                where a.IsTrialPlan == plan.IsTrialPlan
                                orderby Program.Name, Location.Name, Level.Name, Experience.Name
                    select new
                {
                    PlanId   = a.Id,
                    PlanName = Program.Name + "_" + Location.Name + "_" + Level.Name + "_" + Experience.Name
                };
                ddlPlan.DataValueField = "PlanId";
                ddlPlan.DataTextField  = "PlanName";
                ddlPlan.DataSource     = planQuery.ToList();

                ddlPlan.DataBind();

                ddlPlan.Items.FindByValue("" + plan.Id).Selected = true;

                db.Database.Connection.Close();
            }
        }
    }