//GetMovies //returns a movie based off movieId from PerformanceViewModel public MovieDisplayViewModel GetMovie(string pId) { var search = _dao.GetMovieFiles()["movies"][pId]; MovieDisplayViewModel movieDisplay = new MovieDisplayViewModel(); movieDisplay.name = search["name"].ToString(); movieDisplay.dimension = search["dimension"].ToString(); movieDisplay.format = search["format"].ToString(); movieDisplay.rating = search["rating"].ToString(); return(movieDisplay); }
//GetPerformances //gets list of performances for current date public List <PerformancesViewModel> GetPerformancesToday() { List <PerformancesViewModel> viewModels = new List <PerformancesViewModel>(); var search = _dao.GetMovieFiles()["performances"][dt.ToString("yyyy-MM-dd")]; foreach (JObject j in search) { PerformancesViewModel viewModel = new PerformancesViewModel(); viewModel.auditorium = (int)j["auditorium"]; viewModel.movieId = j["movieId"].ToString(); viewModel.performanceId = (int)j["performanceId"]; viewModel.isSoldOut = (bool)j["isSoldOut"]; viewModel.time = j["time"].ToString(); viewModels.Add(viewModel); } return(viewModels); }