private void Btn_edit_Click(object sender, EventArgs e) { string[] words = Cmb_workers.SelectedItem.ToString().Split(' '); string worker_name = words[0]; string worke_surname = words[1]; string name = Txt_nam_edit.Text; string surname = Txt_sur_edit.Text; if (Txt_phone_edit.Text.Length > 8 && Txt_phone_edit.Text.Length < 13) { string phone = Txt_phone_edit.Text; api.updateWorker(name, surname, phone, worker_name, worke_surname, api.getAllWorkers()); Display(); } else { MessageBox.Show("Vnesi veljavno telefonsko številko"); } }