Example #1
0
 public IActionResult GetDashboardReports(string dashboardGUID)
 {
     try
     {
         if (string.IsNullOrEmpty(dashboardGUID))
         {
             throw new BasicException("Empty GUID");
         }
         User user    = _userRep.GetByEmailAdd(this.User.Claims.SingleOrDefault(x => x.Type == "EmailAddress").Value);
         var  reports = _manager.GetDashboardReports(dashboardGUID, user);
         return(Ok(reports));
     }
     catch (BasicException ex)
     {
         _logger.LogError(ex.Message);
         return(BadRequest(ex.Message));
     }
     catch (NotFoundException ex)
     {
         _logger.LogError(ex.Message);
         return(NotFound(ex.Message));
     }
     catch (PermissionException ex)
     {
         _logger.LogError(ex.Message);
         return(Unauthorized());
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         return(BadRequest());
     }
 }