Ejemplo n.º 1
0
 /// <summary>
 /// Creator: Carl Davis
 /// Created: 3/12/2020
 /// Approver: Ethan Murphy 3/13/2020
 ///
 /// method to load facility maintenance data
 /// </summary>
 /// <remarks>
 /// Updater:
 /// Updated:
 /// Update:
 /// </remarks>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgFacilityInspection_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         if (dgFacilityInspection.ItemsSource == null)
         {
             dgFacilityInspection.ItemsSource       = _facilityInspectionManager.RetrieveAllFacilityInspection((bool)chkInspected.IsChecked);
             dgFacilityInspection.Columns[0].Header = "Facility Inspection ID";
             dgFacilityInspection.Columns[1].Header = "User ID";
             dgFacilityInspection.Columns[2].Header = "Inspector Name";
             dgFacilityInspection.Columns[3].Header = "Inspection Date";
             dgFacilityInspection.Columns[4].Header = "Inspection Description";
         }
     }
     catch (Exception ex)
     {
         WPFErrorHandler.ErrorMessage(ex.Message, "Retrieve");
     }
 }
        /// <summary>
        /// Creator: Carl Davis
        /// Created: 4/2/2020
        /// Approver: Ethan Murphy 4/3/2020
        ///
        /// displays the add facility inspection item canvas
        /// </summary>
        /// <remarks>
        /// Updater:
        /// Updated:
        /// Update:
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddFacilityInspectionItem_Click(object sender, RoutedEventArgs e)
        {
            canAddFacilityInspectionItem.Visibility = Visibility.Visible;
            txtUserID.Text = _user.PUUserID.ToString();
            List <FacilityInspection> facilityInspections = new List <FacilityInspection>();

            try
            {
                facilityInspections = _facilityInspectionManager.RetrieveAllFacilityInspection(false);
                List <string> inspectionIDs = new List <string>();
                foreach (var item in facilityInspections)
                {
                    inspectionIDs.Add(item.FacilityInspectionID.ToString());
                }

                cmbFacilityInspectionID.ItemsSource = inspectionIDs;
                canView.Visibility = Visibility.Hidden;
            }
            catch (Exception ex)
            {
                WPFErrorHandler.ErrorMessage(ex.Message, "Retrieve");
            }
        }