private void lbAcademies_SelectedIndexChanged(object sender, EventArgs e) { BJJEvent evt = (BJJEvent)lbEvents.SelectedItem; lbCompetitorsByAcademy.DataSource = evt.GetCompetitorsByAcademy((string)lbAcademies.SelectedItem); lbCompetitorsByAcademy.DisplayMember = "DisplayName"; }
private void lbEvents_SelectedIndexChanged(object sender, EventArgs e) { if (lbEvents.SelectedIndex >= 0) { BJJEvent evt = (BJJEvent)lbEvents.SelectedItem; lbCompetitors.DataSource = evt.Competitors.OrderBy(item => item.Name).ToList(); lbCompetitors.DisplayMember = "DisplayName"; lbAcademies.DataSource = evt.GetAcademyList(); } }
public void GetAllBrackets() { BJJEvent evt = (BJJEvent)lbEvents.SelectedItem; foreach (BJJCompetitor competitor in evt.Competitors) { string s = postData("https://bjjcomp.com/lib/fighterschedulequery.php", "event=" + evt.ID + "&competitorid=" + competitor.Id); compbracket obj = JsonConvert.DeserializeObject <compbracket>(s); competitor.Brackets = obj; } }
private void btnGetCompetitors_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; BJJEvent evt = (BJJEvent)lbEvents.SelectedItem; for (char c = 'a'; c <= 'z'; c++) { string s = getData("https://bjjcomp.com/lib/searchcompetitor.php?event=" + evt.ID + "&q=" + c); evt.AddCompetitors(s); } lbCompetitors.DataSource = evt.Competitors.OrderBy(item => item.Name).ToList(); lbCompetitors.DisplayMember = "DisplayName"; lbAcademies.DataSource = evt.GetAcademyList(); GetAllBrackets(); Cursor.Current = Cursors.Default; }