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);
     }
 }
示例#3
0
 private IList<Cinema> GetCinemas()
 {
     var cinemas = new List<Cinema>();
     var cinemaOne = new Cinema { Id = 1, Name = "Sanvika" };
     var cinemaTwo = new Cinema { Id = 2, Name = "Asker" };
     cinemas.Add(cinemaOne);
     cinemas.Add(cinemaTwo);
     return cinemas;
 }