Exemplo n.º 1
0
        /// <summary>
        /// Đếm số lượng Showtime
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchShowtimeEntity"></param>
        /// <returns></returns>
        public int Count(UserEntity UserEntity, SearchShowtimeEntity SearchShowtimeEntity)
        {
            if (SearchShowtimeEntity == null)
            {
                SearchShowtimeEntity = new SearchShowtimeEntity();
            }
            IQueryable <Showtime> Showtimes = CinemasEntities.Showtimes;

            Showtimes = SearchShowtimeEntity.ApplyTo(Showtimes);
            return(Showtimes.Count());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lọc thông tin Showtime theo điều kiện search
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchShowtimeEntity"></param>
        /// <returns></returns>
        public List <ShowtimeEntity> Gets(UserEntity UserEntity, SearchShowtimeEntity SearchShowtimeEntity)
        {
            if (SearchShowtimeEntity == null)
            {
                SearchShowtimeEntity = new SearchShowtimeEntity();
            }
            IQueryable <Showtime> Showtimes = CinemasEntities.Showtimes.Include(st => st.Room).Include(st => st.Film);

            Showtimes = SearchShowtimeEntity.ApplyTo(Showtimes);
            Showtimes = SearchShowtimeEntity.SkipAndTake(Showtimes);
            return(Showtimes.ToList().Select(st => new ShowtimeEntity(st, st.Film, st.Room)).ToList());
        }
Exemplo n.º 3
0
 public List <ShowtimeEntity> Gets([FromUri] SearchShowtimeEntity SearchShowtimerEntity)
 {
     return(ShowtimeService.Gets(UserEntity, SearchShowtimerEntity));
 }
Exemplo n.º 4
0
 public int Count([FromUri] SearchShowtimeEntity SearchShowtimeEntity)
 {
     return(ShowtimeService.Count(UserEntity, SearchShowtimeEntity));
 }