Esempio n. 1
0
        private void Add_button_Click(object sender, EventArgs e)
        {
            ReloadInstructorsCategories();
            AddEditInstructorsCategoriesForm AddInstructorCategory = new AddEditInstructorsCategoriesForm(dataSet.InstructorsCategories,
                                                                                                          dataSet.Instructors, dataSet.Categories, null);

            AddInstructorCategory.Text = "Добавление категории инструктору";
            this.Enabled = false;
            AddInstructorCategory.ShowDialog();
            if (AddInstructorCategory.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteInstructorsCategories(dataSet);
                ReloadInstructorsCategories();
            }
            this.Enabled = true;
        }
Esempio n. 2
0
        private void Edit_button_Click(object sender, EventArgs e)
        {
            LastSelectionIndex = InstructorsCategories_dataGridView.SelectedRows[0].Index;
            ReloadInstructorsCategories();
            AddEditInstructorsCategoriesForm EditInstructorCategory = new AddEditInstructorsCategoriesForm(dataSet.InstructorsCategories,
                                                                                                           dataSet.Instructors, dataSet.Categories,
                                                                                                           dataSet.InstructorsCategories.Rows.Find(InstructorsCategories_dataGridView.SelectedRows[0].Cells["ID"].Value));

            EditInstructorCategory.Text = "Редактирование категории инструктора";
            this.Enabled = false;
            EditInstructorCategory.ShowDialog();
            if (EditInstructorCategory.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteInstructorsCategories(dataSet);
                ReloadInstructorsCategories();
            }
            this.Enabled = true;
        }