示例#1
0
 private void OkayButton_Click(object sender, EventArgs e)
 {
     preferred_times = TimetableControl.GetLectureTimes(TimetableControl.IsPreferredCell);
     denied_times    = TimetableControl.GetLectureTimes(TimetableControl.IsDeniedCell);
     if (preferred_times.Count > 0 || denied_times.Count > 0)
     {
         CustomMessages.OptionsSaved(this);
     }
     Hide();
 }
 private void OKButton_Click(object sender, EventArgs e)
 {
     if (preferred_lecturers_id.Intersect(denied_lecturers_id).Count() > 0)
     {
         MessageBox.Show(this, "You cannot mark a lecturer as both preferred and denied!",
                         "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
     }
     else if (preferred_lecturers_id.Count > 0 ||
              denied_lecturers_id.Count > 0)
     {
         CustomMessages.OptionsSaved(this);
         Hide();
     }
     else
     {
         Hide();
     }
 }