Exemple #1
0
        public ActionResult Index(Guid?id, string nomeCronograma = null)
        {
            if (id.HasValue)
            {
                return(RetornarActionResult(CronogramaBo.ConsultarCronogramaPorOidDto(id.Value), JsonRequestBehavior.AllowGet));
            }

            if (!string.IsNullOrWhiteSpace(nomeCronograma))
            {
                using (WexDb contexto = ContextFactoryManager.CriarWexDb())
                {
                    return(RetornarActionResult(CronogramaBo.ConsultarCronogramaPorNomeDto(contexto, nomeCronograma), JsonRequestBehavior.AllowGet));
                }
            }
            return(RetornarActionResult(CronogramaBo.ConsultarCronogramasDto(), JsonRequestBehavior.AllowGet));
        }