Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public Performance UpdatePerformance(Performance performance)
        {
            if (performance == null) throw new ArgumentNullException("performance");

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

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

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

            _catalogsContainer.BandCatalog.Remove(performance);
        }
Esempio n. 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),
                       };
        }
Esempio n. 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),
                };
 }