private void addButton_Click(object sender, EventArgs e)
        {
            var newEvent = new EmergencyEvent
            {
                Name          = nameTextBox.Text,
                Description   = descriptionRichTextBox.Text,
                InfoSourceId  = ((InfoSource)infoSourceComboBox.SelectedValue).Id,
                OccuranceDate = occuranceDatePicker.Value
            };

            Enum.TryParse(typeComboBox.SelectedValue.ToString(), out EmergencyEventType type);
            newEvent.EventType = type;

            _eventRepository.Create(newEvent);
            _eventRepository.Save();

            EmergencyEventAddedEvent?.Invoke(this, new EmergencyEventAddedEventArgs(newEvent));
        }
 public void AddEvent(EmergencyEvent eventItem)
 {
     _eventRepository.Create(eventItem);
     EventItemAddedEvent?.Invoke(eventItem);
     _eventRepository.Save();
 }
 public EmergencyEventAddedEventArgs(EmergencyEvent emergencyEvent)
 {
     EmergencyEvent = emergencyEvent;
 }