Exemplo n.º 1
0
        void LoadData()
        {
            try
            {
                dtBangDiem = new DataTable();
                dtBangDiem.Clear();
                DataSet ds = dbBD.LayBangDiem();
                dtBangDiem = ds.Tables[0];

                gcBangDiem.DataSource = dtBangDiem;

                dtMonHoc = new DataTable();
                dtMonHoc.Clear();
                DataSet dsMH = dbMH.LayMonHoc();
                dtMonHoc = dsMH.Tables[0];

                lookUpMaMH.Properties.DataSource    = dtMonHoc;
                lookUpMaMH.Properties.DisplayMember = "MaMH";
                lookUpMaMH.Properties.ValueMember   = "MaMH";

                dtSinhVien = new DataTable();
                dtSinhVien.Clear();
                DataSet dsSV = dbSV.LaySinhVien();
                dtSinhVien = dsSV.Tables[0];

                lookUpMaSV.Properties.DataSource    = dtSinhVien;
                lookUpMaSV.Properties.DisplayMember = "MaSV";
                lookUpMaSV.Properties.ValueMember   = "MaSV";

                this.lookUpMaSV.ResetText();
                this.txtTenSV.ResetText();
                this.txtMaLop.ResetText();
                this.lookUpMaMH.ResetText();
                this.txtDiemL1.ResetText();
                this.txtDiemL2.ResetText();
                this.txtDiemQT.ResetText();
                this.txtDiemKT.ResetText();
                this.txtDiemTK.ResetText();
                this.spinHocKy.ResetText();
                this.txtKhoaHoc.ResetText();
                this.chkKetQua.Reset();

                this.btnLuu.Enabled         = false;
                this.btnHuy.Enabled         = false;
                this.layoutControl1.Enabled = false;

                this.btnThem.Enabled    = true;
                this.btnSua.Enabled     = true;
                this.btnXoa.Enabled     = true;
                this.btnSuaDiem.Enabled = true;
                this.btnTroVe.Enabled   = true;
                gvBangDiem_RowCellClick(null, null);
            }
            catch (SqlException)
            {
                XtraMessageBox.Show("Không lấy được nội dung trong table BangDiem. Lỗi rồi!!!");
            }
        }
        void LoadData()
        {
            try
            {
                dtSinhVien = new DataTable();
                dtSinhVien.Clear();

                DataSet ds = dbSinhVien.LaySinhVien();
                dtSinhVien = ds.Tables[0];

                dgvSinhVien.DataSource = dtSinhVien;
                dgvSinhVien.AutoResizeColumns();

                this.txtMaSV.ResetText();
                this.txtHoTen.ResetText();
                this.mskNgaySinh.ResetText();
                this.cboGioiTinh.ResetText();
                this.txtDiaChi.ResetText();
                this.cboMaLop.ResetText();

                this.btnLuu.Enabled   = false;
                this.btnHuyBo.Enabled = false;
                this.grbTTCT.Enabled  = false;

                this.btnThem.Enabled = true;
                this.btnSua.Enabled  = true;
                this.btnXoa.Enabled  = true;

                this.cboMaKhoa.Text      = "ALL";
                this.cboTimMaLop.Text    = "ALL";
                this.cboTimMaLop.Enabled = false;

                this.btnLuu.BackgroundImage   = image_save_off;
                this.btnHuyBo.BackgroundImage = image_cancel_off;

                this.btnThem.BackgroundImage = image_add;
                this.btnSua.BackgroundImage  = image_update;
                this.btnXoa.BackgroundImage  = image_delete;

                this.lblLuu.ForeColor   = Color.Gray;
                this.lblHuyBo.ForeColor = Color.Gray;

                this.lblThem.ForeColor = Color.SteelBlue;
                this.lblSua.ForeColor  = Color.SteelBlue;
                this.lblXoa.ForeColor  = Color.SteelBlue;

                dgvSinhVien_CellClick(null, null);
            }
            catch
            {
                MessageBox.Show("Không lấy được nội dung trong table Sinh Viên. Lỗi rồi!!!");
            }
        }
Exemplo n.º 3
0
        void LoadData()
        {
            try
            {
                dtSinhVien = new DataTable();
                dtSinhVien.Clear();
                DataSet ds = dbSV.LaySinhVien();
                dtSinhVien = ds.Tables[0];

                dtLopSinhVien = new DataTable();
                dtLopSinhVien.Clear();
                DataSet dsKN = dbLSV.LayLopSinhVien();
                dtLopSinhVien = dsKN.Tables[0];

                lookUpMaLop.Properties.DataSource    = dtLopSinhVien;
                lookUpMaLop.Properties.DisplayMember = "MaLop";
                lookUpMaLop.Properties.ValueMember   = "MaLop";

                gcSinhVien.DataSource = dtSinhVien;

                this.txtMaSV.ResetText();
                this.txtTenSV.ResetText();
                this.rdoNam.ResetText();
                this.rdoNu.ResetText();
                this.txtDiaChi.ResetText();
                this.dateNgaySinh.ResetText();
                this.dateNhapHoc.ResetText();
                this.lookUpMaLop.ResetText();
                this.picHinhSV.Image           = null;
                this.picHinhSV.BackgroundImage = null;

                this.btnLuu.Enabled         = false;
                this.btnHuy.Enabled         = false;
                this.layoutControl1.Enabled = false;

                this.btnThem.Enabled  = true;
                this.btnSua.Enabled   = true;
                this.btnXoa.Enabled   = true;
                this.btnTroVe.Enabled = true;
                //gvSinhVien_RowCellClick(null, null);
            }
            catch (SqlException)
            {
                XtraMessageBox.Show("Không lấy được nội dung trong table THANHPHO. Lỗi rồi!!!");
            }
        }