private void btnSubjectsDelete_Click(object sender, EventArgs e)
        {
            if (activeForm == null)
            {
                return;
            }

            if (activeForm is AddSubject)
            {
                AddSubject form    = activeForm as AddSubject;
                Subject    subject = form.activSubject;

                interpretor.DeleteSubject(subject);
                btnSubjectsAdd.PerformClick();
            }
            else if (activeForm is Subjects)
            {
                Subjects form    = activeForm as Subjects;
                Subject  subject = form.activSubject;

                interpretor.DeleteSubject(subject);
                btnSubjectsShow.PerformClick();
            }
            else if (activeForm is EditSubject)
            {
                EditSubject form    = activeForm as EditSubject;
                Subject     subject = form.activSubject;

                interpretor.DeleteSubject(subject);
                btnSubjectsEdit.PerformClick();
            }
        }
        private void btnSubjectsEdit_Click(object sender, EventArgs e)
        {
            if (activeForm == null)
            {
                EditSubject edit = new EditSubject(null);
                openForm(edit);
            }

            if (activeForm is AddSubject)
            {
                AddSubject form    = activeForm as AddSubject;
                Subject    subject = form.activSubject;

                EditSubject edit = new EditSubject(subject);
                openForm(edit);
            }
            else if (activeForm is Subjects)
            {
                Subjects form    = activeForm as Subjects;
                Subject  subject = form.activSubject;

                EditSubject edit = new EditSubject(subject);
                openForm(edit);
            }
            else if (activeForm is EditSubject)
            {
                EditSubject form    = activeForm as EditSubject;
                Subject     subject = form.activSubject;

                EditSubject edit = new EditSubject(subject);
                openForm(edit);
            }
        }
Beispiel #3
0
        private void editbtn_Click(object sender, EventArgs e)
        {
            EditSubject s = new EditSubject(su);

            s.ShowDialog();
        }