/// <summary> /// Author: Jared Greenfield /// Created On: 2019-04-25 /// Checkout all Guests /// </summary> private void BtnCheckoutAll_Click(object sender, RoutedEventArgs e) { try { var approvalForm = new frmConfirmAction(CrudFunction.Checkout); var approved = approvalForm.ShowDialog(); if (approved == true) { foreach (GuestRoomAssignmentVM assignment in _allGuests) { if (assignment.CheckOutDate == null) { var result = _roomAssignmentManager.UpdateGuestRoomAssignmentToCheckedOut(assignment.GuestID, assignment.RoomReservationID); if (result == true) { populateGrid(); } } } } } catch (Exception ex) { MessageBox.Show("Unable to checkout guest." + ex.Message); } }
/// <summary> /// Author: Jared Greenfield /// Created On: 2019-04-25 /// Checkout a Guest /// </summary> private void BtnCheckoutIndividual_Click(object sender, RoutedEventArgs e) { if (dgReservationGuests.SelectedItem != null) { var assignment = (GuestRoomAssignmentVM)dgReservationGuests.SelectedItem; try { var approvalForm = new frmConfirmAction(CrudFunction.Checkout); var approved = approvalForm.ShowDialog(); if (approved == true) { var result = _roomAssignmentManager.UpdateGuestRoomAssignmentToCheckedOut(assignment.GuestID, assignment.RoomReservationID); if (result == true) { populateGrid(); } else { MessageBox.Show("Checkout Failed!"); } } } catch (Exception) { MessageBox.Show("Unable to checkout guest."); } } else { MessageBox.Show("Please select a Guest to checkout."); } }
/// <summary> /// Author: Jared Greenfield /// Created On: 03/28/2019 /// Deletes the reccord. /// </summary> private void BtnDelete_Click(object sender, RoutedEventArgs e) { var form = new frmConfirmAction(CrudFunction.Delete); var permission = form.ShowDialog(); try { if (permission == true) { bool result = _offeringManager.DeleteOfferingByID(_offering.OfferingID); if (result == true) { this.DialogResult = true; } } } catch (Exception) { MessageBox.Show("This " + _offering.OfferingTypeID + " could not be deleted. Services and Events cannot be removed."); } }
private void BtnDeactivate_Click(object sender, RoutedEventArgs e) { if (btnDeactivate.Content.ToString() == "Deactivate") { try { var confirmPage = new frmConfirmAction(CrudFunction.Deactivate); bool?confirm = confirmPage.ShowDialog(); if (confirm == true) { try { _recipeManager.DeactivateRecipe(_oldRecipe.RecipeID); MessageBox.Show("Deactivation success"); _oldRecipe.Active = false; SetupEditPage(); } catch (Exception) { MessageBox.Show("Deactivation cancelled or failed."); } } else { MessageBox.Show("Deactivation cancelled or failed."); } } catch (Exception) { throw; } } else if (btnDeactivate.Content.ToString() == "Reactivate") { try { var confirmPage = new frmConfirmAction(CrudFunction.Reactivate); bool?confirm = confirmPage.ShowDialog(); if (confirm == true) { try { _recipeManager.ReactivateRecipe(_oldRecipe.RecipeID); MessageBox.Show("Reactivation success"); _oldRecipe.Active = true; SetupEditPage(); } catch (Exception) { MessageBox.Show("Reactivation cancelled or failed."); } } else { MessageBox.Show("Reactivation cancelled or failed."); } } catch (Exception) { throw; } } }