public static string laymaHDlonnhat() { string query = @"select MAX(MAHD) from HoaDon"; SqlParameter[] param = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, param).Rows[0][0].ToString()); }
public static DataTable gettintuc(int matin) { string query = string.Format("SELECT * FROM TINTUC WHERE MA_TIN={0}", matin); SqlParameter[] parameter = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameter)); }
public static int GetTotalVisitors() { string query = "SELECT VisitorNumber FROM TotalVisitors"; SqlParameter[] param = new SqlParameter[1]; return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query).Rows[0][0])); }
public static DataTable gettintucslide3() { string query = "SELECT * FROM TINTUC WHERE MA_TIN=3"; SqlParameter[] parameter = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameter)); }
public static DataTable gettintucphobien() { string query = "SELECT * FROM TINTUC WHERE TIN_NOI_BAT=1"; SqlParameter[] parameter = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameter)); }
//Lấy Ds món ăn có trạng thái hủy 0 public static DataTable LayDSMonAnBiXoa() { string query = "SELECT * FROM tblMonAn WHERE TrangThai = 0"; SqlParameter[] parameter = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameter)); }
public static DataTable LayDSSanPham() { string query = "SELECT TOP 30 * FROM tblSanPham"; SqlParameter[] parameter = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameter)); }
public static DataTable LayDSLopHoc(LopHocDTO lh) { string query = "SELECT Ma_Lop FROM LopHoc"; SqlParameter[] param = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, param)); }
public static SanPhamDTO LaySP(string masp) { string query = "SELECT * FROM SanPham WHERE MaSP=@ma"; SqlParameter[] param = { new SqlParameter("ma", masp) }; return(ChuyenLopDTO(DataProvider.ExecuteSelectQuery(query, param).Rows[0])); }
//Lấy DS tài khoản public static DataTable LayDSTaiKhoan() { string query = "SELECT * FROM tblTaiKhoan WHERE TrangThai = 1"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars)); }
public static DataTable LayDSHinhAnhSP() { string query = "select * from hinhanhsp"; SqlParameter[] parameters = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, parameters)); }
public static DataRow LayDSNhanVienCaTruong() { string query = "SELECT TenTaiKhoan,MatKhau FROM tblTaiKhoan WHERE LaAdmin = 2"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars).Rows[0]); }
//Lấy mã nhà cung cấp lớn nhất public static string LayMaxMaNCC() { string query = "SELECT MAX(MaNCC) FROM tblNhaCungCap"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars).Rows[0][0].ToString()); }
//Lấy DS nhà cung cấp bị xóa public static DataTable LayDSNhaCungCapBiXoa() { string query = "SELECT * FROM tblNhaCungCap WHERE TrangThai = 0"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars)); }
public static string LayMaHDLonNhat() { string query = "SELECT MAX(MaHD) FROM HoaDon"; SqlParameter[] param = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, param).Rows[0][0].ToString()); }
public static bool KiemTraTonTai(string masp) { string query = "SELECT * FROM SanPham WHERE MaSP=@ma"; SqlParameter[] param = { new SqlParameter("ma", masp) }; return(DataProvider.ExecuteSelectQuery(query, param).Rows.Count > 0); }
public static string LayMaMonLonNhat() { string query = "SELECT MAX(MaMon) FROM tblMonAn"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars).Rows[0][0].ToString()); }
public static DataTable LayDSTaiKhoan() { string query = "SELECT * FROM TaiKhoan"; SqlParameter[] param = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, param)); }
public static DataTable ReportNgayNhap() { string query = "select distinct NgayNhap from tblHDNhap"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars)); }
public static DataTable LayDSSanPham() { string query = "select * from SanPham"; SqlParameter[] param = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, param)); }
// Load danh sách loại nguyên liệu trạng thái false (không còn sử dụng) public static DataTable LayDSLoaiNguyenLieuKhongConSuDung() { string query = "SELECT MaLoaiNL, TenLoaiNL, TrangThai FROM tblLoaiNguyenLieu WHERE TrangThai = 0"; SqlParameter[] pars = new SqlParameter[0]; return(DataProvider.ExecuteSelectQuery(query, pars)); }
public static bool KiemTraTKTonTai(string TENTK) { string query = "SELECT COUNT(*) FROM TAIKHOAN WHERE TENTK=@TENTK"; SqlParameter[] parameter = new SqlParameter[1]; parameter[0] = new SqlParameter("@TENTK", TENTK); return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query, parameter).Rows[0][0]) == 1); }
public static string LayMatKhau(string TENTK) { string query = "SELECT MK FROM TAIKHOAN WHERE TENTK=@TENTK"; SqlParameter[] parameter = new SqlParameter[1]; parameter[0] = new SqlParameter("@TENTK", TENTK); return(DataProvider.ExecuteSelectQuery(query, parameter).Rows[0][0].ToString()); }
public static bool KTMaLoaiVideoTonTai(LoaiVideoDTO lvd) { string query = "SELECT COUNT(*) FROM LoaiVideo WHERE MaLoaiVideo = @MaLoaiVideo"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@MaLoaiVideo", lvd.MaLoaiVideo); return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query, param).Rows[0][0]) == 1); }
public static DataTable LayGH(string tenTaiKhoan) { string query = "SELECT GH.MaSP,TenSP,GiaTien,SoLuong,ThongTin,GiaTien*SoLuong AS ThanhTien,AnhMinhHoa FROM GioHang GH INNER JOIN SanPham SP ON GH.MaSP = SP.MaSP WHERE TenTaiKhoan = @TenTaiKhoan"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@TenTaiKhoan", tenTaiKhoan); return(DataProvider.ExecuteSelectQuery(query, param)); }
public static DataRow LayLoaiVideo(LoaiVideoDTO lvd) { string query = "SELECT * FROM LoaiVideo WHERE MaLoaiVideo = @MaLoaiVideo"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@MaLoaiVideo", lvd.MaLoaiVideo); return(DataProvider.ExecuteSelectQuery(query, param).Rows[0]); }
public static LoaiVideoDTO LayThongTinLoaiVideo(string maLoaiVideo) { string query = "SELECT * FROM LoaiVideo WHERE MaLoaiVideo = @MaLoaiVideo"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@MaLoaiVideo", maLoaiVideo); return(ConvertToDTO(DataProvider.ExecuteSelectQuery(query, param).Rows[0])); }
public static SinhVienDTO LayThongTinSV(string maSV) { string query = "SELECT * FROM ThongTinSV WHERE Ma_SV = @Ma_SV"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@Ma_SV", maSV); return(ConvertToDTO(DataProvider.ExecuteSelectQuery(query, param).Rows[0])); }
public static bool KTSVTonTai(string maSV) { string query = "SELECT COUNT(*) FROM ThongTinSV WHERE Ma_SV = @Ma_SV"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@Ma_SV", maSV); return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query, param).Rows[0][0]) == 1); }
public static int DemSoSinhVien(string maLop) { string query = "select count(*) from ThongTinSV where MaLop = @MaLop"; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@MaLop", maLop); return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query, param).Rows[0][0])); }