void HandleUpdateViolation(object sender, ProtocolViolationEventArgs e)
        {
            var assdVM = ((List <ParticipantListItemViewModel>)AllParticipants.SourceCollection)
                         .First(p => p.Id == e.Violation.ParticipantId);

            AllParticipants.EditItem(assdVM);
            assdVM.RecalculateDataRequired();
            AllParticipants.CommitEdit();
        }
        void HandleAddOrUpdateViolation(object sender, ProtocolViolationEventArgs e)
        {
            var assdVM = ((List <ParticipantListItemViewModel>)AllParticipants.SourceCollection)
                         .First(p => p.Id == e.Violation.ParticipantId);

            AllParticipants.EditItem(assdVM);
            if (e.EventType == CRUD.Updated)
            {
                assdVM.ProtocolViolations.Remove(assdVM.ProtocolViolations.First(v => v.Id == e.Violation.Id));
            }
            assdVM.ProtocolViolations.Add(e.Violation);
            assdVM.RecalculateDataRequired();
            AllParticipants.CommitEdit();
        }
Beispiel #3
0
 void _repository_ProtocolViolationAddOrUpdate(object sender, ProtocolViolationEventArgs e)
 {
     handleParrticipantUpdated(_repository.FindParticipantAndCollections(e.Violation.ParticipantId));
 }