/// <summary> /// Pat Banks /// Created: 2015/04/26 /// /// Sends the eventType that user wants to edit to the BusinessLogic Layer /// Returns an indication of whether or not the transaction was successful /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnAddType_Click(object sender, RoutedEventArgs e) { if (!TxtAddEventType.Text.ValidateString()) { ShowInputErrorMessage(TxtAddEventType, "Please enter a valid event type. No spaces allowed."); } try { _result = _eventManager.AddNewEventType(TxtAddEventType.Text); if (_result.Equals(EventManager.EventResult.Success)) { await ShowMessage("Your Request was Processed Successfully", "Success"); TxtAddEventType.Text = ""; FillComboBox(); } else { await ShowMessage("Event type could not be added.", "Error"); } } catch (Exception ex) { ShowErrorMessage(ex.Message, "Error Adding Event Type"); } }
/// <summary> /// Pat Banks /// Created: 2015/04/26 /// /// Sends the eventType that user wants to edit to the BusinessLogic Layer /// Returns an indication of whether or not the transaction was successful /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnEditType_Click(object sender, RoutedEventArgs e) { if (!TxtEditEventType.Text.ValidateString()) { ShowInputErrorMessage(TxtEditEventType, "Please enter a valid Event Type"); } var oldEventType = (Common.EventType)CboEditEvent.SelectedItem; var newEventType = new Common.EventType(oldEventType.EventTypeID, TxtEditEventType.Text); _result = _eventManager.EditEventType(oldEventType, newEventType); if (_result.Equals(EventManager.EventResult.Success)) { await ShowMessage("Your Request was Processed Successfully", "Success"); CboEditEvent.SelectedIndex = -1; TxtEditEventType.Text = ""; FillComboBox(); } else { await ShowMessage("Event type could not be updated.", "Error"); } }
/// <summary> /// Pat Banks /// Created: 2015/04/26 /// /// Sends the eventType that user wants to archive to the BusinessLogic Layer /// Returns an indication of whether or not the transaction was successful /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnArchiveType_Click(object sender, RoutedEventArgs e) { var archiveEventType = (Common.EventType)CboArchiveEvent.SelectedItem; _result = _eventManager.ArchiveAnEventType(archiveEventType); if (_result.Equals(EventManager.EventResult.Success)) { await ShowMessage("Your Request was Processed Successfully", "Success"); CboArchiveEvent.SelectedIndex = -1; FillComboBox(); } else { await ShowMessage("Event type could not be updated.", "Error"); } }