Exemple #1
0
        } // tsbQuery14_MouseEnter

        private void tsbQuery14_Click(object sender, EventArgs e)
        {
            if (dvwExams.SelectedRows == null)
            {
                return;
            }

            // индекс текущей строки
            int row = dvwExams.CurrentRow.Index;
            // id экзамена в выбранной строке
            int id = int.Parse(dvwExams[0, row].Value.ToString());

            string[] abProf = _queries.AbiturientProfessor(id).Split(' ');

            AddEditExamForm addEditExamForm = new AddEditExamForm(abProf[0], abProf[1], abProf[2],
                                                                  abProf[3], abProf[4], abProf[5], dvwExams.CurrentRow.Cells[4].Value.ToString(),
                                                                  (DateTime)dvwExams.CurrentRow.Cells[3].Value, int.Parse(dvwExams.CurrentRow.Cells[5].Value.ToString()));

            addEditExamForm.ShowDialog();

            if (addEditExamForm.DialogResult == DialogResult.OK)
            {
                tbcMain.SelectedTab = tbpExams;

                _queries.Query14(addEditExamForm.SurnameA, addEditExamForm.NameA, addEditExamForm.PatronymicA,
                                 addEditExamForm.SurnameP, addEditExamForm.NameP, addEditExamForm.PatronymicP,
                                 addEditExamForm.Subject, addEditExamForm.ExamDate, addEditExamForm.ExamGrade, id);

                dvwExams.DataSource = _queries.QueryShowExams();

                MessageBox.Show("Выбранная вами запись изменена",
                                "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
            } // if
        }     // tsbQuery14_Click
Exemple #2
0
        } // tsbQuery17_MouseEnter

        private void tsbQuery17_Click(object sender, EventArgs e)
        {
            AddEditExamForm addEditExamForm = new AddEditExamForm();

            addEditExamForm.ShowDialog();

            if (addEditExamForm.DialogResult == DialogResult.OK)
            {
                tbcMain.SelectedTab = tbpExams;

                _queries.Query17(addEditExamForm.SurnameA, addEditExamForm.NameA, addEditExamForm.PatronymicA,
                                 addEditExamForm.SurnameP, addEditExamForm.NameP, addEditExamForm.PatronymicP,
                                 addEditExamForm.Subject, addEditExamForm.ExamDate, addEditExamForm.ExamGrade);

                dvwExams.DataSource = _queries.QueryShowExams();

                MessageBox.Show("В конец добавлен новая запись о сданном экзамене",
                                "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
            } // if
        }     // tsbQuery17_Click