private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     if (StaffFunctions.IgnoreAnyChanges())
     {
         StaffFunctions.ClearAnyChanges();
         PageFunctions.ShowTilesPage();
     }
 }
 private void StaffCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (StaffFunctions.IgnoreAnyChanges())
     {
         StaffFunctions.ClearAnyChanges();
         selectedStaffName           = StaffCombo.SelectedItem.ToString();
         Globals.SelectedStaffMember = StaffFunctions.GetStaffMemberByName(selectedStaffName);
         selectedStaffID             = Globals.SelectedStaffMember.ID;
         refreshEntitySummaries(true);
     }
 }
 private void togglActiveOnly(bool isChecked)
 {
     activeOnly = isChecked;
     refreshStaffDataGrid();
     if (StaffTo.Visibility == Visibility.Visible)
     {
         if (StaffFunctions.IgnoreAnyChanges())
         {
             StaffFunctions.ClearAnyChanges();
             refreshStaffSummaries(true);
         }
     }
 }
 private void EntityCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (EntityCombo.SelectedItem == null)
     {
         return;
     }                         // Do nothing, won't be for long
     if (resetEntitySelection) // Avoids immediate re-processing if set back to previous selection
     {
         resetEntitySelection = false;
         return;
     }
     if (StaffFunctions.IgnoreAnyChanges())
     {
         StaffFunctions.ClearAnyChanges();
         Entities selectedRecord = (Entities)EntityCombo.SelectedItem;
         if (selectedRecord.EntityName == Globals.AllRecords)
         {
             selectedEntityID      = 0;
             selectedEntity        = null;
             StaffButton.IsEnabled = false;
         }
         else
         {
             try
             {
                 selectedEntity        = selectedRecord;
                 selectedEntityID      = selectedEntity.ID;
                 StaffButton.IsEnabled = true;
             }
             catch (Exception generalException)
             {
                 MessageFunctions.Error("Error changing entity selection", generalException);
                 selectedEntityID      = 0;
                 selectedEntity        = null;
                 StaffButton.IsEnabled = false;
             }
         }
         refreshStaffDataGrid();
         refreshStaffSummaries(true);
     }
     else
     {
         resetEntitySelection     = true; // If the user cancels the change, don't re-process
         EntityCombo.SelectedItem = entityComboList.FirstOrDefault(p => p.ID == selectedEntityID);
     }
 }
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     if (StaffFunctions.IgnoreAnyChanges())
     {
         StaffFunctions.ClearAnyChanges();
         if (backSource == "StaffPage")
         {
             StaffFunctions.ReturnToStaffPage(selectedStaffID, sourceMode);
         }
         else
         {
             refreshEntityCombo(true);
             //refreshStaffDataGrid();
             toggleSelectionControls(true);
             PageHeader.Content = defaultPageHeader;
         }
     }
 }