예제 #1
0
 public RegisterMeetupCommand(string name,
                              string shortDescription,
                              string longDescription,
                              DateTime dateHome,
                              DateTime endDate,
                              bool free,
                              decimal meetupValue,
                              bool online,
                              string companyName,
                              Guid organizerId,
                              Guid categoryId,
                              IncludeAddressMeetupCommand address
                              )
 {
     Name             = name;
     ShortDescription = shortDescription;
     LongDescription  = longDescription;
     DateHome         = dateHome;
     EndDate          = endDate;
     Free             = free;
     MeetupValue      = meetupValue;
     Online           = online;
     CompanyName      = companyName;
     OrganizerId      = organizerId;
     CategoryId       = categoryId;
     Address          = address;
 }
예제 #2
0
        public void Handle(IncludeAddressMeetupCommand message)
        {
            var address = new Address(message.Id, message.Street, message.Number, message.Complement,
                                      message.Neighborhood, message.CEP, message.City,
                                      message.State, message.MeetupId.Value);

            if (!address.IsValid())
            {
                NotificarValidacoesErro(address.ValidationResult);
                return;
            }
            _meetupRepository.AddAddress(address);
            if (Commit())
            {
                _bus.RaiseEvent(new RegisteredMeetingMeetupAddress(address.Id, address.Street, address.Number, address.Complement, address.Neighborhood, address.CEP, address.City, address.State, address.MeetupId.Value));
            }
        }