Exemplo n.º 1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            new StartForm().ShowDialog();
            if (DBFileName != null)
            {
                DB = SqliteWrapper.Open(DBFileName);
                Tuple<DateTime, string> tuple = DB.Created();
                Manager = new DBManager(DB);
                lCreatedDateTime.Text = tuple.Item1.ToString();
                lCreatedMessage.Text = tuple.Item2;
                refresh_party();
                refresh_rounds_info();

                //
                // Load round more than two
                //
                var max_round = Manager.GetMaxRound();
                for (int i = 2; i <= max_round; i++)
                {
                    var nt = CreateTabPage();

                    var control = new RoundControl(i) { Dock = DockStyle.Fill };
                    nt.Controls.Add(control);
                    rounds.Add(i, control);
                }
            }
        }
Exemplo n.º 2
0
        private void BNewRound_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("새로운 라운드를 생성하면 이전 라운드를 기반으로 새로운 라운드를 생성하지만, 더이상 이전 라운드의 데이터가 새로운 라운드에 영향을 미치지 않습니다. 계속할까요?", "Swiss Tournament System", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                var max_round = Manager.GetMaxRound();
                var target_round = max_round + 1;

                var nt = CreateTabPage();

                // 이전 라운드 결과로부터 새로운 라운드 생성
                var tie_info = GetTieTableInfo(max_round);
                for (int i = 0; i < tie_info.Count / 2; i++)
                {
                    Manager.InsertHistory(tie_info[i].Id, tie_info[tie_info.Count - i - 1].Id, Status.None, target_round, "");
                }
                // 부전승 시킬놈 선정
                if (tie_info.Count % 2 == 1)
                {
                    var bjs = tie_info[tie_info.Count / 2];
                    Manager.InsertHistory(bjs.Id, -1, Status.ByeWin, target_round, "");
                }

                RoundControl control = new RoundControl(target_round)
                {
                    Dock = DockStyle.Fill
                };
                nt.Controls.Add(control);
                rounds.Add(tabControl2.TabPages.Count - 1, control);
                refresh_rounds_info();
            }
        }
Exemplo n.º 3
0
 public MainForm()
 {
     InitializeComponent();
     RoundControl control = new RoundControl(1) { Dock = DockStyle.Fill };
     tabPage4.Controls.Add(control);
     rounds.Add(1, control);
     Instance = this;
 }