예제 #1
0
        public Option(Form x)
        {
            InitializeComponent();
            parent = x;

            RuleBUS        ruleBus = new RuleBUS();
            QuyDinhTroChoi quyDinh = ruleBus.GetGuideLine();

            labelGuide.Text        = quyDinh.Rule;
            textBoxRound.Text      = quyDinh.NumberRound.ToString();
            textBoxTimeAnswer.Text = quyDinh.TimeForAnswer.ToString();
            DoubleBuffered         = true;
        }
예제 #2
0
        public void SetThongSo(QuyDinhTroChoi qd)
        {
            cnn.Open();
            SqlCommand com = new SqlCommand("update ThamSo set ThamSo.GiaTri = @round where ThamSo.ID = @id", cnn);

            com.CommandType = CommandType.Text;
            com.Parameters.AddWithValue("@id", "svong");
            com.Parameters.AddWithValue("@round", qd.NumberRound);
            com.ExecuteNonQuery();

            com             = new SqlCommand("update ThamSo set ThamSo.GiaTri = @time where ThamSo.ID = @id", cnn);
            com.CommandType = CommandType.Text;
            com.Parameters.AddWithValue("@id", "tgcho");
            com.Parameters.AddWithValue("@time", qd.TimeForAnswer);
            com.ExecuteNonQuery();

            cnn.Close();
        }
예제 #3
0
        private void rectangleShapeSave_MouseClick(object sender, MouseEventArgs e)
        {
            soundButton.Play();
            Regex reg = new Regex("^[0-9]+$", RegexOptions.IgnoreCase);

            if (!reg.IsMatch(textBoxRound.Text) || !reg.IsMatch(textBoxTimeAnswer.Text))
            {
                MessageBox.Show("Hãy nhập vào giá trị là số!");
            }
            else
            {
                QuyDinhTroChoi qd = new QuyDinhTroChoi();
                qd.NumberRound   = Int32.Parse(textBoxRound.Text);
                qd.TimeForAnswer = Int32.Parse(textBoxTimeAnswer.Text);
                RuleBUS ruleBus = new RuleBUS();
                ruleBus.SetThongSo(qd);


                textBoxRound.Enabled      = false;
                textBoxTimeAnswer.Enabled = false;
                MessageBox.Show("Lưu Thành Công!");
            }
        }
예제 #4
0
        public Stage(Playerlist l, Form x, WindowsMediaPlayer y)
        {
            InitializeComponent();
            QLTD.SetPlayerlist(l);
            Numplayer      = QLTD.PlayerList().ListPLayer.Count;
            parent         = x;
            hinhChiecNon   = ChiecNonBitmap;
            DoubleBuffered = true;
            wplayer        = y;

            TopicBUS topic = new TopicBUS();

            QLQN.GetListPoint();
            List <ChuDe> list = topic.GetAllTopics();

            for (int i = 0; i < list.Count; i++)
            {
                comboBoxTopic.Items.Add(list[i].NameTopic);
            }

            RuleBUS data = new RuleBUS();

            qd            = data.GetGuideLine();
            TimeCountDown = qd.TimeForAnswer;

            timer1.Interval           = 500;
            timer1.Tick              += Timer1_Tick;
            timerWin.Interval         = 500;
            timerWin.Tick            += TimerWin_Tick;
            timerFinishRound.Interval = 500;
            timerFinishRound.Tick    += TimerFinishRound_Tick;
            timerCountDown.Interval   = 1000;
            timerCountDown.Tick      += TimerCountDown_Tick;
            labelRound.Text           = "Vòng " + Round;
            labelCountDown.Text       = TimeCountDown.ToString();
            // qd.NumberRound = 1;
        }
예제 #5
0
 public void SetThongSo(QuyDinhTroChoi qd)
 {
     data.SetThongSo(qd);
 }