public static Performance CreateSingle(DateTime start)
        {
            var entity = new Performance
                                  {
                                      StartDateTime = start,
                                      EndDateTime = start.AddHours(3),
                                      Price = DateTime.UtcNow.Ticks,
                                  };

            entity.VenueName = string.Format(CultureInfo.InvariantCulture, "VenueName {0}", entity.Id);
            entity.VenueUri = new Uri("http://google.com");
            entity.City = string.Format(CultureInfo.InvariantCulture, "City {0}", entity.Id);
            entity.Info = string.Format(CultureInfo.InvariantCulture, "Info {0}", entity.Id);

            return entity;
        }
        public Performance UpdatePerformance(Performance performance)
        {
            if (performance == null) throw new ArgumentNullException("performance");

            return BandRepository.UpdatePerformance(performance);
        }
        public void RemovePerformance(Performance performance)
        {
            if (performance == null) throw new ArgumentNullException("performance");

            BandRepository.RemovePerformance(performance);
        }
Beispiel #4
0
        public Performance AddPerformance(Performance performance)
        {
            if (performance == null) throw new ArgumentNullException("performance");

            return _catalogsContainer.BandCatalog.Add(performance);
        }
Beispiel #5
0
        public void RemovePerformance(Performance performance)
        {
            if (performance == null) throw new ArgumentNullException("performance");

            _catalogsContainer.BandCatalog.Remove(performance);
        }
Beispiel #6
0
        public PerformanceDetailsModel MapToDetail(Performance entity)
        {
            return new PerformanceDetailsModel
                       {
                           Id = entity.Id,
                           CreationDate = entity.CreationDate,
                           ModificationDate = entity.ModificationDate,

                           Date = entity.StartDateTime.Date.ToLocalTime(),
                           StartTime = entity.StartDateTime.ToLocalTime(),
                           EndTime = entity.EndDateTime.ToLocalTime(),
                           City = entity.City,
                           Info = entity.Info == null ? null : entity.Info.Replace(Environment.NewLine, "<br />"),
                           Price = entity.Price,
                           VenueName = entity.VenueName,
                           VenueUrl = GetUrl(entity.VenueUri),
                       };
        }
Beispiel #7
0
 public UpdatePerformanceModel MapToUpdate(Performance entity)
 {
     return new UpdatePerformanceModel
                {
                    Id = entity.Id,
                    Date = entity.StartDateTime.Date.ToLocalTime(),
                    StartTime = entity.StartDateTime.ToLocalTime(),
                    EndTime = entity.EndDateTime.ToLocalTime(),
                    City = entity.City,
                    Info = entity.Info,
                    Price = entity.Price,
                    VenueName = entity.VenueName,
                    VenueUrl = GetUrl(entity.VenueUri),
                };
 }