Beispiel #1
0
        public IHttpActionResult AddNewCategory(ReportCategoryModel reportCategoryModel)
        {
            int          result = 0;
            ActionStatus status = new ActionStatus();

            try
            {
                result = reportService.AddNewCategory(reportCategoryModel, permission);
            }
            catch (ReportServiceException ex)
            {
                status.Number = (int)ex.ErrorCodeService;
            }
            catch (BaseException ex)
            {
                status.Number = (int)ex.ErrorCode;
            }

            catch (Exception ex)
            {
                status.Number = -1;
                logger.Error("Exception in Report/AddNewCategory: {0} \r\n {1}", ex.ToString(), ex.StackTrace);
            }
            if (status.Number != -1)
            {
                return(Ok(new { result = result, Status = status }));
            }
            else
            {
                return(InternalServerError());
            }
        }