private void buttonRegisterClient_Click(object sender, EventArgs e) { textBoxClient1_Validated(this, e); textBoxClient2_Validated(this, e); textBoxAddress_Validated(this, e); textBoxTelephone_Validated(this, e); if (textClient1.Text == "Vardas") { data.AddNewClient(true, textBoxClient1.Text, textBoxClient2.Text, textBoxAddress.Text, textBoxTelephone.Text); } else { data.AddNewClient(false, textBoxClient1.Text, textBoxClient2.Text, textBoxAddress.Text, textBoxTelephone.Text); } textBoxClient1.Text = ""; textBoxClient2.Text = ""; textBoxAddress.Text = ""; textBoxTelephone.Text = ""; data.PopulateListBoxClients(selectedClientPerson, listBoxClients); }