public void Consume(BrandUpdated @event)
        {
            var brand = _repository.Brands.Single(x => x.Id == @event.Id);

            brand.Code       = @event.Code;
            brand.TimezoneId = @event.TimeZoneId;

            _repository.SaveChanges();
        }
        public void Consume(BrandUpdated message)
        {
            var brand = _repository.Brands.Single(x => x.Id == message.Id);

            brand.Name       = message.Name;
            brand.Email      = message.Email;
            brand.SmsNumber  = message.SmsNumber;
            brand.WebsiteUrl = message.WebsiteUrl;
            brand.TimezoneId = message.TimeZoneId;

            _repository.SaveChanges();
        }
Beispiel #3
0
        public void Handle(BrandUpdated @event)
        {
            var bonusRepository = _container.Resolve <IBonusRepository>();

            var brand = bonusRepository.Brands.SingleOrDefault(b => b.Id == @event.Id);

            if (brand == null)
            {
                throw new RegoException(string.Format(NoBrandFormat, @event.Id));
            }

            Mapper.Map(@event, brand);
            bonusRepository.SaveChanges();
        }
Beispiel #4
0
        public void Handle(BrandUpdated updatedEvent)
        {
            var repository = _container.Resolve <IReportRepository>();

            //todo: refactor the following, updatedEvent.Id should not be the same as BrandId
            var record = repository.BrandRecords.SingleOrDefault(r => r.BrandId == updatedEvent.Id);

            if (record == null)
            {
                throw new RegoException(string.Format(BrandNotFoundMessage, updatedEvent.Id));
            }

            record.Licensee      = updatedEvent.LicenseeName;
            record.BrandCode     = updatedEvent.Code;
            record.Brand         = updatedEvent.Name;
            record.BrandType     = updatedEvent.TypeName;
            record.Remarks       = updatedEvent.Remarks;
            record.PlayerPrefix  = updatedEvent.PlayerPrefix;
            record.BrandTimeZone = FormatTimeZoneOffset(updatedEvent.TimeZoneId);
            record.AllowedInternalAccountsNumber = updatedEvent.InternalAccountCount;
            record.Updated   = updatedEvent.EventCreated;
            record.UpdatedBy = updatedEvent.EventCreatedBy;
            repository.SaveChanges();
        }
 public void Consume(BrandUpdated message)
 {
     _eventHandlers.Handle(message);
 }
Beispiel #6
0
 public void When(BrandUpdated brandUpdated)
 {
 }
Beispiel #7
0
 public void Consume(BrandUpdated message)
 {
     _brandSubscriber.Handle(message);
 }
Beispiel #8
0
 public void Handle(BrandUpdated @event)
 {
     AddActivityLog(AdminActivityLogCategory.Brand, @event);
 }