Ejemplo n.º 1
0
        public DataTable GetAllsinhvien(khoa khoa)
        {
            string        sqlSelectSinhVien = @"SELECT  sv.id ,
                                                Masv ,
                                                sv.Tensv ,
                                                k.Tenkhoa ,
                                                lp.Tenlop ,
                                                ( CASE sv.Gioitinh
                                                    WHEN 1 THEN N'Nam'
                                                    ELSE N'Nữ'
                                                    END ) AS Gioitinh ,
                                                sv.Diachi,sv.Image
                                        FROM    dbo.SinhVien sv ,
                                                dbo.Lop lp ,
                                                dbo.Khoa k
                                        WHERE   sv.Malop = lp.Malop
                                                AND lp.Makhoa = k.Makhoa AND k.Makhoa='" + khoa.MAKHOA + "'";
            SqlConnection con = dc.getConnection();

            adt = new SqlDataAdapter(sqlSelectSinhVien, con);
            DataTable dt = new DataTable();

            adt.Fill(dt);
            return(dt);
        }
Ejemplo n.º 2
0
        public DataTable getAmin()
        {
            string        selectAdmin = " SELECT * FROM dbo.Admin WHERE Tendangnhap='" + admin.TENDANGNHAP + "'AND Password='******'";
            SqlConnection con         = dc.getConnection();

            adt = new SqlDataAdapter(selectAdmin, con);
            con.Open();
            DataTable dt = new DataTable();

            adt.Fill(dt);
            con.Close();
            return(dt);
        }
Ejemplo n.º 3
0
        public DataTable getAllKhoa()
        {
            string        sqlGetAllKhoa = "SELECT Makhoa,Tenkhoa FROM Khoa";
            SqlConnection con           = dc.getConnection();

            adt = new SqlDataAdapter(sqlGetAllKhoa, con);
            con.Open();
            DataTable dt = new DataTable();

            adt.Fill(dt);
            con.Close();
            return(dt);
        }
Ejemplo n.º 4
0
        public DataTable getAllLoaiMH()
        {
            string        sqlselect = "SELECT Tenloaimh FROM Loaimonhoc";
            SqlConnection con       = dc.getConnection();

            adt = new SqlDataAdapter(sqlselect, con);
            DataTable dt = new DataTable();

            adt.Fill(dt);
            return(dt);
        }
Ejemplo n.º 5
0
        public DataTable getAllLop()
        {
            string        sqlGetAllLop = "SELECT lp.id,lp.Malop,lp.Tenlop ,k.Tenkhoa FROM dbo.Lop lp,dbo.Khoa k WHERE lp.Makhoa=k.Makhoa";
            SqlConnection con          = dc.getConnection();

            adt = new SqlDataAdapter(sqlGetAllLop, con);
            con.Open();
            DataTable dt = new DataTable();

            adt.Fill(dt);
            con.Close();
            return(dt);
        }
Ejemplo n.º 6
0
        public DataTable laytatcalop(string khoa)
        {
            string        sqlLaytatcalop = "SELECT Malop ,Tenlop FROM Lop WHERE Makhoa ='" + khoa + "'";
            SqlConnection con            = dc.getConnection();

            adt = new SqlDataAdapter(sqlLaytatcalop, con);
            con.Open();
            DataTable dt = new DataTable();

            adt.Fill(dt);
            con.Close();
            return(dt);
        }