Exemplo n.º 1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int memberId = PrizeMemberAuthUtils.GetMemberID();

        PrizeExercisePlan plan = dbAccess.GetNotStartedExercisePlan(memberId);

        if (plan == null)
        {
            MemberExercisePlan curMemberPlan = dbAccess.GetCurrentMemberPlan(memberId);
            if (curMemberPlan != null)
            {
                plan = dbAccess.GetExercisePlan(curMemberPlan.ExercisePlanId);
            }
            if (plan == null)
            {
                plan = dbAccess.GetLastFinishedExercisePlan(memberId);
            }
        }

        PrizeExercisePlan nextPlan = dbAccess.GetNextExercisePlan(plan);

        if (nextPlan != null)
        {
            Response.Redirect(String.Format("{0}?targetplanid={1}", PrizeConstants.URL_MEMBER_BUY_PLAN, nextPlan.Id));
        }
    }
Exemplo n.º 2
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        bool bLogin = Membership.ValidateUser(username.Text, password.Text);

        if (bLogin != false)
        {
            Member uMember = Member.GetMemberFromLoginNameAndPassword(username.Text, password.Text);
            if (uMember != null)
            {
                Session["taRegistration"] = uMember.Email;
                System.Web.Security.FormsAuthentication.SetAuthCookie(uMember.LoginName, true);
                Member.AddMemberToCache(uMember);
                MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(uMember.Id);
                int myPlanId = 0;
                if (myPlan != null)
                {
                    myPlanId = myPlan.ExercisePlanId;
                }
                PrizeMemberAuthUtils.SaveMemberLoginLog(uMember.Id, myPlanId, this.ToString(), "Login");
                if (myPlan == null)
                {
                    PrizeMember            member  = PrizeMemberAuthUtils.GetMemberData(uMember.Id);
                    PrizeMemberPlanManager planMan = new PrizeMemberPlanManager();
                    Response.Redirect(planMan.GetEmptyPlanJumpURL(member));
                }
                else
                {
                    if (Request.QueryString["returnUrl"] != null)
                    {
                        Response.Redirect(Request.QueryString["returnUrl"]);
                    }
                    PrizeExercisePlan plan = dbAccess.GetExercisePlan(myPlan.ExercisePlanId);
                    if (plan.IsTrialPlan != 1)
                    {
                        Response.Redirect(String.Format("{0}?loginName={1}&memberId={2}", PrizeConstants.URL_MEMBER_COMING_UP, uMember.LoginName, uMember.Id));
                    }
                    else
                    {
                        Response.Redirect(String.Format("{0}?loginName={1}&memberId={2}", PrizeConstants.URL_MEMBER_LANDING, uMember.LoginName, uMember.Id));
                    }
                }
                //var log = new MemberVisitLogs();
                //log.UmbracoId = uMember.Id;
                //log.Page = HttpContext.Current.Request.Url.AbsolutePath;
                //log.CreatedOn = PrizeCommonUtils.GetSystemDate();
                //log.MembersReference.EntityKey = new EntityKey("SydneyCatalystMemberEntities.Members", "Id", member.Id);
                //db.AddToMemberVisitLogs(log);
                //db.SaveChanges();
                return;
            }
        }
        errorLabel.Text = "Invalid UserId/password.";
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DateTime myDate = GetOrientationDate(2);

        lblDay.Text  = myDate.ToString("dddd d").ToUpper();
        lblDate.Text = myDate.ToString("MMMM, yyyy");
        MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlan(PrizeMemberAuthUtils.GetMemberID());

        if (myPlan == null)
        {
            Response.Write(PrizeConstants.CONST_JS_WARNING_PLAN_NOT_START);
            this.div1.Visible = false;
            return;
        }
        var acc = new PrizeDataAccess();
        PrizeExercisePlan plan = acc.GetExercisePlan(myPlan.ExercisePlanId);

        if (plan.PlanName.ToLower().Contains("muscle"))
        {
            divMuscle.Attributes.Add("class", "show-pg-b");
            hiddenPlan.Text = "muscle";
        }
        if (plan.PlanName.ToLower().Contains("tone"))
        {
            divTone.Attributes.Add("class", "show-pg-t");
            hiddenPlan.Text = "tone";
        }
        if (plan.PlanName.ToLower().Contains("weight"))
        {
            divWeight.Attributes.Add("class", "show-pg-l");
            hiddenPlan.Text = "weight";
        }


        var planName  = acc.GetPlanName(plan);
        var sPlanName = planName.Split('_');

        hiddenLocation.Text = sPlanName[1].ToLower();
        if (sPlanName[1].ToLower() == "gym")
        {
            divFitness.Attributes.Add("class", "tab-inner-content show-gym");
        }
        else
        {
            divFitness.Attributes.Add("class", "tab-inner-content show-home");
        }
    }
