示例#1
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                List <MatchUpFinal> temp = new List <MatchUpFinal>();
                foreach (MatchUpFinal value in Program.matchUpFinal)
                {
                    if (listBox1.SelectedItem.ToString() != (value.Time + " - " + value.TeamName + " VS " + value.OpponentTeamName))
                    {
                        temp.Add(value);
                    }
                }
                Program.matchUpFinal = temp;
                // write matchup file

                if (Program.week != 0)
                {
                    using (TextWriter tw = new StreamWriter(@Program.filePath + Program.currentSport + "\\" + Program.currentLeague + "\\week" + Program.weekStats + ".csv"))
                    {
                        foreach (MatchUpFinal value in Program.matchUpFinal)
                        {
                            tw.WriteLine(value.Time + "," + value.TeamName + "," + value.OpponentTeamName);
                        }
                    }
                }
                RemoveMatchUp removeMatchUp = new RemoveMatchUp();
                removeMatchUp.ShowDialog();
                this.Close();
            }
        }
示例#2
0
 // previous week button
 private void pictureBox5_Click(object sender, EventArgs e)
 {
     if (Program.weekStats != 1)
     {
         Program.weekStats--;
         RemoveMatchUp removeMatchUp = new RemoveMatchUp();
         removeMatchUp.ShowDialog();
         this.Close();
     }
 }