/// <summary>
        /// Author: Dalton Cleveland
        /// Created : 2/21/2019
        /// The function which runs when Add is clicked
        /// </summary>
        private void btnAddMaintenanceWorkOrder_Click(object sender, RoutedEventArgs e)
        {
            var createMaintenanceWorkOrder = new CreateMaintenanceWorkOrder(_maintenanceWorkOrderManager);

            createMaintenanceWorkOrder.ShowDialog();
            refreshAllMaintenanceWorkOrders();
            populateMaintenanceWorkOrders();
        }
Exemple #2
0
        private void selectMaintenanceTicket()
        {
            MaintenanceWorkOrder ticket = (MaintenanceWorkOrder)dgBuildingMaintenance.SelectedItem;

            var detailForm  = new CreateMaintenanceWorkOrder(ticket, maintenanceManager);
            var formUpdated = detailForm.ShowDialog();

            if (formUpdated == true)
            {
                try
                {
                    setUpMaintainanceTab();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
 /// <summary>
 /// Author: Dalton Cleveland
 /// Created : 2/21/2019
 /// The function which runs when the view MaintenanceWorkOrder button is clicked.
 /// It will launch the CreateMaintenanceWorkOrder window in view mode with the option of updating
 /// </summary>
 private void btnViewMaintenanceWorkOrder_Click(object sender, RoutedEventArgs e)
 {
     if (dgMaintenanceWorkOrders.SelectedIndex != -1)
     {
         MaintenanceWorkOrder selectedMaintenanceWorkOrder = new MaintenanceWorkOrder();
         try
         {
             selectedMaintenanceWorkOrder = _maintenanceWorkOrderManager.RetrieveMaintenanceWorkOrder(((MaintenanceWorkOrder)dgMaintenanceWorkOrders.SelectedItem).MaintenanceWorkOrderID);
             var readUpdateMaintenanceWorkOrder = new CreateMaintenanceWorkOrder(selectedMaintenanceWorkOrder, _maintenanceWorkOrderManager);
             readUpdateMaintenanceWorkOrder.ShowDialog();
             refreshAllMaintenanceWorkOrders();
             populateMaintenanceWorkOrders();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Unable to find that Maintenance Work Order\n" + ex.Message);
         }
     }
 }
Exemple #4
0
        private void btnAddMaintenance_Click(object sender, RoutedEventArgs e)
        {
            var addTicketForm = new CreateMaintenanceWorkOrder(maintenanceManager);
            var ticketAdded   = addTicketForm.ShowDialog();


            if (ticketAdded == true)
            {
                try
                {
                    setUpMaintainanceTab();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("Inspection was not added.");
            }
        }