//lấy danh sách bình luận theo từng block
 public static List<BinhLuan> GetBinhluans(int BlockNumber, int BlockSize, int KhachSan)
 {
     int startIndex = (BlockNumber - 1) * BlockSize;
     using (var _context = new PortalEntities())
     {
         var _dsBinhluan = (from p in _context.BinhLuan where p.KhachSan == KhachSan select p).
             OrderByDescending(p => p.Id).
             Skip(startIndex).
             Take(BlockSize).ToList();
         if (_dsBinhluan != null)
             return _dsBinhluan;
         else
             return null;
     }
 }
        //lấy danh sách khách sạn theo từng block
        public static List<KhachSan> GetHotels(int BlockNumber, int BlockSize, string ThanhPho, string SapXep)
        {
            int startIndex = (BlockNumber - 1) * BlockSize;
            var _dsKhachSan = new List<KhachSan>();
            using(var _context = new PortalEntities())
            {
                switch (SapXep)
                {
                    case "Name": //tên theo alphabet
                        _dsKhachSan = (from p in _context.KhachSan where p.ThanhPho == ThanhPho select p).
                            OrderBy(p => p.TenKhachSan).
                            Skip(startIndex).
                            Take(BlockSize).ToList();
                        break;
                    case "Price": //giá thấp -> cao
                        _dsKhachSan = (from p in _context.KhachSan where p.ThanhPho == ThanhPho select p).
                            OrderBy(p => p.GiaTien).
                            Skip(startIndex).
                            Take(BlockSize).
                            ToList();
                        break;
                    case "Rating": //rating từ cao -> thấp
                        _dsKhachSan = (from p in _context.KhachSan where p.ThanhPho == ThanhPho select p).
                            OrderByDescending(p => p.DanhGia).
                            Skip(startIndex).
                            Take(BlockSize).ToList();
                        break;
                    case "Category": //hạng khách sạn từ cao -> thấp
                        _dsKhachSan = (from p in _context.KhachSan where p.ThanhPho == ThanhPho select p).
                            OrderByDescending(p => p.HangKhachSan).
                            Skip(startIndex).Take(BlockSize).
                            ToList();
                        break;
                }
            }

            if (_dsKhachSan == null){
                //throw here
            }
            return _dsKhachSan;
        }