Exemplo n.º 4
0
    private void BindGrid()
    {
        using (DIYPTEntities db = new DIYPTEntities())
        {
            db.Database.Connection.Open();
            {
                var languages = from a in db.MemberPlanWeekResults
                                join b in db.PrizeMembers on a.MemberId equals b.UmbracoId
                                join c in db.MemberExercisePlanWeeks on a.MemberExercisePlanWeekId equals c.Id
                                join d in db.MemberExercisePlans on c.MemberExercisePlanId equals d.Id
                                join e in db.PrizeExercisePlans on d.ExercisePlanId equals e.Id
                                where a.MemberId == memberId && d.Status.EndsWith("P")
                                orderby d.StartDate descending, c.StartDate
                    select new
                {
                    Memberid     = a.MemberId,
                    Firstname    = b.Firstname,
                    Surname      = b.Surname,
                    Week         = c.Week,
                    Status       = c.Status,
                    StartDate    = c.StartDate,
                    EndDate      = c.EndDate,
                    PlanName     = e.PlanName,
                    EndWeight    = a.EndWeight,
                    EndWaist     = a.EndWaist,
                    EndBodyFat   = a.EndBodyFat,
                    EndChest     = a.EndChest,
                    EndHip       = a.EndHip,
                    EndHeartRate = a.EndHeartRate,
                    FrontPhoto   = a.FrontPhoto,
                    BackPhoto    = a.BackPhoto,
                    SidePhoto    = a.SidePhoto,
                    Tasks        = a.Tasks,
                };

                GridView1.DataSource = languages.ToList();

                GridView1.DataBind();

                MemberExercisePlan     myPlan     = null;
                MemberExercisePlanWeek myPlanWeek = null;
                if (Session["MPID"] != null)
                {
                    int mPlanId = Convert.ToInt32(Session["MPID"]);
                    myPlan = dbAccess.GetMemberExercisePlan(mPlanId);
                }
                else
                {
                    myPlan     = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId);
                    myPlanWeek = dbAccess.GetCurrentMemberPlanWeek(memberId);
                }

                this.btnSave.Enabled = false;
                if (myPlan != null)
                {
                    this.btnSave.Enabled = true;
                    var memberPlanWeeks = from a in db.MemberExercisePlanWeeks
                                          where a.MemberExercisePlanId == myPlan.Id
                                          orderby a.Week
                                          select new
                    {
                        WeekText = a.Week,
                        WeekNum  = a.Week
                    };
                    ddlWeek.DataValueField = "WeekNum";
                    ddlWeek.DataTextField  = "WeekText";
                    ddlWeek.DataSource     = memberPlanWeeks.ToList();
                    ddlWeek.DataBind();
                    int weekNum = -1;
                    if (myPlanWeek != null)
                    {
                        weekNum = myPlanWeek.Week;
                    }

                    PrizeExercisePlan plan = dbAccess.GetExercisePlan(myPlan.ExercisePlanId);

                    lblPlanInfo.Text = "Plan " + plan.PlanName + " from " + PrizeCommonUtils.ParseDateToEnglish(myPlan.StartDate) + " to " + PrizeCommonUtils.ParseDateToEnglish(myPlan.EndDate.Value);
                    LoadFoodPlanWeek(memberId, myPlan, weekNum);
                }
            }
            db.Database.Connection.Close();
        }
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string PaymentURL = "";

        if (!IsPostBack)
        {
            string sProgram  = Request.QueryString["program"];
            string sLocation = Request.QueryString["location"];
            string sLevel    = Request.QueryString["level"];
            string sExp      = Request.QueryString["experience"];

            string sPlanId   = Request.QueryString["targetplanid"];
            string sMyPlanId = Request.QueryString["targetmemberplanid"];

            PaymentURL = Request.QueryString["paymenturl"];

            if (Request.UrlReferrer != null)
            {
                string referer = Request.UrlReferrer.ToString();
                if (referer.Contains("signup") || referer.Contains("continue"))
                {
                    lblMsg.Text = "Please review your details and click one of the payment options below.";
                }
                else
                {
                    lblMsg.Text = "Whoops, you've missed the payment step. Please click Pay with PayPal button below.";
                }
            }
            var member = PrizeMemberAuthUtils.GetMemberData();
            txtFirstName.Text    = member.Firstname;
            tbLastName.Text      = member.Surname;
            txtEmail.Text        = member.Email;
            tbMobile.Text        = member.Mobile;
            tbPhone.Text         = member.Phone;
            tbStreetAddress.Text = member.StreetAddress;
            tbSuburb.Text        = member.Suburb;
            tbState.Text         = member.State;
            ddCountry.Text       = member.Country;
            tbPostCode.Text      = member.Postcode;

            ddlProgram.Text  = sProgram;
            ddlLocation.Text = sLocation;
            //ddlQ3.Text = member.Questions;
            //PrizeMemberAuthUtils.GetMemberAnswer(member, 3);
            //ddlQ4.Text = "test " + member.Email;

            IsTrial = false;
            if (Request.QueryString["Trial"] != null && Request.QueryString["Trial"].Equals("1"))
            {
                IsTrial = true;
            }
            int newPlanId = 0;
            MemberExercisePlan     myPlan      = new MemberExercisePlan();
            PrizeExercisePlan      prizePlan   = new PrizeExercisePlan();
            double                 nPrize      = 0;
            PrizeMemberPlanManager planManager = new PrizeMemberPlanManager();
            int ret;
            if (String.IsNullOrEmpty(sMyPlanId))
            {
                if (String.IsNullOrEmpty(sPlanId))
                {
                    newPlanId = planManager.FindNewPlan(sProgram, sLocation, sLevel, sExp, IsTrial);
                    if (newPlanId < 0)
                    {
                        //throw new Exception("ERROR: could not find the plan " + PrizeErrorCode.getErrorMessage(newPlanId));
                        this.btnPayFully.Enabled  = false;
                        this.btnPayWeekly.Enabled = false;
                        Response.Write("<script>alert('There is no new plan suitable for you.');</script>");
                        return;
                    }
                }
                else
                {
                    newPlanId = int.Parse(sPlanId);
                }
                ret = planManager.BuyNewPlan(newPlanId, ref prizePlan, ref myPlan);
            }
            else
            {
                if (String.IsNullOrEmpty(sPlanId))
                {
                    ret = -1;
                }
                else
                {
                    prizePlan = dbAccess.GetExercisePlan(int.Parse(sPlanId));
                    myPlan    = dbAccess.GetMemberExercisePlan(int.Parse(sMyPlanId));
                    ret       = 0;
                }
            }

            if (ret < 0)
            {
                throw new Exception("ERROR: error for buying plan " + ret);
            }
            else
            {
                ShowNewPlan(prizePlan, myPlan);
                Session["buying_plan_name"]  = prizePlan.PlanName;
                Session["buying_my_plan_id"] = myPlan.Id;
                Session["buying_plan_id"]    = myPlan.ExercisePlanId;
                if (prizePlan.Price > 0)
                {
                    Session["payment_amt"] = prizePlan.Price;
                }
                else
                {
                    Session["payment_amt"] = PrizeConstants.GENERAL_PLAN_PRIZE;
                }
            }
        }
        if (IsTrial)
        {
            this.btnPayWeekly.Visible = false;
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int memberId = PrizeMemberAuthUtils.GetMemberID();

        var exercisePlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId);

        if (exercisePlan == null)
        {
            PrizeMember            member  = PrizeMemberAuthUtils.GetMemberData(memberId);
            PrizeMemberPlanManager planMan = new PrizeMemberPlanManager();
            Response.Redirect(planMan.GetEmptyPlanJumpURL(member));
        }

        MemberExercisePlanWeek memberPlanWeek;

        if (Request["MemberPlanWeekID"] != null)
        {
            int memberPlanWeekId;
            int.TryParse(Request["MemberPlanWeekID"], out memberPlanWeekId);
            memberPlanWeek = dbAccess.GetMemberPlanWeekById(memberPlanWeekId);
        }
        else
        {
            memberPlanWeek = dbAccess.GetCurrentMemberPlanWeek(memberId);
        }

        if (memberPlanWeek == null)
        {
            divMealPlanContent.Visible = false;
            divNotStarted.Visible      = true;
            return;
        }

        int iWeekNum = memberPlanWeek.Week;

        lblWeekNum.Text = "Week " + iWeekNum;
        divMainMealPlan.Attributes.Add("class", "tab-inner-content nodisplay wk" + iWeekNum);
        lblDateDuration.Text = PrizeCommonUtils.ParseDateToEnglish(memberPlanWeek.StartDate) + " - "
                               + PrizeCommonUtils.ParseDateToEnglish(memberPlanWeek.EndDate);

        MemberExercisePlan memberPlan = dbAccess.GetCurrentMemberPlan(memberId);

        if (memberPlan == null)
        {
            return;
        }
        PrizeExercisePlan plan = dbAccess.GetExercisePlan(memberPlan.ExercisePlanId);

        if (plan == null)
        {
            return;
        }
        lblPlanProgram.Text = plan.PrizePlanProgram.Name;

        MemberExercisePlanWeek prevWeek = dbAccess.GetMemberPlanWeekByMemberPlanAndWeek(memberPlan.Id, memberPlanWeek.Week - 1);

        if (prevWeek != null)
        {
            int prevWeekNum = iWeekNum - 1;
            weekPre.NavigateUrl = "/my-account/meal-plan?MemberPlanWeekID=" + prevWeek.Id;
            weekPre.Text        = "Week " + (memberPlanWeek.Week - 1);
        }
        else
        {
            weekPre.Attributes.Add("class", "no-arrow");
        }

        MemberExercisePlanWeek nextWeek = dbAccess.GetMemberPlanWeekByMemberPlanAndWeek(memberPlan.Id, memberPlanWeek.Week + 1);

        if (nextWeek != null)
        {
            weekNext.NavigateUrl = "/my-account/meal-plan?MemberPlanWeekID=" + nextWeek.Id;
            weekNext.Text        = "Week " + (memberPlanWeek.Week + 1);
        }
        else
        {
            weekNext.Attributes.Add("class", "no-arrow");
        }

        MemberFoodPlanWeek foodWeek = dbAccess.GetMemberFoodPlanWeek(memberId, memberPlanWeek.MemberExercisePlanId, memberPlanWeek.Week);

        if (foodWeek == null)
        {
            return;
        }
        if (foodWeek.Food1 == null || foodWeek.Food1.Equals(""))
        {
            this.colories.Visible = false;
        }
        else
        {
            lblFood1.Text = foodWeek.Food1;
        }

        if (foodWeek.Food2 == null || foodWeek.Food2.Equals(""))
        {
            this.protein.Visible = false;
        }
        else
        {
            lblFood2.Text = foodWeek.Food2;
        }

        if (foodWeek.Food3 == null || foodWeek.Food3.Equals(""))
        {
            this.carbo.Visible = false;
        }
        else
        {
            lblFood3.Text = foodWeek.Food3;
        }

        if (foodWeek.Food4 == null || foodWeek.Food4.Equals(""))
        {
            this.fats.Visible = false;
        }
        else
        {
            lblFood4.Text = foodWeek.Food4;
        }

        if (foodWeek.Food5 != null)
        {
            string[] sPersentage = foodWeek.Food5.Split(';');
            if (sPersentage.Length > 0)
            {
                lblFood5.Text = sPersentage[0];
                if (sPersentage.Length > 1)
                {
                    lblFood6.Text = sPersentage[1];
                    if (sPersentage.Length > 2)
                    {
                        lblFood7.Text = sPersentage[2];
                    }
                }
            }
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int.TryParse(Request["PlanWeekId"], out iPlanWeekId);
        int.TryParse(Request["PlanDayNumber"], out iDay);
        int.TryParse(Request["MemberPlanWeekId"], out memberPlanWeekId);

        MemberExercisePlanWeek memberPlanWeek = dbAccess.GetMemberPlanWeekById(memberPlanWeekId);

        if (memberPlanWeek != null)
        {
            lblDate.Text = PrizeCommonUtils.ParseDateToEnglish(memberPlanWeek.StartDate.AddDays(iDay - 1));
        }
        lblDayNum.Text      = "" + iDay;
        lblDayTypeName.Text = PrizeConstants.STR_NO_TRAINNING;
        DataSet ds = dbAccess.GetMemberWeeklyInfo(iPlanWeekId);

        foreach (DataRow row in ds.Tables[0].Rows)
        {
            int iWeekDay = (int)row[0];
            if (iWeekDay == iDay)
            {
                lblDayTypeName.Text = (String)row[2];
            }
        }
        if (lblDayTypeName.Text.ToLower() == PrizeConstants.STR_NO_TRAINNING.ToLower())
        {
            divWarmup.Visible = divCooldown.Visible = divLegend.Visible = false;
            divRest.Visible   = true;
        }

        lblDay.Text = PrizeCommonUtils.ParseWeekDayToEnglish(iDay);
        MemberExercisePlan myPlan = dbAccess.GetMemberExercisePlan(memberPlanWeek.MemberExercisePlanId);

        if (iDay > 1)
        {
            preDay.NavigateUrl = (String.Format("{0}?PlanWeekId={1}&MemberPlanWeekId={2}&PlanDayNumber={3}", PrizeConstants.URL_MEMBER_DAY_VIEW, iPlanWeekId, memberPlanWeekId, iDay - 1));
            preDay.Text        = "Previous Day";
        }
        else
        {
            MemberExercisePlanWeek prevWeek = dbAccess.GetMemberPlanWeekByMemberPlanAndWeek(myPlan.Id, memberPlanWeek.Week - 1);
            if (prevWeek != null)
            {
                preDay.NavigateUrl = (String.Format("{0}?PlanWeekId={1}&MemberPlanWeekId={2}&PlanDayNumber={3}", PrizeConstants.URL_MEMBER_DAY_VIEW, iPlanWeekId, prevWeek.Id, 7));
                preDay.Text        = "Previous Day";
            }
            else
            {
                preDay.Attributes.Add("class", "no-arrow");
            }
        }

        if (iDay < 7)
        {
            nextDay.NavigateUrl = (String.Format("{0}?PlanWeekId={1}&MemberPlanWeekId={2}&PlanDayNumber={3}", PrizeConstants.URL_MEMBER_DAY_VIEW, iPlanWeekId, memberPlanWeekId, iDay + 1));
            nextDay.Text        = "Next Day";
        }
        else
        {
            MemberExercisePlanWeek nextWeek = dbAccess.GetMemberPlanWeekByMemberPlanAndWeek(myPlan.Id, memberPlanWeek.Week + 1);
            if (nextWeek != null)
            {
                nextDay.NavigateUrl = (String.Format("{0}?PlanWeekId={1}&MemberPlanWeekId={2}&PlanDayNumber={3}", PrizeConstants.URL_MEMBER_DAY_VIEW, iPlanWeekId, nextWeek.Id, 1));
                nextDay.Text        = "Next Day";
            }
            else
            {
                nextDay.Attributes.Add("class", "no-arrow");
            }
        }

        InitPageControls();

        DivAdvanceEquipment.Visible = false;
        PrizeDataAccess db = new PrizeDataAccess();
        var             memberExercisePlan = db.GetCurrentMemberPlanOrStartingPlan(PrizeMemberAuthUtils.GetMemberID());

        if (memberExercisePlan != null)
        {
            var exercisePlan = db.GetExercisePlan(memberExercisePlan.ExercisePlanId);
            if (exercisePlan != null)
            {
                if (exercisePlan.PlanName.ToLower().Contains("home") &&
                    (exercisePlan.PlanName.ToLower().Contains("intermediate")
                     ||
                     exercisePlan.PlanName.ToLower().Contains("advanced"))
                    )
                {
                    DivAdvanceEquipment.Visible = true;
                }
            }
        }
        switch (lblDayTypeName.Text.Trim())
        {
        case "Time to celebrate":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divRest.Visible             = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "30min brisk walk":
        case "Brisk walk":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divWalk.Visible             = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "30-60min weekend physical activity":
        case "Weekend physical activity":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divWeekend.Visible          = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "Own 1hr cardio":
        case "Own training":
        case "Own cardio":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divCardio.Visible           = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "Milestone workout = 20x pushups, squats, situps":
        case "Milestone workout 2":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divSquat.Visible            = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "Milestone workout = 20 pushups & make your bed":
        case "Milestone workout 1":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divPushup.Visible           = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "Measurement day and rest":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            divMeasurement.Visible      = true;
            DivAdvanceEquipment.Visible = false;
            break;

        case "Milestone workout = 20 star jumps & make your bed":
            divWarmup.Visible           = divCooldown.Visible = divLegend.Visible = false;
            DivAdvanceEquipment.Visible = false;
            //divMeasurement.Visible = true;
            break;

        default:
            break;
        }
        LoadDailyInfo(iPlanWeekId, iDay);

        // nextDay.Text = "Next day tuesday";
        // nextDay.NavigateUrl = "/tuesday#?";
    }
