protected void BtnHard_Click(object sender, EventArgs e) { pnlDifficulty.Visible = false; pnlGame.Visible = true; var gs = GamePlayStats.FetchObject(int.Parse(GPSID.Text)); gs.Difficulty = "Hard"; gs.Update(); //ReloadGame(Hard) var mg = DAL.Minigame.FetchObject(int.Parse(MGID.Text)); if (mg.MiniGameType == 1) { MGBook1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 2) { MGMixMatchPlay1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 3) { MGCodeBreaker1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 4) { MGWordMatch1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 5) { MGMatchingGamePlay1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 6) { MGHiddenPicPlay1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } if (mg.MiniGameType == 7) { MGChooseAdvPlay1.LoadGame(mg.MGID, 3); pnlGame.Visible = true; } }
public void CompleteGamePlay() { var gs = GamePlayStats.FetchObject(int.Parse(GPSID.Text)); gs.Completed = DateTime.Now; gs.CompletedPlay = true; gs.Update(); pnlGame.Visible = false; pnlWinner.Visible = true; //* actually award points and what not ... but only if they have not reaceived points for this minigame already if (!PatronPoints.HasEarnedMinigamePoints(int.Parse(PID.Text), int.Parse(MGID.Text))) { ProcessTheWin(); } }
public void CompleteGamePlay() { var gs = GamePlayStats.FetchObject(int.Parse(GPSID.Text)); gs.Completed = DateTime.Now; gs.CompletedPlay = true; gs.Update(); bool earnedBadge = false; //* actually award points and what not ... but only if they have not reaceived points for this minigame already if (!PatronPoints.HasEarnedMinigamePoints(int.Parse(PID.Text), int.Parse(MGID.Text))) { earnedBadge = ProcessTheWin(); } string message = StringResources.getString("adventures-success"); string glyphicon = "flag"; if (earnedBadge) { message = StringResources.getString("adventures-success-badge"); glyphicon = "certificate"; } if (message.Contains("{0}")) { new SessionTools(Session).AlertPatron(string.Format(message, MGName.Text), PatronMessageLevels.Success, glyphicon); } else { new SessionTools(Session).AlertPatron(message, PatronMessageLevels.Success, glyphicon); } Response.Redirect("~/Adventures/"); }