/// <summary> /// Opens the AddRepairForm so a new cleaning service can be added. /// </summary> /// <param name="sender">the object</param> /// <param name="e">The event</param> private void BtnAddCleaning_Click(object sender, EventArgs e) { AddCleaningForm addCleaningForm = new AddCleaningForm(this.serviceSystem); addCleaningForm.ShowDialog(); try { this.UpdateListBox(this.serviceSystem.GenerateList("Cleaning", LoggedInAccount.AccountLoggedIn.Depot)); } catch (Exception ecx) { this.ShowErrorMessage(ecx.Message + " The daylist could not be generated"); } }
/// <summary> /// Opens a AddCleaningForm. /// </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 MenuItemPlanCleaningService_Click(object sender, EventArgs e) { SectorTextBox stbx = (SectorTextBox)((MenuItem)sender).GetContextMenu().SourceControl; ServiceSystem serviceSystem = new ServiceSystem(); if (stbx.Sector.Tram != null) { AddCleaningForm addCleaningForm = new AddCleaningForm(this.tramDepotManagementSystem, stbx.Sector.Tram, serviceSystem); addCleaningForm.ShowDialog(); } else { this.ShowErrorMessage("There is no tram on this sector."); } }
/// <summary> /// Opens the AddRepairForm for the selected cleaning service. /// </summary> /// <param name="sender">the object</param> /// <param name="e">The event</param> private void BtnModifyCleaning_Click(object sender, EventArgs e) { CleaningService cleaningService = (CleaningService)lbCleaning.SelectedItem; AddCleaningForm addCleaningForm = new AddCleaningForm(this.serviceSystem, cleaningService); addCleaningForm.ShowDialog(); }