Esempio n. 1
0
        void NhanDuLieu()
        {
            dsLop.Clear();
            string strSelect = "Select * From Lop";

            Mypublic.OpenData(strSelect, dsLop, "Lop");
            dgvLop.DataSource = dsLop;
            dgvLop.DataMember = "Lop";
        }
Esempio n. 2
0
        private void frmLop_Load(object sender, EventArgs e)
        {
            string strSelect = "Select * From Lop";

            Mypublic.OpenData(strSelect, dsLop, "Lop", daLop);
            bsLop.DataSource     = dsLop;
            bsLop.DataMember     = "Lop";
            cboLop.DisplayMember = "TenLop";
            cboLop.ValueMember   = "MSLop";
            txtMSLop.MaxLength   = 8;
            txtTenLop.MaxLength  = 40;
            txtVitri.ReadOnly    = true;
            txtVitri.BackColor   = Color.White;
            GanDuLieu();
            DieuKhienKhiBinhThuong();
        }
Esempio n. 3
0
        private void frmSinhVienTheoLop_Load(object sender, EventArgs e)
        {
            string strSelect = "Select MSLop, TenLop From Lop";

            Mypublic.OpenData(strSelect, dsLop, "Lop");
            cboLop.DataSource    = dsLop.Tables["Lop"];
            cboLop.DisplayMember = "TenLop";
            cboLop.ValueMember   = "MSLop";
            dsQuyenSD.Tables.Add("DSQuyenSD");
            dsQuyenSD.Tables["DSQuyenSD"].Columns.Add("QuyenSD");
            dsQuyenSD.Tables["DSQuyenSD"].Rows.Add("User");
            dsQuyenSD.Tables["DSQuyenSD"].Rows.Add("AdminLop");
            dsQuyenSD.Tables["DSQuyenSD"].Rows.Add("AdminKhoa");
            cboQuyenSD.DataSource    = dsQuyenSD;
            cboQuyenSD.DisplayMember = "DSQuyenSD.QuyenSD";
            cboQuyenSD.ValueMember   = "DSQuyenSD.QuyenSD";
            txtHoLot.MaxLength       = 30;
            txtTen.MaxLength         = 30;
            txtMSSV.MaxLength        = 8;
            NhanDuLieu();
            dvSinhVien.Table                  = dsSinhVien.Tables["SinhVien"];
            dvSinhVien.RowFilter              = "MSLop like'" + cboLop.SelectedValue + "'";
            dgvSinhVien.DataSource            = dvSinhVien;
            dgvSinhVien.Width                 = 790;
            dgvSinhVien.AllowUserToAddRows    = false;
            dgvSinhVien.AllowUserToDeleteRows = false;
            dgvSinhVien.Columns[0].Width      = 85;
            dgvSinhVien.Columns[0].HeaderText = "Mã số";
            dgvSinhVien.Columns[1].Width      = 140;
            dgvSinhVien.Columns[1].HeaderText = "Họ lót";
            dgvSinhVien.Columns[2].Width      = 60;
            dgvSinhVien.Columns[2].HeaderText = "Tên";
            dgvSinhVien.Columns[3].Width      = 50;
            dgvSinhVien.Columns[3].HeaderText = "Phái";
            dgvSinhVien.Columns[4].Width      = 100;
            dgvSinhVien.Columns[4].HeaderText = "Ngày sinh";
            dgvSinhVien.Columns[5].Width      = 90;
            dgvSinhVien.Columns[5].HeaderText = "MS Lớp";
            dgvSinhVien.Columns[6].Width      = 100;
            dgvSinhVien.Columns[6].HeaderText = "Mật khẩu";
            dgvSinhVien.Columns[7].Width      = 100;
            dgvSinhVien.Columns[7].HeaderText = "Quyền SD";
            dgvSinhVien.EditMode              = DataGridViewEditMode.EditProgrammatically;
            dgvSinhVien.CellFormatting       += new DataGridViewCellFormattingEventHandler(this.dgvSinhVien_CellFormatting);
            GanDuLieu();
            DieuKhienKhiBinhThuong();
        }
Esempio n. 4
0
        void NhanDuLieu()
        {
            string strSelect = "Select * From SinhVien";

            Mypublic.OpenData(strSelect, dsSinhVien, "SinhVien");
        }