Esempio n. 1
0
 public Performance()
 {
     Id = 0;
     Start = new DateTime();
     Artist = null;
     Venue = null;
 }
Esempio n. 2
0
 public Performance(int id, DateTime start, Artist artist, Venue venue)
 {
     Id = id;
     Start = start;
     Artist = artist;
     Venue = venue;
 }
Esempio n. 3
0
 public Restriction(int id, DateTime start, DateTime end, Venue venue, Category category)
 {
     Id = id;
     Start = start;
     End = end;
     Venue = venue;
     Category = category;
 }
Esempio n. 4
0
        public List<Performance> GetPerformanceByVenueAndDate(Venue venue, string date)
        {
            DateTime day;

            if (DateTime.TryParse(date, out day))
            {
                return new List<Performance>(viewBL.GetPerformanceByVenueAndDate(venue, day));
            }

            return new List<Performance>();
        }
Esempio n. 5
0
        private void CreateTestData()
        {
            var loc = new Location(LOCATION_ID, LOCATION);
            var locationDao = new LocationDao(database);
            locationDao.Insert(loc);

            var venue = new Venue(VENUE_ID, VENUE_LABEL, VENUE_SPECTATORS, loc, 0, 0);
            var venueDao = new VenueDao(database);
            venueDao.Insert(venue);

            var category = new Category(CATEGORY_ID, CATEGORY_LABEL);
            var categoryDao = new CategoryDao(database);
            categoryDao.Insert(category);

            items = new List<Restriction>();
            items.Add(new Restriction(1, RESTRICTION1_START, RESTRICTION1_STOP, venue, category));
            items.Add(new Restriction(2, RESTRICTION2_START, RESTRICTION2_STOP, venue, category));
            items.Add(new Restriction(3, RESTRICTION3_START, RESTRICTION3_STOP, venue, category));
            items.Add(new Restriction(4, RESTRICTION4_START, RESTRICTION4_STOP, venue, category));
        }
Esempio n. 6
0
        private void CreateTestData()
        {
            var loc = new Location(LOCATION_ID, LOCATION);
            var locationDao = new LocationDao(database);
            locationDao.Insert(loc);

            var venue = new Venue(VENUE_ID, VENUE_LABEL, VENUE_SPECTATORS, loc, 0, 0);
            var venueDao = new VenueDao(database);
            venueDao.Insert(venue);

            var category = new Category(CATEGORY_ID, CATEGORY_LABEL);
            var categoryDao = new CategoryDao(database);
            categoryDao.Insert(category);

            var artist = new Artist(ARTIST_ID, ARTIST_NAME, ARTIST_COUNTRY, ARTIST_MAIL, "", "", "", "", category, false);
            var artistDao = new ArtistDao(database);
            artistDao.Insert(artist);

            items = new List<Performance>();
            items.Add(new Performance(1, PERFORMANCE1_START, artist, venue));
            items.Add(new Performance(2, PERFORMANCE2_START, artist, venue));
            items.Add(new Performance(3, PERFORMANCE3_START, artist, venue));
            items.Add(new Performance(4, PERFORMANCE4_START, artist, venue));
        }
Esempio n. 7
0
        /// <summary>
        /// Gets the performance by venue and date.
        /// </summary>
        /// <param name="venue">The venue.</param>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public IList<Performance> GetPerformanceByVenueAndDate(Venue venue, DateTime date)
        {
            DateTime start = new DateTime(date.Year, date.Month, date.Day, 0, 0, 0);
            DateTime end = new DateTime(date.Year, date.Month, date.Day, 23, 59, 59);

            return performanceDao.FindByVenueAndDate(venue.Label, start, end);
        }
Esempio n. 8
0
 /// <summary>
 /// Gets the performance by venue.
 /// </summary>
 /// <param name="venue">The venue.</param>
 /// <returns></returns>
 public IList<Performance> GetPerformanceByVenue(Venue venue)
 {
     return performanceDao.FindByVenue(venue.Label);
 }
Esempio n. 9
0
 public List<Performance> GetPerformanceByVenue(Venue venue)
 {
     return new List<Performance>(viewBL.GetPerformanceByVenue(venue));
 }
Esempio n. 10
0
        public void UpdateVenue(Venue venue)
        {
            if (venue == null)
                throw new ArgumentNullException("Invalid venue!");

            if (venueDao.FindById(venue.Id, venue.Location.Id) != null)
            {
                if (!venueDao.Update(venue))
                    throw new VenueException("Cannot update venue!");
            }
            else
            {
                CreateVenue(venue);
            }
        }
Esempio n. 11
0
        public void RemoveVenue(Venue venue)
        {
            if (venue == null)
                throw new ArgumentNullException("Invalid venue!");

            if (!venueDao.Delete(venue.Id, venue.Location.Id))
                throw new VenueException("Cannot delete venue!");
        }
Esempio n. 12
0
        public void CreateVenue(Venue venue)
        {
            if (venue == null)
                throw new ArgumentNullException("Invalid Venue!");

            if (!venueDao.Insert(venue))
                throw new VenueException("Cannot insert venue!");
        }
Esempio n. 13
0
        public bool Update(Venue o)
        {
            if (o == null ||
                o.Label == null ||
                o.Location == null)
                return false;

            var command = _database.CreateCommand(SQL_UPDATE);
            _database.DefineParameter(command, "@idVenue", DbType.Int32, o.Id);
            _database.DefineParameter(command, "@idLocation", DbType.Int32, o.Location.Id);
            _database.DefineParameter(command, "@label", DbType.String, o.Label);
            _database.DefineParameter(command, "@location", DbType.String, o.Location.Id);
            _database.DefineParameter(command, "@maxSpectators", DbType.Int32, o.MaxSpectators);
            _database.DefineParameter(command, "@latitude", DbType.Double, o.Latitude);
            _database.DefineParameter(command, "@longitude", DbType.Double, o.Longitude);

            return _database.ExecuteNonQuery(command) == 1;
        }