Beispiel #1
0
        public ActionResult Alterar(Guid frequencia)
        {
            List <SelectListItem> nullList = new List <SelectListItem>();

            nullList.Add(new SelectListItem()
            {
                Value = null, Text = null
            });
            var aulasAux = AulaRepository.Instance.GetDropDownList(true);

            foreach (var aulaAux in aulasAux)
            {
                if (!GenericFunctions.IsNull(aulaAux))
                {
                    nullList.Add(new SelectListItem()
                    {
                        Value = aulaAux.Id.ToString(), Text = String.Format("{0:dd/MM/yyyy HH:mm}", aulaAux.DataEHoraInicio) + " a " + String.Format("{0:dd/MM/yyyy HH:mm}", aulaAux.DataEHoraFinal)
                    });
                }
            }
            ViewBag.aulas = new SelectList(nullList, "Value", "Text");

            Frequencia frequenciaRetorno = FrequenciaRepository.Instance.GetById(frequencia);

            return(View(frequenciaRetorno));
        }
Beispiel #2
0
        public ActionResult Adicionar()
        {
            List <SelectListItem> nullList = new List <SelectListItem>();

            nullList.Add(new SelectListItem()
            {
                Value = null, Text = null
            });
            var aulasAux = AulaRepository.Instance.GetDropDownList(true);

            foreach (var aulaAux in aulasAux)
            {
                if (!GenericFunctions.IsNull(aulaAux))
                {
                    nullList.Add(new SelectListItem()
                    {
                        Value = aulaAux.Id.ToString(), Text = aulaAux.DataEHoraInicio.Value.ToString() + " a " + aulaAux.DataEHoraFinal.Value.ToString()
                    });
                }
            }
            ViewBag.aulas = new SelectList(nullList, "Value", "Text");
            return(View());
        }