void GetFilms() { dgvMovieList.DataSource = (from m in _movieService.GetAll() join mst in _theaterService.GetAll() on m.ID equals mst.MovieId join sa in _saloonService.GetAll() on mst.SaloonId equals sa.ID join s in _seanceService.GetAll() on mst.SeanceId equals s.ID select new { ID = mst.ID, Film = m.Name, Salon = sa.Name, Seans = s.Time, Gun = mst.Day }).ToList(); }
void GetAllTheater() { dgvTheater.DataSource = (from m in _movieService.GetAll() join tm in _theaterService.GetAll() on m.ID equals tm.MovieId join sa in _saloonService.GetAll() on tm.SaloonId equals sa.ID join s in _seanceService.GetAll() on tm.SeanceId equals s.ID select new { tm.ID, Film = m.Name, Salon = sa.Name, Seans = s.Time, Gun = tm.Day } ).ToList(); }
// api/theaters?type=cinemas public IEnumerable <TheaterListDTO> Get(string type = "") { if (string.IsNullOrEmpty(type)) { return(_theaterService.GetAll()); } else if (type == "cinemas") { return(_theaterService.GetAllCinemas()); } else if (type == "theaters") { return(_theaterService.GetAllPlayTheaters()); } else { throw new HttpResponseException(HttpStatusCode.BadRequest); } }