Esempio n. 1
0
 public void UpdateDisplayTournaments()
 {
     TournamentTable = ConvertToDatatable(t);
     DisplayTournamentGrid.DataSource = TournamentTable;
     DisplayTournamentGrid.Update();
     DisplayTournamentGrid.Refresh();
 }
Esempio n. 2
0
        private void myTmntButton_Click(object sender, EventArgs e)
        {
            List <Tournament> temp = new List <Tournament>();

            foreach (Tournament r in t)
            {
                if (r.GetEntrants().Exists(x => x.GetUserID().Equals(me.ID)))
                {
                    temp.Add(r);
                }
            }
            DisplayTournamentGrid.DataSource = ConvertToDatatable(temp);
            DisplayTournamentGrid.Update();
            DisplayTournamentGrid.Refresh();
            myTmntButton.Enabled = false;
            filterButton.Text    = "Unfilter";
        }
Esempio n. 3
0
        private void filterButton_Click(object sender, EventArgs e)
        {
            if (filterButton.Text.Equals("Filter"))
            {
                filterButton.Text = "Unfilter";
                List <DataRow> temp             = new List <DataRow>();
                var            currentSelection = monthCalendar1.SelectionRange;

                foreach (DataRow r in TournamentTable.Rows)
                {
                    DateTime d = DateTime.Parse(r.ItemArray[2].ToString());

                    if (currentSelection.Start == currentSelection.End)
                    {
                        if ((d.DayOfYear == currentSelection.Start.DayOfYear))
                        {
                            temp.Add(r);
                        }
                    }
                    else if ((d > currentSelection.Start) && (d < currentSelection.End))
                    {
                        temp.Add(r);
                    }
                }
                int rc = TournamentTable.Rows.Count;
                foreach (DataRow r in temp)
                {
                    TournamentTable.ImportRow(r);
                }
                for (int i = 0; i < rc; i++)
                {
                    TournamentTable.Rows.RemoveAt(0);
                }
                DisplayTournamentGrid.DataSource = TournamentTable;
                DisplayTournamentGrid.Update();
                DisplayTournamentGrid.Refresh();
                myTmntButton.Enabled = false;
            }
            else if (filterButton.Text.Equals("Unfilter"))
            {
                filterButton.Text    = "Filter";
                myTmntButton.Enabled = true;
                UpdateDisplayTournaments();
            }
        }