private void DisplayHandicappedSkins() { int selectedEventID = int.Parse(Dropdown_LeagueEvent.SelectedValue); if (selectedEventID != 0) { Dictionary <int, List <byte> > scores = DatabaseFunctions.GetScores(selectedEventID); Dictionary <int, int> handicaps = Scoring.GetPlayerHandicapsForEvent(leagueID, selectedEventID, scores.Keys.ToList()); Table_SkinsResults.Width = 800; Table_SkinsResults.Rows.Clear(); var courseInfo = DatabaseFunctions.GetCourseInfo(selectedEventID); AddCourseInfoRowsSkinsTable(Table_SkinsResults, courseInfo); Scoring.ApplyHandicapsToScoresForHandicappedSkins(scores, handicaps, courseInfo); List <int> skins = Scoring.calculateSkins(scores); //reset skins dropdown DropdownList_SkinsPlayers.Items.Clear(); ListItem initialItem = new ListItem("Select Golfers(s) to Exclude From Skins", "0"); DropdownList_SkinsPlayers.Items.Add(initialItem); foreach (int GolferID in scores.Keys) { ListItem item = new ListItem(DatabaseFunctions.GetGolferName(GolferID), GolferID.ToString()); DropdownList_SkinsPlayers.Items.Add(item); AddTableRow(Table_SkinsResults, GolferID, scores[GolferID], skins); } } }
private void DisplaySkins() { int selectedEventID = int.Parse(Dropdown_LeagueEvent.SelectedValue); if (selectedEventID != 0) { Dictionary <int, List <byte> > scores = DatabaseFunctions.GetScores(selectedEventID); RemoveGolfersFromSkins(scores); //skinsCheckboxes = new Dictionary<int, CheckBox>(); //Panel_Skins.ContentTemplateContainer.Controls.Clear(); //Table SkinsTable = new Table(); Table_SkinsResults.Width = 800; Table_SkinsResults.Rows.Clear(); AddCourseInfoRowsSkinsTable(Table_SkinsResults, DatabaseFunctions.GetCourseInfo(selectedEventID)); List <int> skins = Scoring.calculateSkins(scores); //reset skins dropdown DropdownList_SkinsPlayers.Items.Clear(); ListItem initialItem = new ListItem("Select Golfers(s) to Exclude From Skins", "0"); DropdownList_SkinsPlayers.Items.Add(initialItem); foreach (int GolferID in scores.Keys) { ListItem item = new ListItem(DatabaseFunctions.GetGolferName(GolferID), GolferID.ToString()); DropdownList_SkinsPlayers.Items.Add(item); AddTableRow(Table_SkinsResults, GolferID, scores[GolferID], skins); } //TableRow bottomRow = new TableRow(); //TableCell cell1 = new TableCell(); //Button recalculateButton = new Button(); //recalculateButton.Text = "Recalculate Skins Using Only Selected Players"; ////recalculateButton.Command += RecalculateSkinsButtonPress; //cell1.Controls.Add(recalculateButton); //bottomRow.Cells.Add(cell1); //SkinsTable.Rows.Add(bottomRow); //Panel_Skins.ContentTemplateContainer.Controls.Add(SkinsTable); } }