public void CreateNoIdObjectTest()
        {
            var performance = new Performance(
                DateTime.Now,
                new Artist("name", null, null, null, "email", "videourl", false),
                new Venue("shortname", "name", null, null));

            Assert.IsFalse(performance.HasId);
        }
        public void CreateObjectTest()
        {
            var artist = new Artist("name", null, null, null, "email", "videourl", false);
            var venue = new Venue("shortname", "name", null, null);
            var performance = new Performance(13, DateTime.Now, artist, venue);

            Assert.AreEqual(13, performance.Id);
            Assert.AreEqual(artist, performance.Artist);
            Assert.AreEqual(venue, performance.Venue);
        }
        private async void LoadPerformances(DateTime date)
        {
            DayProgram.Clear();

            var performances = (await Server.PerformanceServer.GetByDateAsync(date)).ToList();
            foreach (var venue in Venues)
            {
                var venueProgram = new VenueProgram { Venue = venue };

                for (var hour = 0; hour <= 23; ++hour)
                {
                    var performance =
                        performances.FirstOrDefault(p => (p.DateTime.Hour == hour) && (p.Venue.Equals(venue)));

                    if (performance == null)
                    {
                        performance = new Performance
                            {
                                Artist = VenueProgram.NullArtist,
                                DateTime = SelectedDate.AddHours(hour),
                                Venue = venue
                            };
                    }

                    performance.PropertyChanged += PerformancePropertyChanged;

                    venueProgram.Times[hour] = performance;
                }

                DayProgram.Add(venueProgram);
            }
        }
 public bool AddPerformance(Performance performance)
 {
     return Implementation_Server.PerformanceServer.Add(performance);
 }
 public bool UpdatePerformance(Performance performance)
 {
     return Implementation_Server.PerformanceServer.Update(performance);
 }
 public void DeletePerformance(Performance performance)
 {
     Implementation_Server.PerformanceServer.Remove(performance);
 }
 protected bool Equals(Performance other)
 {
     return Equals(Artist, other.Artist) && DateTime.Equals(other.DateTime) && Equals(Venue, other.Venue);
 }