Пример #1
0
        //Modify a Teacher
        private void btnModify_Click(object sender, EventArgs e)
        {
            if (lblSelected.Text != "")
            {
                Teacher teacher = new Teacher();

                teacher.TeacherID = Convert.ToInt32(lblSelected.Text);
                teacher.FirstName = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                teacher.LastName  = dataGridView1.CurrentRow.Cells[2].Value.ToString();

                TeacherDB.TempSave(teacher);

                EditTeacher newForm = new EditTeacher();
                newForm.Show();
            }
            else
            {
                MessageBox.Show("Please select a teacher to modify");
            }
        }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            EditTeacher newForm = new EditTeacher();

            newForm.Show();
        }