Beispiel #1
0
        public AppResultado CadastrarRequerente(RequerenteDTO req)
        {
            var res = new AppResultado();

            try
            {
                var r = new Requerente
                {
                    IdRequerente        = Guid.NewGuid(),
                    IdMunicipio         = req.IdMunicipio,
                    Nome                = req.Nome,
                    PessoaContacto      = req.PessoaDeContacto,
                    TelefoneAlternativo = req.TelefoneAlternativo,
                    TelefonePrimario    = req.TelefonePrimario,
                    Email               = req.Email,
                    ObjetoSocial        = req.ObjetoSocial,
                    CNES                = req.CNES,
                    IBGE                = req.IBGE,
                    UF = req.UF
                };

                db.Requerente.Add(r);
                db.SaveChanges();

                res.Good("Cadastro realizado com sucesso.");
            }
            catch (Exception)
            {
                res.Bad("Erro ao cadastrar requerente.");
            }


            return(res);
        }
Beispiel #2
0
 public JsonResult CadastrarRequerente(RequerenteDTO req)
 {
     return(Json(_requerenteApp.CadastrarRequerente(req), JsonRequestBehavior.AllowGet));
 }