Esempio n. 1
0
        public PerformanceViewModel(VenueViewModel venueVm, ArtistViewModel artistVm, DateTime day, IManager manager)
        {
            this.manager = manager;
            this.performance = new Performance();

            this.performance.Start = day;

            var artist = manager.GetArtistByName(artistVm.Name);
            if (artist != null && artist.Count > 0)
                this.performance.Artist = artist.ElementAt(0);
            else
                this.performance.Artist = new Artist();

            var venue = manager.GetVenueById(venueVm.Id);
            if (venue != null)
                this.performance.Venue = venue;

            this.venueVm = venueVm;
            this.artistVm = artistVm;
            this.day = day;
            this.artists = new List<ArtistViewModel>();
            this.venues = new List<VenueViewModel>();

            SaveCommand = new RelayCommand(o => manager.UpdatePerformance(performance));
            RemoveCommand = new RelayCommand(o => manager.RemovePerformance(performance));
        }
Esempio n. 2
0
        public PerformanceViewModel(IManager manager)
        {
            this.manager = manager;
            this.performance = new Performance();
            this.venueVm = new VenueViewModel(manager);
            this.artistVm = new ArtistViewModel(manager);
            this.day = new DateTime(2000, 01, 01);
            this.artists = new List<ArtistViewModel>();
            this.venues = new List<VenueViewModel>();

            SaveCommand = new RelayCommand(o => manager.UpdatePerformance(performance));
            RemoveCommand = new RelayCommand(o => manager.RemovePerformance(performance));
        }
Esempio n. 3
0
        public PerformanceViewModel(Performance performance, IManager manager)
        {
            this.manager = manager;
            this.performance = performance;
            this.venueVm = new VenueViewModel(performance.Venue, manager);
            this.artistVm = new ArtistViewModel(performance.Artist, (manager));
            this.day = new DateTime(performance.Start.Year, performance.Start.Month, performance.Start.Day,
                                    performance.Start.Hour, performance.Start.Minute, performance.Start.Second);
            this.artists = new List<ArtistViewModel>();
            this.venues = new List<VenueViewModel>();

            SaveCommand = new RelayCommand(o => manager.UpdatePerformance(performance));
            RemoveCommand = new RelayCommand(o => manager.RemovePerformance(performance));
        }