示例#1
0
 /// <summary>
 /// Opens the AddRepairForm so a new repair service can be added.
 /// </summary>
 /// <param name="sender">the object</param>
 /// <param name="e">The event</param>
 private void BtnAddRepair_Click(object sender, EventArgs e)
 {
     AddRepairForm arf = new AddRepairForm(this.servicesystem);
     arf.ShowDialog();
     try
     {
         this.UpdateListBox(this.servicesystem.GenerateList("Repair", LoggedInAccount.AccountLoggedIn.Depot));
     }
     catch (Exception ecx)
     {
         this.ShowErrorMessage(ecx.Message + " The daylist could not be generated");
     }
 }
        /// <summary>
        /// Opens a AddRepairForm.
        /// </summary>
        /// <param name="sender">contains a reference to the clicked context menu item.</param>
        /// <param name="e">contains the data from the click event.</param>
        private void MenuItemPlanRepairService_Click(object sender, EventArgs e)
        {
            SectorTextBox stbx = (SectorTextBox)((MenuItem)sender).GetContextMenu().SourceControl;
            ServiceSystem serviceSystem = new ServiceSystem();

            if (stbx.Sector.Tram != null)
            {
                AddRepairForm addRepairForm = new AddRepairForm(this.tramDepotManagementSystem, stbx.Sector.Tram, serviceSystem);
                addRepairForm.ShowDialog();
            }
            else
            {
                this.ShowErrorMessage("There is no tram on this sector.");
            }
        }
示例#3
0
 /// <summary>
 /// Opens the AddRepairForm for the selected repair service.
 /// </summary>
 /// <param name="sender">the object</param>
 /// <param name="e">The event</param>
 private void BtnModifyRepair_Click(object sender, EventArgs e)
 {
     RepairService repairService = (RepairService)lbRepair.SelectedItem;
     AddRepairForm addRepairForm = new AddRepairForm(this.servicesystem, repairService);
     addRepairForm.ShowDialog();
 }