Esempio n. 1
0
 private void refreshStaffCombo()
 {
     staffComboList = StaffFunctions.GetStaffList(activeOnly: false, nameContains: "", roleCode: "", entityID: Globals.CurrentEntityID);
     staffComboList.Insert(0, Globals.AllStaff);
     StaffCombo.ItemsSource  = staffComboList;
     StaffCombo.SelectedItem = Globals.AllStaff;
 }
 private void viewEntitiesByStaffMember()
 {
     editMode = ByStaff;
     toggleSelectionControls(false);
     try
     {
         var staffComboList = StaffFunctions.GetStaffList(activeOnly, nameContains, "", 0);
         var staffNames     = staffComboList.Select(sg => sg.StaffName);
         StaffCombo.ItemsSource   = staffNames;
         selectedStaffName        = StaffFunctions.GetSelectedName();
         StaffCombo.SelectedValue = selectedStaffName;
         refreshEntitySummaries(true);
     }
     catch (Exception generalException)
     {
         MessageFunctions.Error("Error populating staff list", generalException);
         return;
     }
 }
 private void refreshNamesList()
 {
     try
     {
         exactName = false;
         string nameLike = NameLike.Text;
         if (nameLike == "")
         {
             PossibleNames.Visibility = Visibility.Hidden;
         }
         else
         {
             PossibleNames.Visibility  = Visibility.Visible;
             staffDropList             = StaffFunctions.GetStaffList(activeOnly: false, nameContains: nameLike, roleCode: "", entityID: Globals.CurrentEntityID);
             PossibleNames.ItemsSource = staffDropList;
         }
     }
     catch (Exception generalException) { MessageFunctions.Error("Error processing name change", generalException); }
 }
Esempio n. 4
0
        private void refreshStaffGrid()
        {
            try
            {
                int entityFilterID         = (pageMode == PageFunctions.Lookup) ? Globals.CurrentEntityID : 0;
                List <StaffProxy> gridList = StaffFunctions.GetStaffList(activeOnly, nameContains, roleCode, entityFilterID);
                StaffDataGrid.ItemsSource = gridList.OrderBy(gl => gl.UserID).OrderBy(gl => gl.StaffName);

                if (selectedStaffID > 0)
                {
                    try
                    {
                        if (gridList.Exists(s => s.ID == selectedStaffID))
                        {
                            StaffDataGrid.SelectedItem = gridList.First(s => s.ID == selectedStaffID);
                            StaffDataGrid.ScrollIntoView(StaffDataGrid.SelectedItem);
                        }
                    }
                    catch (Exception generalException) { MessageFunctions.Error("Error selecting record", generalException); }
                }
            }
            catch (Exception generalException) { MessageFunctions.Error("Error filling staff grid", generalException); }
        }
        // Data retrieval //

        // Other/shared functions //
        private void refreshStaffDataGrid()
        {
            try
            {
                var gridList = StaffFunctions.GetStaffList(activeOnly, nameContains, "", selectedEntityID);
                StaffDataGrid.ItemsSource = gridList;

                if (selectedStaffID > 0)
                {
                    try
                    {
                        if (gridList.Exists(s => s.ID == selectedStaffID))
                        {
                            StaffDataGrid.SelectedItem = gridList.First(s => s.ID == selectedStaffID);
                            StaffDataGrid.ScrollIntoView(StaffDataGrid.SelectedItem);
                        }
                    }
                    catch (Exception generalException) { MessageFunctions.Error("Error selecting record", generalException); }
                }

                // refreshStaffSummaries(true);
            }
            catch (Exception generalException) { MessageFunctions.Error("Error filling staff grid", generalException); }
        }
 private void refreshStaffCombo()
 {
     staffComboList         = StaffFunctions.GetStaffList(activeOnly: true, nameContains: "", roleCode: "", entityID: Globals.CurrentEntityID);
     StaffCombo.ItemsSource = staffComboList;
 }