private void btnSave_Click(object sender, EventArgs e) { if (EmptyChecker.TryTextFieldsEmpty(Controls)) { MessageBox.Show("Please make sure you enter a value for all text fields", "Value empty error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } TextBoxParser.TextBoxChecker(Controls); if (!_memberRepo.EditMember(_memberRepo.GetAllMembers()[_index].MemberId, nameTextBox.Text, surnameTextBox.Text, dateOfBirthPicker.Value, isProfessorCheckBox.Checked, _institutionRepo.GetInstitutionByName(institutionComboBox.Text))) { MessageBox.Show("This person is already an member", "Member exists error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } SetData(); }