private void buttonSave_Click(object sender, EventArgs e) { if (textBoxInfo.Text == "" && comboBoxPatient.SelectedIndex >= 0 && comboBoxDoctor.SelectedIndex >= 0) { ControlFunctions.EditRecord(record, comboBoxDoctor.Text, comboBoxPatient.Text, textBoxInfo.Text, datePicker.Text, timePicker.Text); this.Close(); } else { MessageBox.Show("Заполните поля"); } }