public void Process(DataCollectorUserInformationChanged @event, EventSourceId dataCollectorId)
        {
            var dataCollector = _dataCollectors.GetById(dataCollectorId.Value);

            dataCollector.Region      = @event.Region;
            dataCollector.District    = @event.District;
            dataCollector.DisplayName = @event.DisplayName;
            _dataCollectors.Update(dataCollector);
        }
 public void Process(DataCollectorUserInformationChanged @event)
 {
     var updateRes = _dataCollectors.ChangeUserInformation(
         @event.DataCollectorId,
         @event.FullName,
         @event.DisplayName,
         @event.Region,
         @event.District);
 }
Exemple #3
0
 public void Process(DataCollectorUserInformationChanged @event)
 {
     _dataCollectors.Update(d => d.Id == (DataCollectorId)@event.DataCollectorId, Builders <DataCollector> .Update.Combine(
                                Builders <DataCollector> .Update.Set(d => d.FullName, @event.FullName),
                                Builders <DataCollector> .Update.Set(d => d.DisplayName, @event.DisplayName),
                                Builders <DataCollector> .Update.Set(d => d.Sex, (Sex)@event.Sex),
                                Builders <DataCollector> .Update.Set(d => d.YearOfBirth, @event.YearOfBirth),
                                Builders <DataCollector> .Update.Set(d => d.District, @event.District),
                                Builders <DataCollector> .Update.Set(d => d.Region, @event.Region))
                            );
 }
        public void Process(DataCollectorUserInformationChanged @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId);

            dataCollector.Region      = @event.Region;
            dataCollector.District    = @event.District;
            dataCollector.Village     = "";
            dataCollector.DisplayName = @event.DisplayName;

            _dataCollectors.Update(dataCollector);
        }
Exemple #5
0
        public void Process(DataCollectorUserInformationChanged @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId);

            dataCollector.FullName    = @event.FullName;
            dataCollector.DisplayName = @event.DisplayName;
            dataCollector.Sex         = (Sex)@event.Sex;
            dataCollector.YearOfBirth = @event.YearOfBirth;
            dataCollector.District    = @event.District;
            dataCollector.Region      = @event.Region;

            _dataCollectors.Update(dataCollector);
        }
        public void Process(DataCollectorUserInformationChanged @event)
        {
            var res = _dataCollectors.UpdateOne(
                Builders <DataCollector> .Filter.Where(d => d.DataCollectorId == @event.DataCollectorId),
                Builders <DataCollector> .Update.Combine(
                    Builders <DataCollector> .Update.Set(d => d.FullName, @event.FullName),
                    Builders <DataCollector> .Update.Set(d => d.DisplayName, @event.DisplayName),
                    Builders <DataCollector> .Update.Set(d => d.Sex, (Sex)@event.Sex),
                    Builders <DataCollector> .Update.Set(d => d.YearOfBirth, @event.YearOfBirth),
                    Builders <DataCollector> .Update.Set(d => d.District, @event.District),
                    Builders <DataCollector> .Update.Set(d => d.Region, @event.Region))
                );

            if (res.IsModifiedCountAvailable && res.MatchedCount < 1)
            {
                throw new Exception("Data collector with id " + @event.DataCollectorId + " was not found");
            }
        }
Exemple #7
0
 public void Process(DataCollectorUserInformationChanged @event)
 {
     _dataCollectors.ChangeUserInformation(@event.DataCollectorId, @event.FullName, @event.DisplayName, @event.Region ?? "Unknown", @event.District ?? "Unknown");
 }