Example #1
0
 public IActionResult GetDashboardReportNames(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);
         IEnumerable <ReportDto> repots = _manager.GetReportNames(dashboardGUID, user);
         return(Ok(repots));
     }
     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());
     }
 }