コード例 #1
0
        public void load()
        {
            flp_Game.Controls.Clear();
            ContestBL ContestBL = new ContestBL();
            List<Contest> ListContest;
            ListContest = ContestBL.GetAllSetup();

            if (ListContest != null)
            {
                for (int i = 0; i < ListContest.Count; i++)
                {
                    New_Game game = new New_Game();
                    TagGame++;
                    game.Tag = TagGame;
                    game.ID_NewGame = TagGame;
                    game.onDelete += AddTeam_onDelete;

                    game.lbl_CompetitionName.Text = ListContest.ElementAt(i).Competition.NameCompetition;
                    game.lbl_RoundName.Text = ListContest.ElementAt(i).Round.NameRound;
                    game.lbl_ContestName.Text = ListContest.ElementAt(i).NameContest;
                    game.lbl_IDContest.Text = ListContest.ElementAt(i).IDContest.ToString();
                    //game.lbl_Number.Text = (i+1).ToString();
                    if (ListContest.ElementAt(i).NumberChallenge >0)
                    {
                        game.lbl_Status.Text = "Hoàn tất";
                        game.lbl_Status.ForeColor = Color.LightGreen;
                        if (ListContest.ElementAt(i).Run == true)
                        {
                            game.Run = true;
                        }
                        else
                        {
                            game.Run = false;
                        }
                    }
                    else
                    {
                        game.lbl_Status.Text = "Chưa hoàn Tất";
                        game.lbl_Status.ForeColor = Color.Red;
                    }
                    flp_Game.Controls.Add(game);
                }
            }
        }
コード例 #2
0
 private void lbl_AddGame_Click(object sender, EventArgs e)
 {
     Add_New_Game ang = new Add_New_Game();
     New_Game game = new New_Game();
     DialogResult result = ang.ShowDialog();
     if (result== DialogResult.OK)
     {
         load();
     }
     else
     {
         load();
     }
 }