コード例 #1
0
        public IHttpActionResult Gets(DTO.Search searchInput)
        {
            searchInput.Filters.Add("userId", ControllerContext.GetAuthUserId());
            var data = executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out int totalRows, out Notification notification);

            return(Ok(new ReturnData <Object>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
コード例 #2
0
        public IHttpActionResult GetDataWithFilter(DTO.Search searchInput)
        {
            if (!fwBLL.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            object data = executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out int totalRows, out Library.DTO.Notification notification);

            return(Ok(new Library.DTO.ReturnData <object> {
                Data = data, TotalRows = totalRows, Message = notification
            }));
        }
コード例 #3
0
        public IHttpActionResult Gets(DTO.Search searchInput)
        {
            // authentication
            //if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead))
            //{
            //    return InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED));
            //}
            Library.DTO.Notification notification;
            int    totalRows = 0;
            Object data      = executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification);

            return(Ok(new Library.DTO.ReturnData <Object>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
コード例 #4
0
        public IHttpActionResult Gets(DTO.Search input)
        {
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, ModuleAction.CanRead))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            input.Filters.Add("UserID", ControllerContext.GetAuthUserId());

            var data = executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), input.Filters, input.PageSize, input.PageIndex, input.SortedBy, input.SortedDirection, out int totalRows, out Notification notification);

            return(Ok(new ReturnData <object>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
コード例 #5
0
        public IHttpActionResult Gets(DTO.Search searchInput)
        {
            Notification notification;

            if (!_fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), ModuleCode, ModuleAction.CanRead))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            SetModuleIdentifier(_executor);

            int totalRows;
            var data = _executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification);

            return(Ok(new ReturnData <object>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }
コード例 #6
0
        public IHttpActionResult Gets(DTO.Search searchInput)
        {
            // authentication
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead))
            {
                return(Ok(new Library.DTO.ReturnData <Object>()
                {
                    Data = null, Message = new Library.DTO.Notification {
                        Type = Library.DTO.NotificationType.Error, Message = "Not authorized!"
                    }, TotalRows = 0
                }));
            }
            Library.DTO.Notification notification;
            int    totalRows = 0;
            Object data      = executor.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification);

            return(Ok(new Library.DTO.ReturnData <Object>()
            {
                Data = data, Message = notification, TotalRows = totalRows
            }));
        }