Beispiel #1
0
        //LOAD after edit
        public void load()
        {
            sg.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++)
                {
                    if (ListContest.ElementAt(i).IDContest == Convert.ToInt32(lbl_IDContest.Text) )
                    {
                        lbl_CompetitionName.Text = ListContest.ElementAt(i).Competition.NameCompetition;
                        lbl_RoundName.Text = ListContest.ElementAt(i).Round.NameRound;
                        lbl_ContestName.Text = ListContest.ElementAt(i).NameContest;
                        lbl_IDContest.Text = ListContest.ElementAt(i).IDContest.ToString();
                        //lbl_Number.Text = (i + 1).ToString();
                        if (ListContest.ElementAt(i).NumberChallenge > 0)
                        {
                            lbl_Status.Text = "Hoàn tất";
                            lbl_Status.ForeColor = Color.LightGreen;
                        }
                        else
                        {
                            lbl_Status.Text = "Chưa hoàn Tất";
                            lbl_Status.ForeColor = Color.Red;
                        }
                    }
                }
            }
        }
Beispiel #2
0
        //Load
        public void LoadContest()
        {
            ContestBL ContestBL = new ContestBL();
            List<Contest> ListContest;
            ListContest = ContestBL.GetAllSetup();

            if (ListContest != null)
            {
                for (int i = 0; i < ListContest.Count; i++)
                {
                    if (ListContest.ElementAt(i).IDContest == Convert.ToInt32(lbl_IDContest.Text))
                    {
                        lbl_CompetitionName.Text = ListContest.ElementAt(i).Competition.NameCompetition;
                        lbl_RoundName.Text = ListContest.ElementAt(i).Round.NameRound;
                        lbl_ContestName.Text = ListContest.ElementAt(i).NameContest;
                        lbl_IDContest.Text = ListContest.ElementAt(i).IDContest.ToString();
                        //lbl_Number.Text = (i + 1).ToString();
                        if (ListContest.ElementAt(i).Status == true)
                        {
                            lbl_Status.Text = "Hoàn tất";
                            lbl_Status.ForeColor = Color.Red;
                            lbl_EndContest.Text = "0";
                            lbl_Result.Visible = true;
                        }
                        else
                        {
                            lbl_Status.Text = "Chưa hoàn Tất";
                            lbl_Status.ForeColor = Color.Red;
                            lbl_EndContest.Text = "1";
                            lbl_Result.Visible = false;
                        }
                    }
                }
            }
        }
        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);
                }
            }
        }
        public void load()
        {
            flp_StartGame.Controls.Clear();
            ContestBL ContestBL = new ContestBL();
            List<Contest> ListContest;
            ListContest = ContestBL.GetAllSetup();

            if (ListContest != null)
            {
                for (int i = 0; i < ListContest.Count; i++)
                {
                    if (ListContest.ElementAt(i).ChallengceScore > 0)
                    {
                        Game game = new Game();
                        TagGame++;
                        game.Tag = TagGame;
                        game.ID_Game = TagGame;
                        //game.onRun += game_onRun;
                        game.onClick += game_onClick;
                        //game.Enabled = false;

                        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();
                        if (ListContest.ElementAt(i).Status == true)
                        {
                            game.lbl_Status.Text = "Hoàn Tất";
                            game.lbl_Status.ForeColor = Color.Red;
                            game.lbl_EndContest.Text = "0";
                            game.lbl_Result.Visible = true;
                        }
                        else
                        {
                            game.lbl_Status.Text = "Chưa Hoàn Tất";
                            game.lbl_Status.ForeColor = Color.Red;
                            game.lbl_EndContest.Text = "1";
                            game.lbl_Result.Visible = false ;
                        }
                        flp_StartGame.Controls.Add(game);
                    }
                }
            }
        }
Beispiel #5
0
        //Load all Setup
        public void LoadAll()
        {
            Setting_Game sg = new Setting_Game();
            sg.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();
                    lbl_CompetitionName.Text = ListContest.ElementAt(i).Competition.NameCompetition;
                    lbl_RoundName.Text = ListContest.ElementAt(i).Round.NameRound;
                    lbl_ContestName.Text = ListContest.ElementAt(i).NameContest;
                    lbl_IDContest.Text = ListContest.ElementAt(i).IDContest.ToString();
                    //lbl_Number.Text = (i + 1).ToString();
                    if (ListContest.ElementAt(i).NumberChallenge > 0)
                    {
                        lbl_Status.Text = "Hoàn tất";
                        lbl_Status.ForeColor = Color.LightGreen;
                    }
                    else
                    {
                        lbl_Status.Text = "Chưa hoàn Tất";
                        lbl_Status.ForeColor = Color.Red;
                    }
                    sg.flp_Game.Controls.Add(this);
                }
            }
        }
Beispiel #6
0
        private void deleteSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Bạn muốn xóa cuộc thi này không?", "Xóa Thiết Đặt", MessageBoxButtons.YesNo);
            if (dialogResult == DialogResult.Yes)
            {
                Contest Contest = new Contest();
                Phase Phase = new Phase();
                Player Player = new Player();
                Record Record = new Record();

                ContestBL ContestBL = new ContestBL();
                PhaseBL PhaseBl = new PhaseBL();
                PlayerBL PlayerBL = new PlayerBL();
                PhaseQuestionBL PhaseQuestionBL = new PhaseQuestionBL();
                RecordBL RecordBL = new RecordBL();

                Contest.IDContest = Convert.ToInt32(lbl_IDContest.Text);
                Phase.IDContest = Convert.ToInt32(lbl_IDContest.Text);
                Player.IDContest = Convert.ToInt32(lbl_IDContest.Text);
                Record.IDContest = Convert.ToInt32(lbl_IDContest.Text);

                RecordBL.DeleteRecordByIDContest(Record);
                PhaseQuestionBL.DeletePhaseQuestionbyIDContest(Phase);
                PlayerBL.DeletePlayerbyIDContest(Player);
                PhaseBl.DeletePhasebyIDContest(Phase);
                ContestBL.DeleteContestbyID(Contest);
                LoadAll();

                EventHandler delete = onDelete;

                if (delete != null)
                {
                    MyEventArgs args = new MyEventArgs();
                    args.IDNewGame = iD_NewGame;
                    delete(this, args);
                }
            }
        }