コード例 #1
0
        public static PetaPoco.Page <sanpham> TimKiem(string key, string order, int pgNumb = 1, int itemsPerPg = 20)
        {
            var db  = new BabyShopConnectionDB();
            var sql = string.Format("select * from sanpham where khoa=0 {0} order by ngaycapnhat desc {1}", string.IsNullOrEmpty(key) ? "" : " and " + key, string.IsNullOrEmpty(order) ? "" : ", " + order);

            return(db.Page <sanpham>(pgNumb, itemsPerPg, sql));
        }
コード例 #2
0
        public static Page <sanpham> HienThiDanhSachSanPham(int pageNumber, int itemPerpage)
        {
            var db = new BabyShopConnectionDB();

            return(db.Page <sanpham>(pageNumber, itemPerpage, "select sp.*, lsp.TenLoaiSanPham as TenLoai, nsx.TenNhaSanXuat as TenNSX "
                                     + "from sanpham sp join loaisanpham lsp on sp.MaLoaiSanPham = lsp.MaLoaiSanPham join nhasanxuat nsx on sp.MaNhaSanXuat = nsx.MaNhaSanXuat"
                                     + "WHERE sp.BiXoa <> 1 ORDER BY sp.SoLuongBan DESC"));
        }
コード例 #3
0
        public static Page <loaisanpham> HienThiDanhSachLoaiSanPham(int pageNumber, int itemPerpage)
        {
            var db = new BabyShopConnectionDB();

            return(db.Page <loaisanpham>(pageNumber, itemPerpage, "SELECT * FROM LoaiSanPham WHERE BiXoa <> 1 "));
        }
コード例 #4
0
        public static Page <nhasanxuat> HienThiDanhNhaSanXuat(int pageNumber, int itemPerpage)
        {
            var db = new BabyShopConnectionDB();

            return(db.Page <nhasanxuat>(pageNumber, itemPerpage, "SELECT * FROM NhaSanXuat WHERE BiXoa <> 1 "));
        }
コード例 #5
0
 public static Page <AspNetUser> HienThiDanhSachTaiKhoan(int pageNumber, int itemPerpage)
 {
     return(db.Page <AspNetUser>(pageNumber, itemPerpage, "SELECT * FROM AspNetUsers"));
 }
コード例 #6
0
ファイル: SanPhamBus.cs プロジェクト: hohoangnhu/DACK_WEB_2
        public static Page <sanpham> HienThiDanhSachSanPham(int pageNumber, int itemPerPage)
        {
            var db = new BabyShopConnectionDB();

            return(db.Page <sanpham>(pageNumber, itemPerPage, "SELECT * FROM sanpham WHERE BiXoa <> 1 ORDER BY SoLuongBan DESC "));
        }