private void SetMovieTimes(Cinema model) { foreach (var program in model.MoviePrograms) { MovieTime movieTime = null; program.MovieTimes = new List<MovieTime>(); DateTime currentDateTime = DateTime.MinValue; foreach (DateTime dt in program.Showtimes.OrderBy(d => d)) { if (dt.Date != currentDateTime.Date) { currentDateTime = dt; if (movieTime != null) program.MovieTimes.Add(movieTime); movieTime = new MovieTime(); movieTime.DisplayDate = dt.ToString("ddd dd MMM"); movieTime.DisplayTimes = dt.ToString("HH:mm"); } else { movieTime.DisplayTimes += dt.ToString(" & HH:mm"); } } if (movieTime != null) program.MovieTimes.Add(movieTime); } }
private void GetMovieImages(Cinema model) { foreach (var program in model.MoviePrograms) { Node movieNode = new Node(program.MovieLink.NodeId); program.MovieInfo = new MovieProgramInfo(); ModelFactory.FillModel(program.MovieInfo, movieNode); } }