Exemplo n.º 8
0
    protected void LoadMemberDetails()
    {
        string username = member.Firstname + " " + member.Surname;

        this.lblFullName.Text = username;

        lblFirstName.Text = member.Firstname;
        lblLastName.Text  = member.Surname;
        tbFirstName.Text  = member.Firstname;
        tbLastName.Text   = member.Surname;
        lblEmail.Text     = member.Email;
        txtEmail.Text     = member.Email;
        lblGender.Text    = member.Gender;
        RdoGender.Text    = member.Gender;
        if (member.DoB.HasValue)
        {
            txtDob.Text = member.DoB.Value.ToString("dd/MM/yyyy");
            lblDoB.Text = txtDob.Text;
        }
        lblStreetAddress.Text = member.StreetAddress;
        lblSuburb.Text        = member.Suburb;
        lblState.Text         = member.State;
        lblCountry.Text       = member.Country;
        lblPostCode.Text      = member.Postcode;
        lblMobile.Text        = member.Mobile;
        lblPhone.Text         = member.Phone;
        lblWhyDiypt.Text      = member.WhyDIYPT;

        tbStreetAddress.Text = member.StreetAddress;
        tbSuburb.Text        = member.Suburb;
        tbState.Text         = member.State;
        tbCountry.Text       = member.Country;
        tbPostCode.Text      = member.Postcode;
        tbMobile.Text        = member.Mobile;
        tbPhone.Text         = member.Phone;
        tbWhyDiypt.Text      = member.WhyDIYPT;

        PrizeDataAccess    dbAccess = new PrizeDataAccess();
        MemberExercisePlan myPlan   = dbAccess.GetCurrentMemberPlanOrStartingPlan(member.UmbracoId);

        if (myPlan != null)
        {
            PrizeExercisePlan plan = dbAccess.GetExercisePlan(myPlan.ExercisePlanId);
            lblGoalDec.Text = plan.PrizePlanProgram.Name;
            tbGoalDec.Text  = plan.PrizePlanProgram.Name;

            var      planName  = dbAccess.GetPlanName(plan);
            string[] sPlanName = planName.Split('_');
            //lblProg.Text = sPlanName[0];
            //lblSem.Text = sPlanName[3].Replace("Semester", "");
            //lblLvl.Text = sPlanName[2];
            //lblLoc.Text = sPlanName[1];
            //ddlLocation.Text = sPlanName[1];

            lblLevel.Text    = sPlanName[2];
            lblLocation.Text = sPlanName[1];
            lblSemester.Text = sPlanName[3].Replace("Semester", "");
        }

        lblFacebook.Text      = member.Facebook;
        lblInstagram.Text     = member.Instagram;
        lblTwitter.Text       = member.Twiter;
        tbFacebook.Text       = member.Facebook;
        tbInstagram.Text      = member.Instagram;
        tbTwitter.Text        = member.Twiter;
        profilePhoto.ImageUrl = member.Photo;

        if (PrizeMemberAuthUtils.GetMemberSetting(member.UserSettings, PrizeConstants.MemberSettings.PromotionalPhoto) == '1')
        {
            cbPromotionalPhoto.Checked  = true;
            lblPromotionalPhoto.Checked = true;
        }
        else
        {
            cbPromotionalPhoto.Checked  = false;
            lblPromotionalPhoto.Checked = false;
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int memberId = PrizeMemberAuthUtils.GetMemberID();

        var exercisePlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId);

        if (exercisePlan == null)
        {
            PrizeMember            member  = PrizeMemberAuthUtils.GetMemberData(memberId);
            PrizeMemberPlanManager planMan = new PrizeMemberPlanManager();
            Response.Redirect(planMan.GetEmptyPlanJumpURL(member));
        }

        if (int.TryParse(Request["MemberPlanWeekId"], out memberPlanWeekId))
        {
            _MemberPlanWeek = dbAccess.GetMemberPlanWeekById(memberPlanWeekId);
        }

        if (_MemberPlanWeek == null)
        {
            _MemberPlanWeek = dbAccess.GetCurrentMemberPlanWeek(memberId);
        }

        if (_MemberPlanWeek == null)
        {
            divMeasurement.Visible        = false;
            btnUpdateProgress.Enabled     = false;
            this.photoPanelUpload.Visible = false;
            return;
        }

        InitPageControls();

        frontUpload.Attributes["onchange"] = "UploadFile(this)";
        sideUpload.Attributes["onchange"]  = "UploadFile(this)";
        backUpload.Attributes["onchange"]  = "UploadFile(this)";

        _PlanWeek = dbAccess.GetExercisePlanWeek(_MemberPlanWeek.ExercisePlanWeekId);

        iWeekNum = this.GetLatestMeasurementWeekNum(_MemberPlanWeek.Week);

        if (iWeekNum != _MemberPlanWeek.Week)
        {
            _MemberPlanWeek = dbAccess.GetMemberPlanWeekByMemberPlanAndWeek(_MemberPlanWeek.MemberExercisePlanId, iWeekNum);
        }
        if (_MemberPlanWeek == null)
        {
            divMeasurement.Visible        = false;
            btnUpdateProgress.Enabled     = false;
            this.photoPanelUpload.Visible = false;
            return;
        }

        if (!PrizeConstants.WEEKS_NEEDS_RESULT.Contains(iWeekNum))
        {
            divMeasurement.Visible = false;
        }

        lblWeekNum.Text = iWeekNum.ToString();
        //lblWeekNum2.Text = lblWeekNum.Text;
        lblWeekNum3.Text = iWeekNum.ToString();

        if (!IsPostBack)
        {
            WeekResults = dbAccess.GetMemberPlanResults(_MemberPlanWeek.MemberExercisePlanId);

            LoadWeeklyResult(WeekResults);

            LoadMemberPhotos(iWeekNum, WeekResults);

            DrawProgressGraph((int)_MemberPlanWeek.MemberExercisePlanId, WeekResults);

            LoadPreNextLinks();
        }


        MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlan(PrizeMemberAuthUtils.GetMemberID());

        if (myPlan != null)
        {
            PrizeExercisePlan plan = dbAccess.GetExercisePlan(myPlan.ExercisePlanId);
            if (plan != null)
            {
                if (plan.PlanName.ToLower().Contains("muscle"))
                {
                    lblMeasurement3.Text            = "Right arm biceps (cm)";
                    lblMeasurementGraph3.Text       = "Right arm biceps";
                    lblMeasurementMetricGraph3.Text = "(cm)";
                    lblMeasurement4.Text            = "Chest (cm)";
                    lblMeasurementGraph4.Text       = "Chest";
                    lblMeasurementMetricGraph4.Text = "(cm)";
                    lblMeasurement5.Text            = "Right thigh (cm)";
                    lblMeasurementGraph5.Text       = "Right thigh";
                    lblMeasurementMetricGraph5.Text = "(cm)";
                }
                if (plan.PlanName.ToLower().Contains("tone"))
                {
                    lblMeasurement3.Text            = "Right arm biceps (cm)";
                    lblMeasurementGraph3.Text       = "Right arm biceps";
                    lblMeasurementMetricGraph3.Text = "(cm)";
                    lblMeasurement4.Text            = "Hips (cm)";
                    lblMeasurementGraph4.Text       = "Hips";
                    lblMeasurementMetricGraph4.Text = "(cm)";
                    lblMeasurement5.Text            = "Right thigh (cm)";
                    lblMeasurementGraph5.Text       = "Right thigh";
                    lblMeasurementMetricGraph5.Text = "(cm)";
                }
                if (plan.PlanName.ToLower().Contains("weight"))
                {
                    lblMeasurement3.Text            = "Chest (cm)";
                    lblMeasurementGraph3.Text       = "Chest";
                    lblMeasurementMetricGraph3.Text = "(cm)";
                    lblMeasurement4.Text            = "Hips (cm)";
                    lblMeasurementGraph4.Text       = "Hips";
                    lblMeasurementMetricGraph4.Text = "(cm)";
                    lblMeasurement5.Text            = "Heart rate (per min)";
                    lblMeasurementGraph5.Text       = "Heart rate";
                    lblMeasurementMetricGraph5.Text = "(per min)";
                }
            }
        }
    }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var             planType           = "2";
        string          tempScript         = "<style>";
        PrizeDataAccess db                 = new PrizeDataAccess();
        var             memberExercisePlan = db.GetCurrentMemberPlanOrStartingPlan(PrizeMemberAuthUtils.GetMemberID());

        lblTop.Text    = "WEIGHT BEARING EXERCISES";
        lblMiddle.Text = "WHOLESOME FOODS";
        lblBottom.Text = " REDUCED DOCTOR VISITS";
        //weight
        tempScript += @"
