private void addGuideToOperationButton_Click(object sender, EventArgs e) { var addGuideToOperationForm = new AddGuideToOperationForm(); addGuideToOperationForm.ShowDialog(); if (addGuideToOperationForm.FormResult == System.Windows.Forms.DialogResult.Yes) { MainForm.programLogic.guideToOperationsLogic.Insert(new GuideToOperation(addGuideToOperationForm.GuideToOperationText)); UpdateList(); } }
private void editGuideToOperationButton_Click(object sender, EventArgs e) { if (guideToOperationsListBox.SelectedIndex == -1) { MessageBox.Show("Выберите справку по операции из списка.", "Предупреждение"); return; } var addGuideToOperationForm = new AddGuideToOperationForm(MainForm.programLogic.guideToOperationsLogic[guideToOperationsListBox.SelectedIndex].Name); addGuideToOperationForm.ShowDialog(); if (addGuideToOperationForm.FormResult == System.Windows.Forms.DialogResult.Yes) { MainForm.programLogic.guideToOperationsLogic.Update( MainForm.programLogic.guideToOperationsLogic[guideToOperationsListBox.SelectedIndex], addGuideToOperationForm.GuideToOperationText); UpdateList(); } }