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); } } } } }
protected void btnChangePlan_Click(object sender, EventArgs e) { int targetPlanId = 0; int.TryParse(ddlPlan.SelectedItem.Value, out targetPlanId); PrizeMemberPlanManager man = new PrizeMemberPlanManager(); PrizeDataAccess dbAccess = new PrizeDataAccess(); MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId); if (myPlan == null) { Response.Write("<script>alert('Can't find the user's plan.');</script>"); } else { if (!man.ChangeMemberPlan(myPlan.Id, targetPlanId)) { Response.Write("<script>alert('The level of the current program not in the database.');</script>"); } else { Response.Write("<script>alert('The user's program has been changed to " + ddlPlan.SelectedItem.Text + ");</script>"); } } this.BindGrid(); }
public static DateTime GetOrientationDate(int day) { PrizeDataAccess db = new PrizeDataAccess(); var exercisePlan = db.GetCurrentMemberPlanOrStartingPlan(PrizeMemberAuthUtils.GetMemberID()); var nextMonday = exercisePlan.StartDate;//.Next(DayOfWeek.Monday); return(nextMonday.AddDays(day - 1)); }
protected void Page_Load(object sender, EventArgs e) { PrizeDataAccess db = new PrizeDataAccess(); if (db.MemberInOrientation(PrizeMemberAuthUtils.GetMemberID())) { hideOrientation.Text = "class='nav-item col'"; } else { hideOrientation.Text = "class='nav-item col hide'"; } }
protected void lbSubmit_Click(object sender, EventArgs e) { var acc = new PrizeDataAccess(); MemberCommunityChat chat = new MemberCommunityChat(); switch (GroupType) { case "strength": chat.Catergory = 1; break; case "weight": chat.Catergory = 2; break; case "tone": chat.Catergory = 3; break; default: break; } switch (GroupLevel) { case "beginner": chat.Catergory = (chat.Catergory * 10) + 1; break; case "intermediate": chat.Catergory = (chat.Catergory * 10) + 2; break; case "advanced": case "advance": chat.Catergory = (chat.Catergory * 10) + 3; break; default: break; } chat.Program = commentPlan.Text; chat.Time = DateTime.Now; chat.Name = commentName.Text; chat.ImageURL = commentImage.ImageUrl; chat.Comment = txtComment.Text; acc.SavePost(chat); txtComment.Text = ""; BindForm(); }
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"); } }
protected void btnPauseResume_Click(object sender, EventArgs e) { PrizeDataAccess dbAccess = new PrizeDataAccess(); if (this.ddlPauseResume.Text.Equals("Pause")) { MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId); PrizeMemberPlanManager man = new PrizeMemberPlanManager(); if (myPlan == null) { Response.Write("<script>alert('Can't find the user's available plan.');</script>"); } else { if (!man.PauseMemberPlan(myPlan.Id)) { Response.Write("<script>alert('Error happens when pausing the plan.');</script>"); } else { Response.Write("<script>alert('The plan is paused);</script>"); } } } else if (this.ddlPauseResume.Text.Equals("Resume")) { MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPausedPlan(memberId); PrizeMemberPlanManager man = new PrizeMemberPlanManager(); if (myPlan == null) { Response.Write("<script>alert('Can't find the user's paused plan.');</script>"); } else { if (!man.ResumeMemberPlan(myPlan.Id)) { Response.Write("<script>alert('Error happens when resuming the plan.');</script>"); } else { Response.Write("<script>alert('The plan is resumed);</script>"); } } } this.BindGrid(); return; }
private void FillDate() { //DateTime tempdate = new DateTime(2017, 1, 10); //var nextSunday = tempdate.Next(DayOfWeek.Sunday); PrizeDataAccess db = new PrizeDataAccess(); var exercisePlan = db.GetCurrentMemberPlanOrStartingPlan(PrizeMemberAuthUtils.GetMemberID()); //var nextSunday = exercisePlan.StartDate.NextDay(DayOfWeek.Monday); if (exercisePlan == null) { return; } //var nextSunday = exercisePlan.StartDate.NextDay(DayOfWeek.Sunday); var nextSunday = exercisePlan.StartDate; int counter = 0; for (int i = 0; i < 14; i++) { Label dateLabel = this.FindControl(string.Format("week{0}Date", i)) as Label; if (dateLabel != null) { dateLabel.Text = nextSunday.AddDays((i - 1) * 7).Date.ToString("dd/MM") + "-" + nextSunday.AddDays((i * 7) - 1).Date.ToString("dd/MM"); } for (int d = 1; d <= 7; d++) { if (nextSunday.AddDays(counter).Date == PrizeCommonUtils.GetSystemDate().Date) { HtmlTableCell tempLabel = this.FindControl(string.Format("w{0}d{1}", i, d)) as HtmlTableCell; if (tempLabel != null) { tempLabel.Attributes.Add("class", tempLabel.Attributes["class"] + " active"); } } //Label tempLabel = this.FindControl(string.Format("week{0}_{1}", i, d)) as Label; //if (tempLabel != null) // tempLabel.Text = nextSunday.AddDays(counter).ToString("dd/M"); counter++; } } }
protected void Page_Load(object sender, EventArgs e) { string v = Request.QueryString["type"]; if (v != null) { GroupType = v; } string l = Request.QueryString["level"]; if (l != null) { GroupLevel = l; } if (HttpContext.Current.User.Identity.IsAuthenticated) { var member = PrizeMemberAuthUtils.GetMemberData(); if (member != null) { commentName.Text = member.Firstname + " " + member.Surname; var acc = new PrizeDataAccess(); commentPlan.Text = acc.GetPlanInfoForPublish(); if (member.Photo != null && member.Photo != "") { commentImage.ImageUrl = member.Photo; } else { commentImage.ImageUrl = @"\images\profile.jpg"; } } BindForm(); } }
public string GetEmptyPlanJumpURL(PrizeMember member) { string sURL = ""; PrizeDataAccess db = new PrizeDataAccess(); MemberExercisePlan myPlan = db.GetCurrentMemberPausedPlan(member.UmbracoId); if (myPlan != null) { sURL = PrizeConstants.URL_MEMBER_PLAN_SUSPENDED; return(sURL); } myPlan = GetNextMemberPlanNeedToPay(member.UmbracoId); if (myPlan == null) { sURL = String.Format("{0}?loginName={1}&memberId={2}", PrizeConstants.URL_MEMBER_CONTINUE_PLAN, member.Email, member.UmbracoId); } else { sURL = String.Format("{0}?targetplanid={1}&targetmemberplanid={2}", PrizeConstants.URL_MEMBER_BUY_PLAN, myPlan.ExercisePlanId, myPlan.Id); } return(sURL); }
protected void btnChangeLevel_Click(object sender, EventArgs e) { var sTargetLevel = ddlLevel.SelectedItem.Text; PrizeMemberPlanManager man = new PrizeMemberPlanManager(); PrizeDataAccess dbAccess = new PrizeDataAccess(); MemberExercisePlan myPlan = dbAccess.GetCurrentMemberPlanOrStartingPlan(memberId); if (myPlan == null) { Response.Write("<script>alert('Can't find the user's plan.');</script>"); } else { if (!man.ChangeMemberPlanLevel(myPlan.Id, sTargetLevel)) { Response.Write("<script>alert('The level of the current program not in the database.');</script>"); } else { Response.Write("<script>alert('The user's level has been changed to " + sTargetLevel + ");</script>"); } } this.BindGrid(); }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } if (plan == null) { return; } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Side-plank'); $('#exerciseModal2').load('/exercise/Powerband-high-to-low-woodchop'); $('#exerciseModal3').load('/exercise/Side-plank-powerband-pull');"; imgExercise1.ImageUrl = "/media/15009/landscape_side_plank_step1.jpg"; imgExercise2.ImageUrl = "/media/14715/landscape_powerband_high_to_low_woodchop_step1.jpg"; imgExercise3.ImageUrl = "/media/15150/landscape_side_plank_powerband_pull_step1.jpg"; lblExercise1.Text = "Side plank"; lblExercise2.Text = "Powerband high to low woodchop"; lblExercise3.Text = "Side plank powerband pull"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/Ab-circles'); $('#exerciseModal2').load('/exercise/Cable-mid-woodchop'); $('#exerciseModal3').load('/exercise/Deadball-woodchop-slam');"; imgExercise1.ImageUrl = "/media/15145/landscape_ab_circles.jpg"; imgExercise2.ImageUrl = "/media/15126/landscape_cable_woodchop-mid_step1.jpg"; imgExercise3.ImageUrl = "/media/14403/landscape_deadball_woodchop_slam_step1.jpg"; lblExercise1.Text = "Ab circles"; lblExercise2.Text = "Cable mid woodchop"; lblExercise3.Text = "Deadball woodchop slam"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Side-plank'); $('#exerciseModal2').load('/exercise/Powerband-high-to-low-woodchop'); $('#exerciseModal3').load('/exercise/Powerband-pallof-press');"; imgExercise1.ImageUrl = "/media/15009/landscape_side_plank_step1.jpg"; imgExercise2.ImageUrl = "/media/14715/landscape_powerband_high_to_low_woodchop_step1.jpg"; imgExercise3.ImageUrl = "/media/14689/landscape_powerband_pallof_press_step1.jpg"; lblExercise1.Text = "Side plank"; lblExercise2.Text = "Powerband high to low woodchop"; lblExercise3.Text = "Powerband pallof press"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/Ab-circles'); $('#exerciseModal2').load('/exercise/Cable-low-to-high-woodchop'); $('#exerciseModal3').load('/exercise/Cable-pallof-press');"; imgExercise1.ImageUrl = "/media/15145/landscape_ab_circles.jpg"; imgExercise2.ImageUrl = "/media/15123/landscape_cable_woodchop-low_to_high_step1.jpg"; imgExercise3.ImageUrl = "/media/15106/landscape_cable_pallof_press_step1.jpg"; lblExercise1.Text = "Ab circles"; lblExercise2.Text = "Cable low to high woodchop"; lblExercise3.Text = "Cable pallof press"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
protected void LoadWeeklyInfo(int memberID, PrizeExercisePlanWeek planWeek, MemberExercisePlanWeek memberPlanWeek) { dayNumber = PrizeCommonUtils.GetSystemDate().GetDayOfWeek(); int memberId = PrizeMemberAuthUtils.GetMemberID(); using (DIYPTEntities db = new DIYPTEntities()) { db.Database.Connection.Open(); lblDateDuration.Text = PrizeCommonUtils.ParseDateToEnglish(memberPlanWeek.StartDate) + " - " + PrizeCommonUtils.ParseDateToEnglish(memberPlanWeek.EndDate); for (int i = 0; i < lblDates.Count; i++) { lblDates[i].Text = PrizeCommonUtils.ParseShortDateToEnglish(memberPlanWeek.StartDate.AddDays(i)); HyperLink linkDay = FindControl("linkDay" + (i + 1)) as HyperLink; if (linkDay != null && planWeek != null) { linkDay.NavigateUrl = (String.Format("{0}?PlanWeekId={1}&MemberPlanWeekId={2}&PlanDayNumber={3}", PrizeConstants.URL_MEMBER_DAY_VIEW, planWeek.Id, memberPlanWeek.Id, i + 1)); } else if (planWeek == null) { //Orientation week linkDay.NavigateUrl = "/orientation/day-" + (i + 1); labels[i].Text = "Orientation day " + (i + 1); } } if (planWeek == null) { lblWeekNum.Text = "Week 0"; PrizeDataAccess dba = new PrizeDataAccess(); if (dba.MemberInOrientation(PrizeMemberAuthUtils.GetMemberID())) { topInfo.Visible = false; } db.Database.Connection.Close(); return; } int iWeekNum = memberPlanWeek.Week; lblWeekNum.Text = "Week " + iWeekNum; string[] planWeekDesc = planWeek.Description.Split('\n'); bool bEquipmentSession = false; if (strEquipments == null) { strEquipments = new List <string>(); } for (int i = 0; i < planWeekDesc.Length; i++) { string[] strKeyValue = planWeekDesc[i].Split(':'); if (strKeyValue != null && strKeyValue.Length > 1) { if ((i == 1) && (strKeyValue[0].IndexOf("phase", StringComparison.OrdinalIgnoreCase) >= 0)) { lblTrainingPhase.Text = strKeyValue[1]; continue; } if ((i == 2) && (strKeyValue[0].IndexOf("phase duration", StringComparison.OrdinalIgnoreCase) >= 0 || (strKeyValue[0].IndexOf("training duration", StringComparison.OrdinalIgnoreCase) >= 0))) { lblDuration.Text = strKeyValue[1]; continue; } if (strKeyValue[0].IndexOf("equipment", StringComparison.OrdinalIgnoreCase) >= 0) { bEquipmentSession = true; strEquipments.Clear(); continue; } } if (bEquipmentSession && Regex.Matches(planWeekDesc[i], @"[a-zA-Z]").Count > 0) { strEquipments.Add(planWeekDesc[i]); continue; } } if (strEquipments != null && strEquipments.Count > 0) { string tempLiteral = "<ul class='equipment-list'>"; foreach (var e in strEquipments) { if (e != " ") { tempLiteral += "<li>" + e + "</li>"; } } tempLiteral += "</ul>"; equipmentLiteral.Text = tempLiteral; equipmentLiteralMobile.Text = tempLiteral; equipmentDiv.Visible = true; } DataSet myPlan = dbAccess.GetExercisePlanInfo((int)planWeek.ExercisePlanId); if (myPlan.Tables[0].Rows.Count == 0) { db.Database.Connection.Close(); return; } this.lblGoal.Text = myPlan.Tables[0].Rows[0]["ProgramName"].ToString(); LoadDailyInfo(memberId, planWeek); //PrizePlanProgram myProgram = (from c in db.PrizePlanPrograms // where c.Id == planWeek.ExercisePlanId // select c).FirstOrDefault(); db.Database.Connection.Close(); } }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/squat'); $('#exerciseModal2').load('/exercise/powerband-front-squat'); $('#exerciseModal3').load('/exercise/powerband-back-squat');"; imgExercise1.ImageUrl = "/media/15196/landscape_bw_squat_step1.jpg"; imgExercise2.ImageUrl = "/media/14724/landscape_powerband_front_raise_step1.jpg"; imgExercise3.ImageUrl = "/media/14739/landscape_powerband_back_squat_step1.jpg"; lblExercise1.Text = "BW squat"; lblExercise2.Text = "Powerband front squat"; lblExercise3.Text = "Powerband back squat"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/squat'); $('#exerciseModal2').load('/exercise/bb-back-squat'); $('#exerciseModal3').load('/exercise/bb-front-squat');"; imgExercise1.ImageUrl = "/media/15196/landscape_bw_squat_step1.jpg"; imgExercise2.ImageUrl = "/media/13366/landscape_bb_back_squat_step1.jpg"; imgExercise3.ImageUrl = "/media/13373/landscape_bb_front_squat_step1.jpg"; lblExercise1.Text = "BW squat"; lblExercise2.Text = "BB back squat"; lblExercise3.Text = "BB front squat"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/squat'); $('#exerciseModal2').load('/exercise/bb-pulse-squat'); $('#exerciseModal3').load('/exercise/bb-front-squat');"; imgExercise1.ImageUrl = "/media/15196/landscape_bw_squat_step1.jpg"; imgExercise2.ImageUrl = "/media/14673/landscape_bb_pulse_squat.jpg"; imgExercise3.ImageUrl = "/media/13373/landscape_bb_front_squat_step1.jpg"; lblExercise1.Text = "BW squat"; lblExercise2.Text = "BB pulse squat"; lblExercise3.Text = "BB front squat"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/squat'); $('#exerciseModal2').load('/exercise/bb-back-squat'); $('#exerciseModal3').load('/exercise/bb-front-squat');"; imgExercise1.ImageUrl = "/media/15196/landscape_bw_squat_step1.jpg"; imgExercise2.ImageUrl = "/media/13366/landscape_bb_back_squat_step1.jpg"; imgExercise3.ImageUrl = "/media/13373/landscape_bb_front_squat_step1.jpg"; lblExercise1.Text = "BW squat"; lblExercise2.Text = "BB back squat"; lblExercise3.Text = "BB front squat"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } if (plan == null) { return; } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Alternate-lunges'); $('#exerciseModal2').load('/exercise/Walking-lunges'); $('#exerciseModal3').load('/exercise/Alternating-reverse-lunge');"; imgExercise1.ImageUrl = "/media/14977/landscape_alternate_lunges_step3.jpg"; imgExercise2.ImageUrl = "/media/15198/landscape_walking_lunges.jpg"; imgExercise3.ImageUrl = "/media/14977/landscape_alternate_lunges_step3.jpg"; lblExercise1.Text = "Alternate lunges"; lblExercise2.Text = "Walking lunges"; lblExercise3.Text = "Alternating reverse lunge"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/Alternate-lunges'); $('#exerciseModal2').load('/exercise/Walking-lunges'); $('#exerciseModal3').load('/exercise/Alternating-reverse-lunge');"; imgExercise1.ImageUrl = "/media/14977/landscape_alternate_lunges_step3.jpg"; imgExercise2.ImageUrl = "/media/15198/landscape_walking_lunges.jpg"; imgExercise3.ImageUrl = "/media/14977/landscape_alternate_lunges_step3.jpg"; lblExercise1.Text = "Alternate lunges"; lblExercise2.Text = "Walking lunges"; lblExercise3.Text = "Alternating reverse lunge"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Alternate-lunges'); $('#exerciseModal2').load('/exercise/Walking-lunges'); $('#exerciseModal3').load('/exercise/side-lunge');"; imgExercise1.ImageUrl = "//media/14977/landscape_alternate_lunges_step3.jpg"; imgExercise2.ImageUrl = "/media/15198/landscape_walking_lunges.jpg"; imgExercise3.ImageUrl = "/media/13771/landscape_side_lunge_step3.jpg"; lblExercise1.Text = "Alternate lunges"; lblExercise2.Text = "Walking lunges"; lblExercise3.Text = "Side lunge"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/Alternate-lunges'); $('#exerciseModal2').load('/exercise/Walking-lunges'); $('#exerciseModal3').load('/exercise/side-lunge');"; imgExercise1.ImageUrl = "/media/14977/landscape_alternate_lunges_step3.jpg"; imgExercise2.ImageUrl = "/media/15198/landscape_walking_lunges.jpg"; imgExercise3.ImageUrl = "/media/13771/landscape_side_lunge_step3.jpg"; lblExercise1.Text = "Alternate lunges"; lblExercise2.Text = "Walking lunges"; lblExercise3.Text = "Side lunge"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
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; } }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } if (plan == null) { return; } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Powerband-low-row'); $('#exerciseModal2').load('/exercise/Powerband-high-row'); $('#exerciseModal3').load('/exercise/Powerband-bent-over-row');"; imgExercise1.ImageUrl = "/media/14692/landscape_powerband_low_row_step1.jpg"; imgExercise2.ImageUrl = "/media/14695/landscape_powerband_high_row_step1.jpg"; imgExercise3.ImageUrl = "/media/14736/landscape_powerband_bent_over_row_step1.jpg"; lblExercise1.Text = "Powerband low row"; lblExercise2.Text = "Powerband high row"; lblExercise3.Text = "Powerband bent over row"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/seated-row'); $('#exerciseModal2').load('/exercise/lat-pulldown'); $('#exerciseModal3').load('/exercise/Assisted-Powerband-pullups');"; imgExercise1.ImageUrl = "/media/14705/landscape_seated_row_step1.jpg"; imgExercise2.ImageUrl = "/media/15138/landscape_lat_pulldown_step1.jpg"; imgExercise3.ImageUrl = "/media/15073/landscape_assisted_powerband_pullups_step1.jpg"; lblExercise1.Text = "Seated row NG"; lblExercise2.Text = "Lat pulldown machine"; lblExercise3.Text = "Assisted Powerband pullups"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/Powerband-high-row'); $('#exerciseModal2').load('/exercise/Powerband-bent-over-row'); $('#exerciseModal3').load('/exercise/Powerband-lat-pulldown');"; imgExercise1.ImageUrl = "/media/14695/landscape_powerband_high_row_step1.jpg"; imgExercise2.ImageUrl = "/media/14736/landscape_powerband_bent_over_row_step1.jpg"; imgExercise3.ImageUrl = "/media/15054/landscape_powerband_lat_pulldown_step1.jpg"; lblExercise1.Text = "Powerband high row"; lblExercise2.Text = "Powerband bent over row"; lblExercise3.Text = "Powerband lat pulldown"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/seated-row'); $('#exerciseModal2').load('/exercise/lat-pulldown'); $('#exerciseModal3').load('/exercise/Pullup-negatives');"; imgExercise1.ImageUrl = "/media/14705/landscape_seated_row_step1.jpg"; imgExercise2.ImageUrl = "/media/15138/landscape_lat_pulldown_step1.jpg"; imgExercise3.ImageUrl = "/media/14787/landscape_pullup_negatives_step1w.jpg"; lblExercise1.Text = "Seated row"; lblExercise2.Text = "Lat pulldown machine"; lblExercise3.Text = "Pullup negatives"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
protected void Page_Load(object sender, EventArgs e) { PrizeDataAccess db = new PrizeDataAccess(); int memberId = PrizeMemberAuthUtils.GetMemberID(); var plan = dbAccess.GetCurrentOrStartingExercisePlanInfo(memberId); if (plan != null && plan.IsTrialPlan == 1) { divTrial.Visible = true; divOrientation.Visible = false; divHeader.Visible = false; dayView2.Visible = false; printWeek.Visible = false; return; } var exercisePlan = db.GetCurrentMemberPlanOrStartingPlan(memberId); if (exercisePlan == null) { PrizeMember member = PrizeMemberAuthUtils.GetMemberData(memberId); PrizeMemberPlanManager planMan = new PrizeMemberPlanManager(); Response.Redirect(planMan.GetEmptyPlanJumpURL(member)); } var nextMonday = exercisePlan.StartDate; //.Value.Next(DayOfWeek.Monday); int counter = 0; string weekLabel = ""; //10 April - 17 April, 2017 for (int d = 1; d <= 7; d++) { DateTime newDate = nextMonday.AddDays(counter); if (newDate.Date == DateTime.Now.Date) { dayView1.Attributes.Add("href", "/orientation/day-" + d); dayView2.Attributes.Add("href", "/orientation/day-" + d); } if (counter == 0) { weekLabel += newDate.ToString("d MMMM"); } if (counter == 6) { weekLabel += " - " + newDate.ToString("d MMMM, yyyy"); } Label tempLabel = this.FindControl(string.Format("lblDay{0}", d)) as Label; Label tempLabelDate = this.FindControl(string.Format("lblDate{0}", d)) as Label; if (tempLabel != null) { tempLabel.Text = newDate.ToString("d MMMM yyyy"); tempLabelDate.Text = newDate.ToString("dddd"); } counter++; } lblWeekly.Text = weekLabel; if (!IsPostBack) { for (int i = 1; i < 7; i++) { string result = dbAccess.GetOrientationWeekDayResult(exercisePlan.Id, i); string controlName = ""; for (int j = 1; j <= 10; j++) { controlName = "quest" + i + j; HtmlGenericControl c = FindControl(controlName) as HtmlGenericControl; if (c == null) { break; } if (result[j - 1] == '0') //c.Visible = false; { c.Attributes.Add("class", "no-tick-circle"); c.InnerText = "x"; } else { c.Visible = true; } } } } }
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#?"; }
private void BindForm() { lblLevel.Text = GroupLevel; switch (GroupType.ToLower()) { case "strength": dvMain.Attributes.Add("class", "col-lg-8 chat-group chat-group-y"); imgGroup.ImageUrl = "/images/icon-strength-y.svg"; lbSubmit.Attributes.Add("class", "btn btn-secondary"); lblGroup.Text = "INCREASE MUSCLE"; lblGroup2.Text = "INCREASE MUSCLE"; imgCard.ImageUrl = "/images/chat/build-strength.jpg"; imgIcon.ImageUrl = "/images/icon-tab-strength.svg"; imgIcon.Attributes.Add("class", "icon-pg icon-yellow"); h5Beginner.Attributes.Add("class", "c_y"); h5Intermediate.Attributes.Add("class", "c_y"); h5Advance.Attributes.Add("class", "c_w"); divChatLevel.Attributes.Add("class", "chat-level chat-level-y"); linkBeginner.HRef = "/community/build-strength-group?type=strength&level=beginner"; linkIntermediate.HRef = "/community/build-strength-group?type=strength&level=intermediate"; linkAdvance.HRef = "/community/build-strength-group?type=strength&level=advanced"; break; case "weight": dvMain.Attributes.Add("class", "col-lg-8 chat-group chat-group-p"); imgGroup.ImageUrl = "/images/icon-weight-p.svg"; lbSubmit.Attributes.Add("class", "btn btn-secondary"); lblGroup.Text = "WEIGHT LOSS"; lblGroup2.Text = "WEIGHT LOSS"; imgCard.ImageUrl = "/images/chat/weight-loss.jpg"; imgIcon.ImageUrl = "/images/icon-tab-weight.svg"; imgIcon.Attributes.Add("class", "icon-pg icon-pink"); h5Beginner.Attributes.Add("class", "c_p"); h5Intermediate.Attributes.Add("class", "c_p"); h5Advance.Attributes.Add("class", "c_w"); divChatLevel.Attributes.Add("class", "chat-level chat-level-p"); linkBeginner.HRef = "/community/weight-loss-group?type=weight&level=beginner"; linkIntermediate.HRef = "/community/weight-loss-group?type=weight&level=intermediate"; linkAdvance.HRef = "/community/weight-loss-group?type=weight&level=advanced"; break; case "tone": dvMain.Attributes.Add("class", "col-lg-8 chat-group chat-group-b"); imgGroup.ImageUrl = "/images/icon-tone-up-b.svg"; lbSubmit.Attributes.Add("class", "btn btn-secondary"); lblGroup.Text = "TONE UP"; lblGroup2.Text = "TONE UP"; imgCard.ImageUrl = "/images/chat/tone-up.jpg"; imgIcon.ImageUrl = "/images/icon-tab-tone.svg"; imgIcon.Attributes.Add("class", "icon-pg icon-blue"); h5Beginner.Attributes.Add("class", "c_b"); h5Intermediate.Attributes.Add("class", "c_b"); h5Advance.Attributes.Add("class", "c_w"); divChatLevel.Attributes.Add("class", "chat-level chat-level-b"); linkBeginner.HRef = "/community/tone-up-group?type=tone&level=beginner"; linkIntermediate.HRef = "/community/tone-up-group?type=tone&level=intermediate"; linkAdvance.HRef = "/community/tone-up-group?type=tone&level=advanced"; break; default: dvMain.Attributes.Add("class", "col-lg-8 chat-group chat-group-y"); imgGroup.ImageUrl = "/images/icon-strength-y.svg"; lbSubmit.Attributes.Add("class", "btn btn-secondary btn-y"); lblGroup.Text = "INCREASE MUSCLE"; lblGroup2.Text = "INCREASE MUSCLE"; imgCard.ImageUrl = "/images/chat/build-strength.jpg"; imgIcon.ImageUrl = "/images/icon-tab-strength.svg"; imgIcon.Attributes.Add("class", "icon-pg icon-yellow"); h5Beginner.Attributes.Add("class", "c_y"); h5Intermediate.Attributes.Add("class", "c_y"); h5Advance.Attributes.Add("class", "c_w"); divChatLevel.Attributes.Add("class", "chat-level chat-level-y"); linkBeginner.HRef = "/community/build-strength-group?type=strength&level=beginner"; linkIntermediate.HRef = "/community/build-strength-group?type=strength&level=intermediate"; linkAdvance.HRef = "/community/build-strength-group?type=strength&level=advanced"; break; } //List < Comments > coms = new List<Comments>(); //coms.Add(new Comments() { Name = "Name1", Program = "program1", Comment = "comment1", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name2", Program = "program2", Comment = "comment2", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name3", Program = "program3", Comment = "comment3", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name4", Program = "program4", Comment = "comment4", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name5", Program = "program5", Comment = "comment5", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name6", Program = "program6", Comment = "comment6", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name7", Program = "program7", Comment = "commen67", Time = "20 hours ago" }); //coms.Add(new Comments() { Name = "Name8", Program = "program8", Comment = "comment8", Time = "20 hours ago" }); int tempCategory = 1; switch (GroupType) { case "strength": tempCategory = 1; break; case "weight": tempCategory = 2; break; case "tone": tempCategory = 3; break; default: break; } switch (GroupLevel) { case "beginner": tempCategory = (tempCategory * 10) + 1; break; case "intermediate": tempCategory = (tempCategory * 10) + 2; break; case "advanced": case "advance": tempCategory = (tempCategory * 10) + 3; break; default: break; } var acc = new PrizeDataAccess(); var posts = acc.GetAllPosts(tempCategory); rpComments.DataSource = posts.ToList(); rpComments.DataBind(); lblPostCount.Text = posts.Count() + " posts"; }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } if (plan == null) { return; } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/powerband-deadlift'); $('#exerciseModal2').load('/exercise/powerband-sumo-deadlift'); $('#exerciseModal3').load('/exercise/bb-deadlift');"; imgExercise1.ImageUrl = "/media/14727/landscape_powerband_deadlift_step1.jpg"; imgExercise2.ImageUrl = "/media/14762/landscape_powerband_sumo_deadlift_step1.jpg"; imgExercise3.ImageUrl = "/media/14998/landscape_bb_deadlift_step1.jpg"; lblExercise1.Text = "Powerband deadlift"; lblExercise2.Text = "Powerband sumo deadlift"; lblExercise3.Text = "BB deadlift"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/KB-deadlift'); $('#exerciseModal2').load('/exercise/bb-deadlift'); $('#exerciseModal3').load('/exercise/powerband-sumo-deadlift');"; imgExercise1.ImageUrl = "/media/13939/landscape_kettlebell_deadlift_step1.jpg"; imgExercise2.ImageUrl = "/media/14998/landscape_bb_deadlift_step1.jpg"; imgExercise3.ImageUrl = "/media/14992/landscape_bb_sumo_deadlift_step1.jpg"; lblExercise1.Text = "KB deadlift"; lblExercise2.Text = "BB deadlift"; lblExercise3.Text = "BB sumo deadlift"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/powerband-deadlift'); $('#exerciseModal2').load('/exercise/Powerband-good-morning'); $('#exerciseModal3').load('/exercise/bb-deadlift');"; imgExercise1.ImageUrl = "/media/14727/landscape_powerband_deadlift_step1.jpg"; imgExercise2.ImageUrl = "/media/14768/landscape_powerband_good_morning_step1.jpg"; imgExercise3.ImageUrl = "/media/14998/landscape_bb_deadlift_step1.jpg"; lblExercise1.Text = "Powerband deadlift"; lblExercise2.Text = "Powerband good morning"; lblExercise3.Text = "BB deadlift"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/bb-rack-pull'); $('#exerciseModal2').load('/exercise/bb-deadlift'); $('#exerciseModal3').load('/exercise/bb-stiff-leg-deadlift');"; imgExercise1.ImageUrl = "/media/13967/landscape_rack_pull_step1.jpg"; imgExercise2.ImageUrl = "/media/14998/landscape_bb_deadlift_step1.jpg"; imgExercise3.ImageUrl = "/media/15085/landscape_bb_stiff_leg_deadlift_step1.jpg"; lblExercise1.Text = "Rack pull"; lblExercise2.Text = "BB deadlift"; lblExercise3.Text = "BB stiff leg deadlift"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
private void DisplayExercise() { string tempScript = "<script>"; 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); } } if (plan == null) { return; } var acc = new PrizeDataAccess(); var planDetails = acc.GetPlanName(plan); var planArray = planDetails.Split('_'); switch (planArray[0]) { case "Lose Weight": case "Tone Up": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/pushups-on-knees'); $('#exerciseModal2').load('/exercise/powerband-push-press'); $('#exerciseModal3').load('/exercise/powerband-pushup-on-knees');"; imgExercise1.ImageUrl = "/media/13400/landscape_pushup_on_knees_step1.jpg"; imgExercise2.ImageUrl = "/media/14686/landscape_powerband_push_press_step1.jpg"; imgExercise3.ImageUrl = "/media/15048/landscape_powerband_pushup_on_knees.jpg"; lblExercise1.Text = "Pushups on knees"; lblExercise2.Text = "Powerband push press"; lblExercise3.Text = "Powerband pushup on knees"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/pushups-on-knees'); $('#exerciseModal2').load('/exercise/bb-strict-press'); $('#exerciseModal3').load('/exercise/bb-push-press');"; imgExercise1.ImageUrl = "/media/13400/landscape_pushup_on_knees_step1.jpg"; imgExercise2.ImageUrl = "/media/13358/landscape_bb_strict_press_step1.jpg"; imgExercise3.ImageUrl = "/media/13357/landscape_bb_push_press_step1.jpg"; lblExercise1.Text = "Push ups on knees"; lblExercise2.Text = "BB strict press"; lblExercise3.Text = "BB push press"; } break; case "Build Muscle": if (planArray[1] == "Home") { tempScript += @"$('#exerciseModal1').load('/exercise/powerband-push-press'); $('#exerciseModal2').load('/exercise/Powerband-floor-chest-press'); $('#exerciseModal3').load('/exercise/Powerband-pushup-on-toes');"; imgExercise1.ImageUrl = "/media/14686/landscape_powerband_push_press_step1.jpg"; imgExercise2.ImageUrl = "/media/15015/landscape_powerband_floor_chest_press_step1.jpg"; imgExercise3.ImageUrl = "/media/15049/landscape_powerband-_pushup_on_toes.jpg"; lblExercise1.Text = "Powerband push press"; lblExercise2.Text = "Powerband floor chest press"; lblExercise3.Text = "Powerband pushup on toes"; } else { tempScript += @"$('#exerciseModal1').load('/exercise/Pushups-on-toes'); $('#exerciseModal2').load('/exercise/BB-flat-bench-press'); $('#exerciseModal3').load('/exercise/BB-incline-bench-press');"; imgExercise1.ImageUrl = "/media/13403/landscape_pushup_on_toes_step1.jpg"; imgExercise2.ImageUrl = "/media/13331/landscape_bb_flat_bench_press_step1.jpg"; imgExercise3.ImageUrl = "/media/13328/landscape_bb_incline_bench_press_step1.jpg"; lblExercise1.Text = "Pushups on toes"; lblExercise2.Text = "BB flat bench press"; lblExercise3.Text = "BB incline bench press"; } break; default: break; } tempScript += "</script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "modalPopup", tempScript, false); }
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); }