예제 #1
0
        // GET: Agenda
        public ActionResult Index(string data)
        {
            List <Evento> eventoList;
            Dictionary <string, Evento> EventosHash = new Dictionary <string, Evento>();

            for (int i = 0; i < 24; i++)
            {
                string key1 = (i < 10) ? "0" + i + ":00" : i + ":00";
                string key2 = (i < 10) ? "0" + i + ":30" : i + ":30";
                EventosHash[key1] = null;
                EventosHash[key2] = null;
            }

            if (data != null && !data.Equals(""))
            {
                eventoList = EDao.GetEventosByData(data);
                foreach (Evento e in eventoList)
                {
                    EventosHash[String.Format("{0:t}", e.Data)] = e;
                }
                ViewBag.EventoList = eventoList;
            }
            ViewBag.EventosHash = EventosHash;
            return(View());
        }