public ActionResult Index()
        {
            var user          = _UserRepo.GetByEmail(User.Identity.Name);
            var dashviewmodel = new DashBoardViewModel()
            {
                Chamadas           = _ChamadasRepo.GetAllOpen(user.Id),
                ChamadaEditadas    = _ChamadaEditadaRepoRepo.GetAllOpen(user.Id),
                ChamadasCanceladas = _cancelamentoChamadaRepository.GetAllOpen(user.Id),
                Ordems             = (List <ActionOrders>)_OrdemRepo.SelecionarPosicionadas(user.Id)
            };
            var config = _ServerConfigRepo.GetAllConfig();

            ViewBag.ApiDomainName  = config.ApiServer;
            ViewBag.OneSignalAppId = config.OneSignalAppId;

            return(View(dashviewmodel));
        }
 public HttpResponseMessage GetAtivas()
 {
     try
     {
         var userId = int.Parse(Helper.GetJWTPayloadValue(Request, "id"));
         var ret    = new ChamadasAtivasViewModel
         {
             Ativas               = _ChamadasRepo.GetAllOpen(userId),
             ChamadaEditadas      = _ChamadaEditadaRepository.GetAllOpen(userId),
             CancelamentoChamadas = _cancelamentoChamadaRepository.GetAllOpen(userId)
         };
         return(Request.CreateResponse(HttpStatusCode.OK, ret));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }