Ejemplo n.º 1
0
        public void LoadSelect()
        {
            GiangVienBUS _objgvbus = new GiangVienBUS();
            DataTable    _dtgv     = _objgvbus.GetMaTen();

            cbGiangVien.DataSource    = _dtgv;
            cbGiangVien.ValueMember   = "MaGV";
            cbGiangVien.DisplayMember = "TenGV";
            cbGiangVien.SelectedIndex = -1;

            KhoaHocBUS _objkhoahocbus = new KhoaHocBUS();
            DataTable  _dtkh          = _objkhoahocbus.GetMaTenKhoaHoc();

            cbKhoaHoc.DataSource    = _dtkh;
            cbKhoaHoc.ValueMember   = "MaKhoaHoc";
            cbKhoaHoc.DisplayMember = "TenKhoaHoc";
            PhongHocBUS _objphonghocbus = new PhongHocBUS();
            DataTable   _dtph           = _objphonghocbus.GetMaTen();

            cbPhongHoc.DataSource    = _dtph;
            cbPhongHoc.ValueMember   = "MaPhong";
            cbPhongHoc.DisplayMember = "TenPhong";
            cbPhongHoc.SelectedIndex = -1;

            CaHocBUS  _objcahocbus = new CaHocBUS();
            DataTable _dtch        = _objcahocbus.GetMaTen();

            cbCaHoc.DataSource    = _dtch;
            cbCaHoc.ValueMember   = "MaCa";
            cbCaHoc.DisplayMember = "TenCa";
            cbCaHoc.Text          = "";

            NgayHocBUS _objngayhocbus = new NgayHocBUS();
            DataTable  _dtngay        = _objngayhocbus.GetAllNgayHoc();

            cbNgayHoc.DataSource    = _dtngay;
            cbNgayHoc.ValueMember   = "MaNgay";
            cbNgayHoc.DisplayMember = "DanhSachNgay";
            cbNgayHoc.SelectedIndex = -1;

            cbChuongTrinhHoc.SelectedIndex = -1;
            txtGioBatDau.Text  = "";
            txtGioKetThuc.Text = "";
        }
Ejemplo n.º 2
0
        protected void LoadData()
        {
            GiangVienBUS _objgvbus = new GiangVienBUS();
            DataTable    _dtgv     = _objgvbus.GetMaTen();

            cbGiangVien.DataSource    = _dtgv;
            cbGiangVien.ValueMember   = "MaGV";
            cbGiangVien.DisplayMember = "TenGV";
            cbGiangVien.SelectedIndex = -1;

            KhoaHocBUS _objkhoahocbus = new KhoaHocBUS();
            DataTable  _dtkh          = _objkhoahocbus.GetMaTenKhoaHoc();

            cbKhoaHoc.DataSource    = _dtkh;
            cbKhoaHoc.ValueMember   = "MaKhoaHoc";
            cbKhoaHoc.DisplayMember = "TenKhoaHoc";

            PhongHocBUS _objphonghocbus = new PhongHocBUS();
            DataTable   _dtph           = _objphonghocbus.GetMaTen();

            cbPhongHoc.DataSource    = _dtph;
            cbPhongHoc.ValueMember   = "MaPhong";
            cbPhongHoc.DisplayMember = "TenPhong";
            cbPhongHoc.SelectedIndex = -1;

            CaHocBUS  _objcahocbus = new CaHocBUS();
            DataTable _dtch        = _objcahocbus.GetMaTen();

            cbCaHoc.DataSource    = _dtch;
            cbCaHoc.ValueMember   = "MaCa";
            cbCaHoc.DisplayMember = "TenCa";
            cbCaHoc.Text          = "";


            NgayHocBUS _objngayhocbus = new NgayHocBUS();
            DataTable  _dtngay        = _objngayhocbus.GetAllNgayHoc();

            cbNgayHoc.DataSource    = _dtngay;
            cbNgayHoc.ValueMember   = "MaNgay";
            cbNgayHoc.DisplayMember = "DanhSachNgay";
            cbNgayHoc.SelectedIndex = -1;

            cbChuongTrinhHoc.SelectedIndex = -1;
            txtGioBatDau.Text                = "";
            txtGioKetThuc.Text               = "";
            _dtlophoc                        = _objlopbus.GetAll_CT();
            dataGridViewX2.DataSource        = _dtlophoc;
            dataGridViewX2.RowHeadersVisible = true;
            _dtlophoc.Columns.Add("STT");
            for (int i = 0; i < _dtlophoc.Rows.Count; i++)
            {
                _dtlophoc.Rows[i]["STT"] = i + 1;
            }
            dataGridViewX2.Columns["STT"].DisplayIndex             = 0;
            dataGridViewX2.Columns["MaLop"].HeaderText             = "Mã Lớp";
            dataGridViewX2.Columns["TenLop"].HeaderText            = "Tên Lớp";
            dataGridViewX2.Columns["TenKhoaHoc"].HeaderText        = "Tên Khóa Học";
            dataGridViewX2.Columns["TenChuongTrinhHoc"].HeaderText = "Chương Trình Học";
            dataGridViewX2.Columns["NgayBatDau"].HeaderText        = "Ngày Bắt Đầu";
            dataGridViewX2.Columns["NgayKetThuc"].HeaderText       = "Ngày Kết Thúc";
            dataGridViewX2.Columns["GioBatDau"].HeaderText         = "Giờ Bắt Đầu";
            dataGridViewX2.Columns["GioKetThuc"].HeaderText        = "Giờ Kết Thúc";
            dataGridViewX2.Columns["DanhSachNgay"].HeaderText      = "Ngày Học";
            dataGridViewX2.Columns["TenGV"].HeaderText             = "Tên Giảng Viên";
            dataGridViewX2.Columns["TenPhong"].HeaderText          = "Phòng Học";
            dataGridViewX2.ClearSelection();
        }