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; }
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); }