Exemplo n.º 1
0
        public IHttpActionResult Get(int id)
        {
            Library.DTO.Notification notification;
            object data = executor.GetData(ControllerContext.GetAuthUserId(), ControllerContext.GetAuthUserId(), out notification);

            return(Ok(new Library.DTO.ReturnData <object>()
            {
                Data = data, Message = notification
            }));
        }
        public IHttpActionResult Get(int id)
        {
            // authentication
            if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }
            object data = executor.GetData(ControllerContext.GetAuthUserId(), id, out Library.DTO.Notification notification);

            return(Ok(new Library.DTO.ReturnData <object>()
            {
                Data = data, Message = notification
            }));
        }
Exemplo n.º 3
0
        public IHttpActionResult GetData(int id)
        {
            if (!framework.CanPerformAction(ControllerContext.GetAuthUserId(), ModuleCode, ModuleAction.CanRead))
            {
                return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)));
            }

            SetModuleIdenfitier(executor);

            var data = executor.GetData(ControllerContext.GetAuthUserId(), id, out Notification notification);

            return(Ok(new ReturnData <object>()
            {
                Data = data, Message = notification
            }));
        }
Exemplo n.º 4
0
        public IHttpActionResult Get(int id)
        {
            // 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
                }));
            }
            object data = executor.GetData(ControllerContext.GetAuthUserId(), id, out Library.DTO.Notification notification);

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