Esempio n. 1
0
        private void mostrarCalendarioUser(Cuenta u)
        {
            List <Evento> misEventos = u.ListaEventosUser();

            foreach (Evento e in misEventos)
            {
                string n = e.Nombre;
                string d = e.Descripcion;
                var    f =
                    _ = (e.Fecha != null) ? e.Fecha : "";

                var ev = new Calendar.NET.CustomEvent
                {
                    EventColor     = Color.Aquamarine,
                    EventTextColor = Color.Black,
                    Date           = DateTime.Parse((string)f),
                    EventText      = n,
                };

                calendar1.AddEvent(ev);
            }
        }
Esempio n. 2
0
        private void mostrarCalendario()
        {
            MySQLDB miBD = new MySQLDB();

            foreach (object[] tupla in miBD.Select("SELECT Nombre, Descripcion, Fecha FROM Evento;"))
            {
                string n = (string)tupla[0];
                string d = (string)tupla[1];
                var    f =
                    _ = (tupla[2] != null) ? tupla[2] : "";

                var ev = new Calendar.NET.CustomEvent
                {
                    EventColor     = Color.Aquamarine,
                    EventTextColor = Color.Black,
                    Date           = DateTime.Parse((string)f),
                    EventText      = n,
                };

                calendar1.AddEvent(ev);
            }
        }