예제 #1
0
        public void Process(DataCollectorAdded @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.Id) ?? new DataCollector(@event.Id);

            dataCollector.FirstName = @event.FirstName;
            dataCollector.LastName  = @event.LastName;
            dataCollector.Location  = new Location(@event.LocationLatitude, @event.LocationLongitude);
            _dataCollectors.Save(dataCollector);
        }
        public async Task Process(DataCollectorRegistered @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId) ?? new DataCollector(@event.DataCollectorId);

            dataCollector.FullName    = @event.FullName;
            dataCollector.DisplayName = @event.DisplayName;
            dataCollector.Location    = new Location(@event.LocationLatitude, @event.LocationLongitude);
            await _dataCollectors.Save(dataCollector);
        }
        public void Process(DataCollectorUpdated @event)
        {
            //TODO: Should be replaced with a new system
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId);

            dataCollector.FullName          = @event.FullName;
            dataCollector.DisplayName       = @event.DisplayName;
            dataCollector.Location          = new Location(@event.LocationLatitude, @event.LocationLongitude);
            dataCollector.NationalSociety   = @event.NationalSociety;
            dataCollector.PreferredLanguage = (Language)@event.PreferredLanguage;

            _dataCollectors.Save(dataCollector);
        }
예제 #4
0
        public void Process(DataCollectorAdded @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.Id) ?? new DataCollector(@event.Id);

            dataCollector.FullName          = @event.FullName;
            dataCollector.DisplayName       = @event.DisplayName;
            dataCollector.Location          = new Location(@event.LocationLatitude, @event.LocationLongitude);
            dataCollector.YearOfBirth       = @event.YearOfBirth;
            dataCollector.NationalSociety   = @event.NationalSociety;
            dataCollector.PreferredLanguage = (Language)@event.PreferredLanguage;
            dataCollector.Sex          = (Sex)@event.Sex;
            dataCollector.RegisteredAt = @event.RegisteredAt;
            _dataCollectors.Save(dataCollector);
        }
예제 #5
0
        public void Process(DataCollectorAdded @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.Id) ?? new DataCollector(@event.Id);

            dataCollector.FirstName         = @event.FirstName;
            dataCollector.LastName          = @event.LastName;
            dataCollector.Location          = new Location(@event.LocationLatitude, @event.LocationLongitude);
            dataCollector.Age               = @event.Age;
            dataCollector.NationalSociety   = @event.NationalSociety;
            dataCollector.PreferredLanguage = @event.PreferredLanguage;
            dataCollector.Sex               = @event.Sex;
            dataCollector.RegisteredAt      = @event.RegisteredAt;
            _dataCollectors.Save(dataCollector);
        }
예제 #6
0
 public void Process(DataCollectorRegistered @event)
 {
     _dataCollectors.Save(new DataCollector(@event.DataCollectorId)
     {
         DisplayName       = @event.DisplayName,
         FullName          = @event.FullName,
         Location          = new Location(@event.LocationLatitude, @event.LocationLongitude),
         YearOfBirth       = @event.YearOfBirth,
         Sex               = (Sex)@event.Sex,
         RegisteredAt      = @event.RegisteredAt,
         PreferredLanguage = (Language)@event.PreferredLanguage,
         PhoneNumbers      = new List <PhoneNumber>(),
         District          = @event.District,
         Region            = @event.Region
     });
 }
예제 #7
0
        public void Process(DataCollectorUpdated @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId);

            //TODO: Business Validator should check this(?)
            if (dataCollector == null)
            {
                return;
            }

            dataCollector.FullName          = @event.FullName;
            dataCollector.DisplayName       = @event.DisplayName;
            dataCollector.Location          = new Location(@event.LocationLatitude, @event.LocationLongitude);
            dataCollector.NationalSociety   = @event.NationalSociety;
            dataCollector.PreferredLanguage = (Language)@event.PreferredLanguage;

            _dataCollectors.Save(dataCollector);
        }
예제 #8
0
        public void Process(DataCollectorRegistered @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId) ?? new DataCollector(@event.DataCollectorId);

            dataCollector.FullName    = @event.FullName;
            dataCollector.DisplayName = @event.DisplayName;
            dataCollector.Location    = new Location(@event.LocationLatitude, @event.LocationLongitude);
            dataCollector.Region      = @event.Region ?? "Unknown";
            dataCollector.District    = @event.District ?? "Unknown";
            _dataCollectors.Save(dataCollector);
        }