Exemple #1
0
        public ActionResult Cadastrar(DisciplinaDto model)
        {
            var disciplina = _serviceDisciplina.Cadastrar(Request.Cookies[FormsAuthentication.FormsCookieName].Value, model);

            if (disciplina)
            {
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
 public IHttpActionResult CadastrarDisciplina(DisciplinaDto disciplinaDto)
 {
     try
     {
         serviceDisciplina.Cadastrar(disciplinaDto);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }