private void btn_addSubject_Click(object sender, EventArgs e) { if (tb_subjectName.Text == String.Empty) { MessageBox.Show("Поле \"Назва предмету\" пусте! Заповність його!", "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); tb_subjectName.Focus(); return; } Subject subject = new Subject(tb_subjectName.Text); try { _proxy.AddSubject(subject); tb_subjectName.Text = String.Empty; LoadSubjects(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Повідомлення", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }