private void btnConfirm_Click(object sender, EventArgs e) { if (IsBtnConfirmEnabled()) { try { mainController.AddClientDebt( new ClientDebt(clients.Find(client => client.Oib == ((Client)comboBoxClientInDebt.SelectedValue).Oib), numericUpDownAmount.Value, textBoxDescription.Text)); DialogResult = DialogResult.OK; } catch (IncompleteDataException) { MessageBox.Show("Nepotpuni ili neispravni podaci", "Greška!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }