示例#1
0
        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();
        }
示例#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();
        }
示例#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);
 }
示例#6
0
文件: Brand.cs 项目: lulzzz/DblDip
 public void When(BrandUpdated brandUpdated)
 {
 }
示例#7
0
 public void Consume(BrandUpdated message)
 {
     _brandSubscriber.Handle(message);
 }
示例#8
0
 public void Handle(BrandUpdated @event)
 {
     AddActivityLog(AdminActivityLogCategory.Brand, @event);
 }