Exemple #1
0
        public IHttpActionResult GetTodos()
        {
            var user = new ClaimsManager().GetClaimsIdentity(User.Identity);

            var model = new AgendamentoConsultaViewModel().CarregarTodosAgendamentos(user.Id, user.TipoCliente, _db);

            return(Ok(model));
        }
Exemple #2
0
        public IHttpActionResult GetPorId(int id)
        {
            var user = new ClaimsManager().GetClaimsIdentity(User.Identity);

            var model = new AgendamentoConsultaViewModel();

            model.CarregarAgendamento(id, _db);

            if (model.Id > 0)
            {
                return(Ok(model));
            }
            else
            {
                return(BadRequest("Agendamento não encontrado!"));
            }
        }