예제 #1
0
        public static int KiemTraTaiKhoan(string user, string password)
        {
            Data.m_strLogin    = user;
            Data.m_strPassword = password;
            if (DataProvider.ConnectDatabase() == false)
            {
                return(0);
            }
            Data.m_strLoginDN    = Data.m_strLogin;
            Data.m_strPasswordDN = Data.m_strPassword;
            string        str = "EXEC SP_DANGNHAP'" + Data.m_strLogin + "'";
            SqlDataReader myReader;

            myReader = DataProvider.ExecSQLDataReader(str);
            if (myReader == null)
            {
                return(0);
            }
            myReader.Read();
            Data.m_strMaGV = myReader.GetString(0);
            if (Convert.IsDBNull(Data.m_strMaGV))
            {
                return(1);//Tài khoản ko có quyền truy cập
            }
            else
            {
                Data.m_strHoten = myReader.GetString(1);
                Data.m_strGroup = myReader.GetString(2);
                Data.m_objConnection.Close();
                return(2);//Đăng nhập thành công
            }
        }
예제 #2
0
 public static SqlDataReader GetTenLop(string x_strMaLop)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT TENLOP FROM LOP WHERE MALOP = '{0}'", x_strMaLop)));
     }
     return(null);
 }
예제 #3
0
 public static SqlDataReader GetHoTen(string x_strMaSV)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT HOTEN = HO + ' ' + TEN FROM SINHVIEN WHERE MASV = '{0}'", x_strMaSV)));
     }
     return(null);
 }
예제 #4
0
 public static SqlDataReader GetMaLop(string x_strMaSV)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT MALOP FROM SINHVIEN WHERE MASV = '{0}'", x_strMaSV)));
     }
     return(null);
 }
예제 #5
0
 public static SqlDataReader LoadPhieuDiem(string x_strMaSV)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_PhieuDiem '{0}'", x_strMaSV)));
     }
     return(null);
 }
예제 #6
0
 public static SqlDataReader LoadHocPhi(string x_strMaSinhVien)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_LoadHocPhi '{0}'", x_strMaSinhVien)));
     }
     return(null);
 }
예제 #7
0
 public static SqlDataReader LoadSinhVien()
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT MASV FROM SINHVIEN")));
     }
     return(null);
 }
예제 #8
0
 public static SqlDataReader LoadBangDiemMonHoc(string x_strMaLop, string x_strMaMH, int x_nLanThi)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_BangDiemMonHoc '{0}', '{1}', {2}", x_strMaLop, x_strMaMH, x_nLanThi)));
     }
     return(null);
 }
예제 #9
0
 public static SqlDataReader LoadDanhSachThiHetMon(string x_strMaLop, string x_strMaMonHoc, int x_nLanThi)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_DanhSachThiHetMon '{0}', '{1}', {2}", x_strMaLop, x_strMaMonHoc, x_nLanThi)));
     }
     return(null);
 }
예제 #10
0
 public static SqlDataReader GetTenMonHoc(string x_strMaMH)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT TENMH FROM MONHOC WHERE MAMH = '{0}'", x_strMaMH)));
     }
     return(null);
 }
예제 #11
0
 public static SqlDataReader LoadMonHoc()
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT MAMH, TENMH FROM MONHOC")));
     }
     return(null);
 }
예제 #12
0
 public static SqlDataReader LoadLop()
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("SELECT MALOP, TENLOP FROM LOP")));
     }
     return(null);
 }
예제 #13
0
 public static bool DeleteMonHoc(string x_strMaMonHoc)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLQuery(string.Format("DELETE FROM MONHOC WHERE MAMH = '{0}'", x_strMaMonHoc)));
     }
     return(false);
 }
예제 #14
0
 public static bool ChangeServer()
 {
     if (DataProvider.ConnectDatabase())
     {
         return(true);
     }
     return(false);
 }
