示例#1
0
        private void KhoiTaoMuaGiai_FormClosed(object sender, FormClosedEventArgs e)
        {
            FirstScreen form = new FirstScreen();

            this.Hide();
            form.ShowDialog();
        }
示例#2
0
        private void PictureBox7_Click(object sender, EventArgs e)
        {
            FirstScreen form = new FirstScreen();

            this.Hide();
            form.ShowDialog();
        }
示例#3
0
        private void KhoiTaoMuaGiaiButton_Click(object sender, EventArgs e)
        {
            //call data access
            try
            {
                MUAGIAI muagiai = new MUAGIAI()
                {
                    TenMuaGiai = tenMuaGiaTextBox.Text,
                    TrangThai  = 0,
                };
                Database.MuaGiai_DAO.createMuaGiai(muagiai);
                string   new_MaMuaGiai = Database.MuaGiai_DAO.queryMaMuaGiai(muagiai);
                DIEUKIEN dk            = new DIEUKIEN()
                {
                    MaMuaGiai              = new_MaMuaGiai,
                    SoCauThuToiThieu       = 11,
                    SoCauThuToiDa          = 40,
                    TuoiToiDa              = 40,
                    TuoiToiThieu           = 18,
                    SoLanThayNguoiToiDa    = 3,
                    SoCauThuNuocNgoaiToiDa = 3,
                    DiemSoHoa              = 1,
                    DiemSoThang            = 3,
                    DiemSoThua             = 0
                };
                Database.DieuKien_DAO.createDIEUKIEN(dk);
                THUTUUUTIEN thutu = new THUTUUUTIEN()
                {
                    ChiSoUuTien   = 1,
                    MaMuaGiai     = new_MaMuaGiai,
                    TenLoaiUuTien = "Điểm",
                };
                Database.ThuTuUuTien_DAO.createThuTuUuTien(thutu);
                THUTUUUTIEN thutu2 = new THUTUUUTIEN()
                {
                    ChiSoUuTien   = 2,
                    MaMuaGiai     = new_MaMuaGiai,
                    TenLoaiUuTien = "Hiệu Số",
                };
                Database.ThuTuUuTien_DAO.createThuTuUuTien(thutu2);
                THUTUUUTIEN thutu3 = new THUTUUUTIEN()
                {
                    ChiSoUuTien   = 3,
                    MaMuaGiai     = new_MaMuaGiai,
                    TenLoaiUuTien = "Số Bàn Sân Khách",
                };
                Database.ThuTuUuTien_DAO.createThuTuUuTien(thutu3);
                THUTUUUTIEN thutu4 = new THUTUUUTIEN()
                {
                    ChiSoUuTien   = 4,
                    MaMuaGiai     = new_MaMuaGiai,
                    TenLoaiUuTien = "Kết Quả Đối Đầu",
                };
                Database.ThuTuUuTien_DAO.createThuTuUuTien(thutu4);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi xảy ra");
            }

            // Kiểm tra điền đầy đủ thông tin chưa? Nếu đầy đủ thì sẽ tiến thẳng tới màn hình
            if (ValidateChildren(ValidationConstraints.Enabled))
            {
                FirstScreen form = new FirstScreen();
                this.Hide();
                form.ShowDialog();
            }
        }