Пример #1
0
        private void setUpSelectedInspection()
        {
            Inspection selectedInspection   = (Inspection)dgBuildingInspections.SelectedItem;
            var        inspectionDetailForm = new InspectionDetail(selectedInspection);
            var        inspectionUpdated    = inspectionDetailForm.ShowDialog();

            if (inspectionUpdated == true)
            {
                try
                {
                    inspections = inspectionManager.RetrieveAllInspectionsByResortPropertyId(selectedBuilding.ResortPropertyID);
                    dgBuildingInspections.ItemsSource = inspections;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Danielle Russo
        /// Created: 2019/03/14
        ///
        /// Opens a new window to add an inspection to the selected building.
        /// </summary>
        ///
        /// <remarks>
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddInspection_Click(object sender, RoutedEventArgs e)
        {
            var addInspectionForm = new InspectionDetail(selectedBuilding.ResortPropertyID);
            var inspectionAdded   = addInspectionForm.ShowDialog();

            if (inspectionAdded == true)
            {
                try
                {
                    inspections = inspectionManager.RetrieveAllInspectionsByResortPropertyId(selectedBuilding.ResortPropertyID);
                    dgBuildingInspections.ItemsSource = inspections;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("Inspection was not added.");
            }
        }