.container-fluid-header { background-image: url('/images/login/lose-weight/hero-lose-weight.jpg');}
@media (max-width:767px) {
.container-fluid-header { background-image: url('/images/login/lose-weight/hero-lose-weight-m.jpg');}
}
";

        if (memberExercisePlan != null)
        {
            var exercisePlan = db.GetExercisePlan(memberExercisePlan.ExercisePlanId);
            if (exercisePlan != null)
            {
                if (exercisePlan.PlanName.ToLower().Contains("weight"))
                {
                    planType = "1";
                }
                if (exercisePlan.PlanName.ToLower().Contains("muscle"))
                {
                    planType = "2";
                }
                if (exercisePlan.PlanName.ToLower().Contains("tone"))
                {
                    planType = "3";
                }
            }
            switch (planType)
            {
            case "1":
                lblTop.Text    = "WEIGHT BEARING EXERCISES";
                lblMiddle.Text = "WHOLESOME FOODS";
                lblBottom.Text = " REDUCED DOCTOR VISITS";
                //weight
                tempScript += @"
.container-fluid-header { background-image: url('/images/login/lose-weight/hero-lose-weight.jpg');}
@media (max-width:767px) {
.container-fluid-header { background-image: url('/images/login/lose-weight/m-hero-lose-weight.jpg');}
}
";
                break;

            case "2":
                lblTop.Text    = "VOLUME";
                lblMiddle.Text = "A MEAL EVERY 3 HOURS";
                lblBottom.Text = " ARNIE ARMS";
                tempScript    += @"
.container-fluid-header { background-image: url('/images/login/build-strength/hero-build-strength.jpg');}
@media (max-width:767px) {
.container-fluid-header { background-image: url('/images/login/build-strength/m-hero-build-strength.jpg');}
}";
                //muscle
                break;

            case "3":
                lblTop.Text    = "MACRO TRACKING";
                lblMiddle.Text = "WEIGHTS BASED TRAINING";
                lblBottom.Text = " STRONGER BODY";
                tempScript    += @"
.container-fluid-header { background-image: url('/images/login/toneup/hero-tone-up.jpg');}

@media (max-width:767px) {
.container-fluid-header { background-image: url('/images/login/toneup/m-hero-tone-up.jpg');}
}

@media (min-width:1560px) {
.container-fluid-header { background-image: url('/images/login/toneup/hero-tone-up.jpg');}
background-size: 1400px; 
}
";
                //tone
                break;

            default:
                break;
            }
        }
        tempScript += "</style>";
        Page.ClientScript.RegisterStartupScript(this.GetType(), "sloganHeadImage", tempScript, false);
    }