private void ComboBoxSmer_SelectedIndexChanged(object sender, EventArgs e) { smer = (Smer)comboBoxSmer.SelectedItem; }
private static void addSmer(Smer smer) { smerovi.Add(smer); }
public PredmetForm(Predmet predmet, Smer smer) { this.smer = smer; this.predmet = predmet; InitializeComponent(); comboBoxSmer.SelectedValueChanged += ComboBoxSmer_SelectedIndexChanged; checkedListBox1.ItemCheck += CheckedListBox1_ItemCheck; if (predmet != null) { popuniPolja(); textBoxID.Enabled = false; comboBoxSmer.Text = predmet.SmerPredmeta.ToString(); comboBoxSmer.Enabled = false; rezimRada = Rezim.Izmena; } else { if (smer == null) { rezimRada = Rezim.Dodavanje; foreach (Smer s in DataManger.getSmers()) { comboBoxSmer.Items.Add(s); } if (comboBoxSmer.Items.Count == 0) { comboBoxSmer.Enabled = false; } else { comboBoxSmer.SelectedIndex = 0; } } else { rezimRada = Rezim.DodavanjeNovomSmeru; comboBoxSmer.Items.Add(smer); comboBoxSmer.SelectedIndex = 0; comboBoxSmer.Enabled = false; } } popuniOpremaBox(); KeyPreview = true; KeyDown += (object sender, KeyEventArgs e) => { if (e.KeyCode == Keys.F1) { if (rezimRada == Rezim.Dodavanje || rezimRada == Rezim.DodavanjeNovomSmeru) { DataManger.goToHelp("dodavanjePredmet"); } else { DataManger.goToHelp("izmenaPredmet"); } } }; popuniSoftvere(); }