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 } }
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); }
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); }
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); }
public static SqlDataReader LoadPhieuDiem(string x_strMaSV) { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_PhieuDiem '{0}'", x_strMaSV))); } return(null); }
public static SqlDataReader LoadHocPhi(string x_strMaSinhVien) { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLDataReader(string.Format("EXEC sp_LoadHocPhi '{0}'", x_strMaSinhVien))); } return(null); }
public static SqlDataReader LoadSinhVien() { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLDataReader(string.Format("SELECT MASV FROM SINHVIEN"))); } return(null); }
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); }
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); }
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); }
public static SqlDataReader LoadMonHoc() { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLDataReader(string.Format("SELECT MAMH, TENMH FROM MONHOC"))); } return(null); }
public static SqlDataReader LoadLop() { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLDataReader(string.Format("SELECT MALOP, TENLOP FROM LOP"))); } return(null); }
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); }
public static bool ChangeServer() { if (DataProvider.ConnectDatabase()) { return(true); } return(false); }
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); }
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); }
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); }
public static DataTable LoadMonHoc() { if (DataProvider.ConnectDatabase()) { return(DataProvider.ExecSQLQueryDataTable("SELECT * FROM MONHOC")); } return(null); }
public static DataTable LoadLop() { if (DataProvider.ConnectDatabase()) { string str = "select MALOP,TENLOP,MAKH from LOP"; return(DataProvider.ExecSQLQueryDataTable(str)); } return(null); }
public static bool DeleteLop(string malop) { if (DataProvider.ConnectDatabase()) { string str = "delete from LOP where MALOP = '" + malop + "'"; return(DataProvider.ExecSQLQuery(str)); } return(false); }
public static DataTable KiemTraDiemSinhVien(string masv) { if (DataProvider.ConnectDatabase()) { string str = "select MASV from DIEM where MASV = '" + masv + "'"; return(DataProvider.ExecSQLQueryDataTable(str)); } return(null); }
public static SqlDataReader KiemTraMaSinhVien(string masv) { if (DataProvider.ConnectDatabase()) { string str = "EXEC SP_KiemTraMaSinhVien '" + masv + "'"; return(DataProvider.ExecSQLDataReader(str)); } return(null); }
public static DataTable LoadGiangVien() { if (DataProvider.ConnectDatabase()) { string str = "select MAGV, HO, TEN, MAKH from GIANGVIEN"; return(DataProvider.ExecSQLQueryDataTable(str)); } return(null); }
public static SqlDataReader KiemTraTenLop(string tenlop) { if (DataProvider.ConnectDatabase()) { string str = "EXEC SP_KiemTraTenLop N'" + tenlop + "'"; return(DataProvider.ExecSQLDataReader(str)); } return(null); }
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); }
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); }
//============================= 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); }
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); }
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); }
public static DataTable LoadKhoa() { if (DataProvider.ConnectDatabase()) { string str = "select MAKH, TENKH from KHOA"; return(DataProvider.ExecSQLQueryDataTable(str)); } return(null); }