public void RefreshList(Imenik i) { if (sort == "") { i.OdpriImenik(i.ime); } else if (sort == "NAME") { i.SortirajPoImenu(false); } else if (sort == "LASTNAME") { i.SortirajPoPriimku(false); } else if (sort == "REVERSENAME") { i.SortirajPoImenu(true); } else if (sort == "REVERSELASTNAME") { i.SortirajPoPriimku(true); } listBox1.Items.Clear(); foreach (Oseba o in i.SeznamOseb) { string neki = o.ime + " " + o.priimek + ", " + o.naslov + ", " + o.telefonska + ", " + o.email; listBox1.Items.Add(neki); } button_editOseba.Enabled = false; button_deletOseba.Enabled = false; }
private void comboBox_imeniki_SelectedIndexChanged(object sender, EventArgs e) { i = new Imenik(comboBox_imeniki.SelectedItem.ToString()); i.OdpriImenik(i.ime); groupBox1.Enabled = true; RefreshList(i); button_editOseba.Enabled = false; button_deletOseba.Enabled = false; }