Example #1
0
        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();
            }
        }
Example #2
0
        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();
            }
        }