Esempio n. 1
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     if (GlobalData.usedSubjects())
     {
         var editor = new SubjectEditor(null);
         editor.ShowDialog();
         if (editor.DialogResult == DialogResult.Yes)
         {
             GlobalData.useSubjects();
         }
     }
     else if (GlobalData.usedStudents())
     {
         var editor = new StudentEditor(null);
         editor.ShowDialog();
         if (editor.DialogResult == DialogResult.Yes)
         {
             GlobalData.useStudents();
         }
     }
 }
Esempio n. 2
0
 private void dgview_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (GlobalData.usedSubjects() && (GlobalData.Bind.Current is Subject))
     {
         var editor = new SubjectEditor(GlobalData.Bind.Current as Subject);
         editor.ShowDialog();
         if (editor.DialogResult == DialogResult.Yes)
         {
             GlobalData.useSubjects();
         }
     }
     else if (GlobalData.usedStudents() && (GlobalData.Bind.Current is Student))
     {
         var editor = new StudentEditor(GlobalData.Bind.Current as Student);
         editor.ShowDialog();
         if (editor.DialogResult == DialogResult.Yes)
         {
             GlobalData.useStudents();
         }
     }
 }