예제 #1
0
        private void btnEditEvent_Click(object sender, RoutedEventArgs e)
        {
            var selectedEvent = (Event)dgEvents.SelectedItem;

            // check if we actually have a selected event
            if (selectedEvent == null)
            {
                MessageBox.Show("Please select an event to edit");
                return;
            }
            var editEventForm = new frmAddEditEvent(_eventManager, _user, selectedEvent);
            var result        = editEventForm.ShowDialog();

            if (result == true)
            {
                // the data was stored, so get new event list
                try
                {
                    refreshEventsByComboBox();
                }
                catch (Exception)
                {
                    MessageBox.Show("Unable to refresh table data");
                }
                refreshEventTable();
            }
        }
예제 #2
0
        private void btnAddEvent_Click(object sender, RoutedEventArgs e)
        {
            var addEventForm = new frmAddEditEvent(_eventManager, _user);
            var result       = addEventForm.ShowDialog();

            if (result == true)
            {
                // the data was stored, so get new event list
                try
                {
                    //_events = _eventManager.GetActiveEvents();
                    refreshEventsByComboBox();
                }
                catch (Exception)
                {
                    MessageBox.Show("Unable to refresh table data");
                }
                refreshEventTable();
            }
        }