Пример #1
0
        /// <summary>
        /// Đếm số lượng Seat
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchSeatEntity"></param>
        /// <returns></returns>
        public int Count(UserEntity UserEntity, SearchSeatEntity SearchSeatEntity)
        {
            if (SearchSeatEntity == null)
            {
                SearchSeatEntity = new SearchSeatEntity();
            }
            IQueryable <Seat> Seats = CinemasEntities.Seats;

            Seats = SearchSeatEntity.ApplyTo(Seats);
            return(Seats.Count());
        }
Пример #2
0
        /// <summary>
        /// Lọc thông tin Seat dựa trên điều kiện search
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchSeatEntity"></param>
        /// <returns></returns>
        public List <SeatEntity> Gets(UserEntity UserEntity, SearchSeatEntity SearchSeatEntity)
        {
            if (SearchSeatEntity == null)
            {
                SearchSeatEntity = new SearchSeatEntity();
            }
            IQueryable <Seat> Seats = CinemasEntities.Seats.Include(s => s.Room);

            Seats = SearchSeatEntity.ApplyTo(Seats);
            Seats = SearchSeatEntity.SkipAndTake(Seats);
            return(Seats.ToList().Select(c => new SeatEntity(c, c.Room)).ToList());
        }
Пример #3
0
 public List <SeatEntity> Gets([FromUri] SearchSeatEntity SearchSeatEntity)
 {
     return(SeatService.Gets(UserEntity, SearchSeatEntity));
 }
Пример #4
0
 public int Count([FromUri] SearchSeatEntity SearchSeatEntity)
 {
     return(SeatService.Count(UserEntity, SearchSeatEntity));
 }