//Thêm 1 thể loại vào bảng THELOAI public static string ThemTheLoai(TheLoai_DTO tl) { if (TheLoai_DAO.GetTheLoaiByName(tl.TenTheLoai) == null) { return(TheLoai_DAO.Insert(tl)); } else { return("Thể loại này đã có trong cơ sở dữ liệu"); } }
//Sửa 1 thể loại public static string SuaTheLoai(TheLoai_DTO tl) { if (TheLoai_DAO.GetTheLoaiByName(tl.TenTheLoai) != null) { return("Thể loại này đã có trong cơ sở dữ liệu"); } if (TheLoai_DAO.GetTheLoaiByMa(tl.MaTheLoai) != null) { return(TheLoai_DAO.Update(tl)); } else { return("Mã thể loại này không tồn tại trong CSDL"); } }
public static Theloai_DTO TimTL_TheoMa(string maloai) { return(TheLoai_DAO.TimTL_TheoMa(maloai)); }
public static List <Theloai_DTO> TimTL(string dk, string giatri) { return(TheLoai_DAO.TimTL(dk, giatri)); }
public static bool SuaTL(Theloai_DTO TL) { return(TheLoai_DAO.SuaTL(TL)); }
public static bool XoaTL(string maloai) { return(TheLoai_DAO.XoaTL(maloai)); }
public static bool ThemTL(Theloai_DTO TL) { return(TheLoai_DAO.ThemTL(TL)); }
public static List <Theloai_DTO> LayDSTL() { return(TheLoai_DAO.LayDSTL()); }
//Lấy tất cả thông tin của bảng THELOAI public static DataTable GetTheLoaiAll() { return(TheLoai_DAO.GetTheLoaiAll()); }
public static DataTable DStenTL() { return(TheLoai_DAO.DStenTL()); }
public static string MaTL(string s) { return(TheLoai_DAO.MaTL(s)); }
public static void xoaTL(string maTL) { TheLoai_DAO.xoaTL(maTL); }
public static void suaTL(string maTL, string tenTL) { TheLoai_DAO.suaTL(maTL, tenTL); }
public static void themTL(string maTL, string tenTL) { TheLoai_DAO.themTL(maTL, tenTL); }
public static string LastMaTL() { return(TheLoai_DAO.LastMaTL()); }
//Load danh sách sinh viên public static DataTable DanhSachTL() { return(TheLoai_DAO.LoadDSTheLoai()); }