예제 #1
0
        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());
        }
예제 #2
0
        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));
        }
예제 #3
0
        public static int GetTotalVisitors()
        {
            string query = "SELECT VisitorNumber FROM TotalVisitors";

            SqlParameter[] param = new SqlParameter[1];
            return(Convert.ToInt32(DataProvider.ExecuteSelectQuery(query).Rows[0][0]));
        }
예제 #4
0
        public static DataTable gettintucslide3()
        {
            string query = "SELECT * FROM TINTUC WHERE MA_TIN=3";

            SqlParameter[] parameter = new SqlParameter[0];
            return(DataProvider.ExecuteSelectQuery(query, parameter));
        }
예제 #5
0
        public static DataTable gettintucphobien()
        {
            string query = "SELECT * FROM TINTUC WHERE TIN_NOI_BAT=1";

            SqlParameter[] parameter = new SqlParameter[0];
            return(DataProvider.ExecuteSelectQuery(query, parameter));
        }
예제 #6
0
        //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));
        }
예제 #7
0
        public static DataTable LayDSSanPham()
        {
            string query = "SELECT TOP 30 * FROM tblSanPham";

            SqlParameter[] parameter = new SqlParameter[0];
            return(DataProvider.ExecuteSelectQuery(query, parameter));
        }
예제 #8
0
        public static DataTable LayDSLopHoc(LopHocDTO lh)
        {
            string query = "SELECT Ma_Lop FROM LopHoc";

            SqlParameter[] param = new SqlParameter[0];
            return(DataProvider.ExecuteSelectQuery(query, param));
        }
예제 #9
0
        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]));
        }
예제 #10
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));
        }
예제 #11
0
        public static DataTable LayDSHinhAnhSP()
        {
            string query = "select * from hinhanhsp";

            SqlParameter[] parameters = new SqlParameter[0];
            return(DataProvider.ExecuteSelectQuery(query, parameters));
        }
예제 #12
0
        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]);
        }
예제 #13
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());
        }
예제 #14
0
        //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));
        }
예제 #15
0
        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());
        }
예제 #16
0
        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);
        }
예제 #17
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));
        }
예제 #19
0
        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));
        }
예제 #21
0
        // 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));
        }
예제 #22
0
        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);
        }
예제 #23
0
        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);
        }
예제 #25
0
        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]));
        }
예제 #28
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]));
        }
예제 #29
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);
        }
예제 #30
0
        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]));
        }