public Models.Response.EmailPerfilResponse TbLoginParaLoginResponse(Models.TbLogin req)
        {
            Models.Response.EmailPerfilResponse x = new Models.Response.EmailPerfilResponse();

            x.id     = req.IdLogin;
            x.email  = req.DsEmail;
            x.perfil = req.DsPerfil;

            return(x);
        }
        public Models.Response.EmailPerfilResponse emailPerfil(Models.Request.EmailRequest req)
        {
            Models.TccContext db = new Models.TccContext();
            Models.TbLogin    x  = db.TbLogin.First(x => x.DsEmail == req.email && x.DsSenha == req.senha);

            Models.Response.EmailPerfilResponse retorno = new Models.Response.EmailPerfilResponse();
            retorno.id     = x.IdLogin;
            retorno.email  = x.DsEmail;
            retorno.perfil = x.DsPerfil;

            return(retorno);
        }
Example #3
0
        public ActionResult <Models.Response.EmailPerfilResponse> acessar(Models.Request.EmailRequest login)
        {
            try{
                Utils.TelaCriarConta.AcessarUtils       acesso = new Utils.TelaCriarConta.AcessarUtils();
                Business.TelaCriarConta.AcessarBusiness verificarexistencia = new Business.TelaCriarConta.AcessarBusiness();

                Models.TbLogin parte1 = verificarexistencia.verificarcontaexistente(login);
                Models.Response.EmailPerfilResponse parte2 = acesso.TbLoginParaLoginResponse(parte1);

                return(parte2);
            }
            catch (System.Exception ex)
            {
                return(new BadRequestObjectResult(
                           new Models.Response.ErroResponse(ex, 400)
                           ));
            }
        }