Example #1
0
        public static DANGKIBODE GetDKBDByMaLop_MaMonHoc(string maLop, string maMonHoc)
        {
            if (Program.KetNoi() == 0)
            {
                return(null);
            }
            SqlDataReader myReader;

            myReader = Program.ExecSqlDataReader(string.Format(KeyConst.Lenh.GetDKBDByMaLop_MaMonHoc, maLop.Trim(), maMonHoc.Trim()));
            if (myReader == null)
            {
                return(null);
            }
            myReader.Read();
            DANGKIBODE dk = new DANGKIBODE
            {
                MALOP       = myReader.GetString(0),
                MAMH        = myReader.GetString(1),
                MAGV        = myReader.GetString(2),
                NGAYTHI     = myReader.GetDateTime(3),
                SOCAUHOITHI = myReader.GetInt32(4),
                THOIGIAN    = myReader.GetInt32(5),
                TIETBATDAU  = myReader.GetInt32(6),
                MABODE      = myReader.GetInt32(7),
                NGAYDK      = myReader.GetDateTime(8)
            };

            myReader.Close();
            return(dk);
        }
        private void dANGKIBODEGridControl_MouseClick(object sender, MouseEventArgs e)
        {
            DKBD = DangKyBoDe.GetDKBDByMaLop_MaMonHoc(((DataRowView)dANGKIBODEBindingSource.Current)[0].ToString(),
                                                      ((DataRowView)dANGKIBODEBindingSource.Current)[1].ToString());
            LOP       lop       = Lop.GetLopByMaLop(DKBD.MALOP);
            KHOA      khoa      = Khoa.GetKhoaByMaKhoa(lop.MAKH);
            string    tenMonHoc = MonHoc.GetTenMonHocByMaMH(DKBD.MAMH);
            GIANGVIEN gv        = GiangVien.GetGiangVienByMa(DKBD.MAGV);

            txtHoTenGV.Text   = gv.HO + " " + gv.TEN;
            txtMAGV.Text      = gv.MAGV;
            txtTenKhoa.Text   = khoa.TENKH;
            txtTenMonHoc.Text = tenMonHoc;
        }