public void LoadBored() { if (_board != null) { Cache[_board.Name] = _board; } else { string boredName = string.Empty; if (ViewState["boardName"] == null) { ViewState["boardName"] = boredName = Request["cat"].ToString().URLDecodeToName(); } else { boredName = ViewState["boardName"].ToString(); } _board = Cache[boredName] as ScoreBored; if (_board == null) { try { Cache[boredName] = _board = ScoreBored.Load(boredName); } catch { } } } }
protected void EditBoard(string boardName) { ScoreBored board = ScoreBored.Load(boardName); MembershipUser user = Membership.GetUser(); if (board != null && board.UserId == user.ProviderUserKey.ToString()) { txtTheme.Text = board.Description; h1.InnerText = "Edit Board"; editWarn.Text = "Note: Edits to the name of a Pros and Cons List or the Competitor Names in a Tournament will change the URL for the board. This will invalidate social networking bookmarks and embedded mini-boards"; rdoType.SelectedIndex = (board.IsProCon) ? 0 : 1; rdoType_SelectedIndexChanged(this, null); if (board.IsProCon) { txtName.Text = board.Name; txtMatch1.Text = "Pro"; txtMatch2.Text = "Con"; txtPro3.Text = board.Phrases[-3]; txtPro2.Text = board.Phrases[-2]; txtPro1.Text = board.Phrases[-1]; txtCon1.Text = board.Phrases[1]; txtCon2.Text = board.Phrases[2]; txtCon3.Text = board.Phrases[3]; chkIs.Checked = board.PhraseIs; ScriptManager.RegisterStartupScript(this, this.GetType(), "startup", "proConPre(); ", true); } else { txtMatch1.Text = board.ProName; txtMatch2.Text = board.ConName; txtVSphrase1.Text = board.Phrases[1]; txtVSphrase2.Text = board.Phrases[2]; txtVSphrase3.Text = board.Phrases[3]; ScriptManager.RegisterStartupScript(this, this.GetType(), "startup", "matchPre(); ", true); } } else { Response.Redirect(Request.AppRelativeCurrentExecutionFilePath); } }