public GB.cComboItem[] Periodicita_cComboItems() { var x = -1; var v = new GB.cComboItem[Periodicita.Count]; foreach (var p in Periodicita.Keys) { v[x += 1] = new GB.cComboItem($"{p}", Periodicita[p]); } return(v); }
private string SelezionaElemento() { var s = ""; GB.cComboItem sel = null; if (this.cCalendar1.SelectedID.Count == 1) { var idj = this.cCalendar1.SelectedID[0]; DB.DataWrapper.cCalendario cal = new DB.DataWrapper.cCalendario(idj); sel = new GB.cComboItem(idj.ToString(), cal.Descrizione); } else if (this.cCalendar1.SelectedID.Count > 1) { var idj = ""; var ite = new GB.cComboItem[this.cCalendar1.SelectedID.Count]; for (var i = 0; i < this.cCalendar1.SelectedID.Count; i++) { idj = this.cCalendar1.SelectedID[i]; DB.DataWrapper.cCalendario cal = new DB.DataWrapper.cCalendario(idj); ite[i] = new GB.cComboItem(idj.ToString(), cal.Descrizione); } using (var ev = new Forms.fSceltaEvento()) { ev.Elementi = ite; if (ev.ShowDialog() == DialogResult.OK) { sel = ev.Selezionato; } } } if (sel != null) { s = sel.ID; } return(s); }
private void bOK_Click(object sender, EventArgs e) { Selezionato = (GB.cComboItem)cbEventi.SelectedItem; this.DialogResult = System.Windows.Forms.DialogResult.OK; }