예제 #15
0
 public static bool InsertMonHoc(string x_strMaMonHoc, string x_strTenMonHoc)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLQuery(string.Format("INSERT INTO MONHOC(MAMH, TENMH) VALUES('{0}', N'{1}')", x_strMaMonHoc, x_strTenMonHoc)));
     }
     return(false);
 }
예제 #16
0
 public static bool UpdateMonHoc(string x_strMaMonHoc, string x_strTenMonHoc)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLQuery(string.Format("UPDATE MONHOC SET TENMH = N'{0}' WHERE MAMH = '{1}'", x_strTenMonHoc, x_strMaMonHoc)));
     }
     return(false);
 }
예제 #17
0
 public static SqlDataReader LoadLanThi(string x_strMaMonHoc, string x_strMaLop)
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_SoLanThi '{0}', '{1}'", x_strMaMonHoc, x_strMaLop)));
     }
     return(null);
 }
예제 #18
0
 public static DataTable LoadMonHoc()
 {
     if (DataProvider.ConnectDatabase())
     {
         return(DataProvider.ExecSQLQueryDataTable("SELECT * FROM MONHOC"));
     }
     return(null);
 }
예제 #19
0
 public static DataTable LoadLop()
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MALOP,TENLOP,MAKH from LOP";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }
예제 #20
0
 public static bool DeleteLop(string malop)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "delete from LOP where MALOP = '" + malop + "'";
         return(DataProvider.ExecSQLQuery(str));
     }
     return(false);
 }
예제 #21
0
 public static DataTable KiemTraDiemSinhVien(string masv)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MASV from DIEM where MASV = '" + masv + "'";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }
예제 #22
0
 public static SqlDataReader KiemTraMaSinhVien(string masv)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "EXEC SP_KiemTraMaSinhVien '" + masv + "'";
         return(DataProvider.ExecSQLDataReader(str));
     }
     return(null);
 }
예제 #23
0
 public static DataTable LoadGiangVien()
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MAGV, HO, TEN, MAKH from GIANGVIEN";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }
예제 #24
0
 public static SqlDataReader KiemTraTenLop(string tenlop)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "EXEC SP_KiemTraTenLop N'" + tenlop + "'";
         return(DataProvider.ExecSQLDataReader(str));
     }
     return(null);
 }
예제 #25
0
 public static DataTable TimKiemLop(string malop)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MALOP,TENLOP,MAKH from LOP where MALOP = '" + malop + "'";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }
예제 #26
0
 public static bool UpdateLop(LopDTO lop)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "update LOP set TENLOP = N'" + lop.TENLOP + "', MAKH = '" + lop.MAKH + "' where MALOP = '" + lop.MALOP + "'";
         return(DataProvider.ExecSQLQuery(str));
     }
     return(false);
 }
예제 #27
0
        //============================= Lấy danh sách mã lớp tạo report học phí================================

        public static DataTable LoadMaLop()
        {
            if (DataProvider.ConnectDatabase())
            {
                string str = "select distinct MALOP from SINHVIEN";
                return(DataProvider.ExecSQLQueryDataTable(str));
            }
            return(null);
        }
예제 #28
0
 public static bool AddLop(LopDTO lop)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "insert into LOP(MALOP,TENLOP,MAKH) values ('" + lop.MALOP + "',N'" + lop.TENLOP + "','" + lop.MAKH + "')";
         return(DataProvider.ExecSQLQuery(str));
     }
     return(false);
 }
예제 #29
0
 public static DataTable KiemTraHocPhiSinhVien(string masv)
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MASV from LINK2.CSDLPT_QLDSV.DBO.HOCPHI where MASV = '" + masv + "'";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }
예제 #30
0
 public static DataTable LoadKhoa()
 {
     if (DataProvider.ConnectDatabase())
     {
         string str = "select MAKH, TENKH from KHOA";
         return(DataProvider.ExecSQLQueryDataTable(str));
     }
     return(null);
 }