Exemple #1
0
        public void AddShow_Executed(object sender)
        {
            TimeSpan ts  = new TimeSpan(10, 0, 0);
            Button   btn = sender as Button;

            int row = Grid.GetRow(btn);
            int day = Grid.GetColumn(btn);

            for (int i = 0; i < row; i++)
            {
                ts = ts.Add(new TimeSpan(0, 30, 0));
            }

            Show show = new Show();

            show.Movie     = Movies[ActiveMovie - 1];
            show.MovieId   = show.Movie.Id;
            show.StartTime = ts;
            show.EndTime   = ts.Add(new TimeSpan(0, show.Movie.Length, 0));
            show.ShowDate  = _currentDate.AddDays(day);

            show.Hall = int.Parse(_halls[ActiveHall]);
            ShowsToAdd.Add(show);
            GenerateTable(null, null);
        }
Exemple #2
0
        public void RemoveShow_Executed(object sender)
        {
            Show     s    = sender as Show;
            TimeSpan diff = s.ShowDate.Value - _currentDate;
            int      day  = diff.Days;

            _showsToRemove.Add(s);
            ShowsToAdd.Remove(s);
            GenerateTable(null, null);
        }
Exemple #3
0
        // OBSERVER METHODE
        #region observer
        public void Update(Type t)
        {
            if (t == typeof(Movie))
            {
                var _actualMovies = _db.GetObjects <Movie>();
                Movies.Clear();

                foreach (var movie in _actualMovies)
                {
                    Movies.Add(movie);
                }
            }
            else if (t == typeof(Show))
            {
                var _actualShows = _db.GetObjects <Show>();
                ShowsToAdd.Clear();

                foreach (var show in _actualShows)
                {
                    ShowsToAdd.Add(show);
                }
            }
        }