Esempio n. 1
0
        public ServiceResult <object> AutocompleteView(Clause clause)
        {
            var userInfo    = _userSessionManager.GetUserInfo(clause.Ticket, Request);
            var bp          = new BusinessParam(userInfo, clause);
            var checkAccess = _userSessionManager.CheckAccess(bp, "UserRole", "autocomplete");

            return(checkAccess.Done
                ? UserRoleFacade.GetInstance().AutocompleteView(bp)
                : checkAccess);
        }
Esempio n. 2
0
        public ServiceResult <object> Save()
        {
            var dtoFromRequest = UserRoleFacade.GetInstance().GetDtoFromRequest(HttpContext.Request);

            if (!dtoFromRequest.Done)
            {
                return(dtoFromRequest);
            }
            var dto         = (UserRoleDto)dtoFromRequest.Result;
            var userInfo    = _userSessionManager.GetUserInfo(dto.Ticket, Request);
            var bp          = new BusinessParam(userInfo);
            var checkAccess = _userSessionManager.CheckAccess(bp, "UserRole",
                                                              dto.EntityId == 0 ? "insert" : "update");

            return(checkAccess.Done ? UserRoleFacade.GetInstance().Save(bp, dto) : checkAccess);
        }