private void AcceptButton_Click(object sender, EventArgs e)
 {
     if (New)
     {
         if (controller.Insert(hall) > 0)
         {
             InsertedHalls.Add(hall);
             if (CustomMessages.YesNoNext(this, "lecture hall"))
             {
                 SetHall(new LectureHall());
             }
             else
             {
                 Close();
             }
         }
     }
     else
     {
         if (controller.Update(hall))
         {
             CustomMessages.Updated(this, "lecture hall");
             SetHall(hall);
         }
     }
 }
 private void AcceptButton_Click(object sender, EventArgs e)
 {
     if (New) //creating new subject
     {
         if (controller.Insert(subject) > 0)
         {
             InsertedSubjects.Add(subject);
             if (CustomMessages.YesNoNext(this, "subject"))
             {
                 SetSubject(new Subject());
             }
             else
             {
                 Close();
             }
         }
     }
     else //updating existed subject
     {
         if (controller.Update(subject))
         {
             CustomMessages.Updated(this, "subject");
             SetSubject(subject);
         }
     }
 }
 private void AcceptButton_Click(object sender, EventArgs e)
 {
     if (New)
     {
         if (controller.Insert(lecturer) > 0)
         {
             InsertedLecturers.Add(lecturer);
             if (CustomMessages.YesNoNext(this, "lecturer"))
             {
                 SetLecturer(new Lecturer());
             }
             else
             {
                 Close();
             }
         }
     }
     else
     {
         if (controller.Update(lecturer))
         {
             CustomMessages.Updated(this, "lecturer");
             SetLecturer(lecturer);
         }
     }
 }