Beispiel #1
0
        public cComboItem[] Periodicita_cComboItems()
        {
            var x = -1;
            var v = new cComboItem[Periodicita.Count];

            foreach (var p in Periodicita.Keys)
            {
                v[x += 1] = new cComboItem($"{p}", Periodicita[p]);
            }

            return(v);
        }
Beispiel #2
0
        private string SelezionaElemento()
        {
            var        s   = "";
            cComboItem sel = null;

            if (cCalendar1.SelectedID.Count == 1)
            {
                var idj = cCalendar1.SelectedID[0];
                DB.DataWrapper.cCalendario cal = new DB.DataWrapper.cCalendario(idj);
                sel = new cComboItem(idj, cal.Descrizione);
            }
            else if (cCalendar1.SelectedID.Count > 1)
            {
                var idj = "";
                var ite = new cComboItem[cCalendar1.SelectedID.Count];

                for (var i = 0; i < cCalendar1.SelectedID.Count; i++)
                {
                    idj = cCalendar1.SelectedID[i];
                    DB.DataWrapper.cCalendario cal = new DB.DataWrapper.cCalendario(idj);
                    ite[i] = new cComboItem(idj, cal.Descrizione);
                }

                using (var ev = new fSceltaEvento())
                {
                    ev.Elementi = ite;

                    if (ev.ShowDialog() == DialogResult.OK)
                    {
                        sel = ev.Selezionato;
                    }
                }
            }

            if (sel != null)
            {
                s = sel.ID;
            }

            return(s);
        }
Beispiel #3
0
 private void bOK_Click(object sender, EventArgs e)
 {
     Selezionato  = (cComboItem)cbEventi.SelectedItem;
     DialogResult = DialogResult.OK;
 }