/// <summary> /// @Author: Phillip Hansen /// /// When an event record is selected /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgEvents_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (dgEvents.SelectedIndex > -1) { var selectedEvent = (Event)dgEvents.SelectedItem; if (selectedEvent == null) { MessageBox.Show("No Event Selected!"); } else { var detailA = new frmAddEditEvent(_employee, selectedEvent); detailA.ShowDialog(); if (detailA.DialogResult == true) { populateEvents(); } } } else { MessageBox.Show("No event selected!"); } }
/// <summary> /// @Author: Phillip Hansen /// /// Code for when the 'create' button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnCreateEvReq_Click(object sender, RoutedEventArgs e) { //The Form requires the User's ID for a field in the record var addEventReq = new frmAddEditEvent(_employee); var result = addEventReq.ShowDialog(); if (result == true) { populateEvents(); } }