/// <summary> /// Retrieve DB data to place to the page /// </summary> protected void GetData() { if (nTournamentID > 0) { DataRow oDR = GetFirstRow(Config.DbGetTournamentDetails, new object[] { "@ID", nTournamentID }); if (oDR != null) { nEngineID = Utils.GetInt(oDR["GameEngineID"]); nActDispID = Utils.GetInt(oDR["ActionDispatcherID"]); enType = (TrnType)Utils.GetInt(oDR["CategoryTypeID"]); string xmlString = oDR["SettingsXML"].ToString(); oCom.FillTable(xmlString, false, ref table); //disable controls on the page comboEngine.Enabled = false; btnSave.Visible = false; //show Tornament Prizes button btnPrize1.Visible = true; btnPrize2.Visible = true; btnInvitedU.Visible = true; } } else { btnPrize1.Visible = false; //hide Tornament Prizes button btnPrize2.Visible = false; btnInvitedU.Visible = false; } }
private void Page_Load(object sender, EventArgs e) { lblInfo.EnableViewState = false; nTournamentID = GetMainParamInt(hdnTournamentID); if (Request["type"] != null && Request["type"] == "2") { enType = TrnType.SitAndGo; } if (!IsPostBack) { GetData(); PreparePage(); if ((comboEngine.SelectedIndex >= 0) && (nTournamentID <= 0)) { FillTournamentProperty(); } if (enType == TrnType.SitAndGo) { TextBox ttc = (TextBox )table.FindControl("Maximum Number of Registered Gamers"); if (Utils.GetInt(ttc.Text) <= 1) { ttc.Text = "2"; } } DropDownList ct = (DropDownList)table.FindControl("Category"); ct.Enabled = false; ct.SelectedValue = ((int)enType).ToString(); ct = (DropDownList)table.FindControl("Tournament Type"); ct.Enabled = false; if (nTournamentID <= 0) { ct.SelectedIndex = ct.Items.Count - 1; TextBox tb = (TextBox)table.FindControl("Tournament Name"); tb.Text = String.Format("Tournament #{0}", GetTournamentNextId()); } Session["Tournament Type Maintenance"] = ct.SelectedIndex.ToString(); } BackPageUrl = (string)Session["TournamentMaintenanceUrl"]; }