Example #1
0
 private void SubjectForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (NoSave)
     {
         DialogResult result = MessageBox.Show("Сохранить изменения?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
         if (result == DialogResult.Yes)
         {
             Subjects.Save();
         }
         else if (result == DialogResult.No)
         {
             Subjects.Load();
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
Example #2
0
 private void SaveSubjectsButton_Click(object sender, EventArgs e)
 {
     Subjects.Save();
     NoSave = false;
     subjectGridView.DataSource = Subjects.Items.ToList();
 }