protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (string.IsNullOrEmpty(Request["MGID"]) && (Session["MGID"] == null || Session["MGID"].ToString() == "")) { Response.Redirect("~"); } if (!string.IsNullOrEmpty(Request["MGID"])) { MGID.Text = Request["MGID"]; Session["MGID"] = MGID.Text; } else { MGID.Text = Session["MGID"].ToString(); } if (Session["GoToUrl"] != null && Session["GoToUrl"].ToString() == "") { GoToUrl = Session["GoToUrl"].ToString(); Session["GoToUrl"] = string.Empty; } var mg = DAL.Minigame.FetchObject(int.Parse(MGID.Text)); MGName.Text = mg.GameName; Acknowledgements.Text = Server.HtmlDecode(mg.Acknowledgements); if (Acknowledgements.Text.Length == 0) { Acknowledgements.Visible = false; } else { Acknowledgements.Text = "<br><br>" + Acknowledgements.Text; } SetIntructions(mg.MiniGameType); LoadMinigame(mg.MGID, mg.MiniGameType); var gs = new DAL.GamePlayStats(); var patron = (Patron)Session["Patron"]; PID.Text = patron.PID.ToString(); gs.Started = DateTime.Now; gs.MGID = mg.MGID; gs.MGType = mg.MiniGameType; gs.Difficulty = "Easy"; gs.PID = patron.PID; gs.Insert(); GPSID.Text = gs.GPSID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (string.IsNullOrEmpty(Request["MGID"]) && (Session["MGID"] == null || Session["MGID"].ToString() == "")) { Response.Redirect("~"); } if (!string.IsNullOrEmpty(Request["MGID"])) { MGID.Text = Request["MGID"]; Session["MGID"] = MGID.Text; } else { MGID.Text = Session["MGID"].ToString(); } if (Session["GoToUrl"] != null && Session["GoToUrl"].ToString() == "") { GoToUrl = Session["GoToUrl"].ToString(); Session["GoToUrl"] = string.Empty; } var mg = DAL.Minigame.FetchObject(int.Parse(MGID.Text)); MGName.Text = mg.GameName; Page.Title = Acknowledgements.Text = Server.HtmlDecode(mg.Acknowledgements); if (Acknowledgements.Text.Length == 0) { Acknowledgements.Visible = false; } else { Acknowledgements.Text = "<br><br>" + Acknowledgements.Text; } SetIntructions(mg.MiniGameType); LoadMinigame(mg.MGID, mg.MiniGameType); var gs = new DAL.GamePlayStats(); var patron = (Patron)Session["Patron"]; PID.Text = patron.PID.ToString(); gs.Started = DateTime.Now; gs.MGID = mg.MGID; gs.MGType = mg.MiniGameType; gs.Difficulty = "Easy"; gs.PID = patron.PID; gs.Insert(); GPSID.Text = gs.GPSID.ToString(); } }