Beispiel #1
0
 public IResult AddUser(int userId)
 {
     _userOperationClaimDal.Add(new UserOperationClaim {
         UserId = userId, OperationClaimId = _operationClaimService.GetByOperationClaimName("user").Data.Id
     });
     return(new SuccessResult());
 }
        public IResult AddUserClaim(User user)
        {
            var operationClaim     = _operationClaimService.GetByName("user").Data;
            var userOperationClaim = new UserOperationClaim {
                OperationClaimId = operationClaim.Id, UserId = user.UserId
            };

            _userOperationClaimDal.Add(userOperationClaim);
            return(new SuccessResult(Messages.Successed));
        }
 public IResult AddUserOperationClaim(AppUser userResult, OperationClaim operationClaim)
 {
     _userOperationClaimDal.Add(new UserOperationClaim {
         User = userResult, OperationClaim = operationClaim
     });
     return(new SuccessResult());
 }
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            var result = BusinessRules.Run(CheckIfClaimExist(userOperationClaim));

            if (result == null)
            {
                _userOperationClaimDal.Add(userOperationClaim);
                return(new SuccessResult(Messages.Successful));
            }
            return(new ErrorResult(Messages.ClaimAlreadyExist));
        }
        //[ValidationAspect(typeof(UserOperationClaimValidator))]
        public IResult Add(UserOperationClaim entity)
        {
            var result = BusinessRules.Run(CheckUserOperationClaimCount());

            if (result != null)
            {
                return(result);
            }
            _userDal.Add(entity);
            return(new SuccessResult(Messages.Added));
        }
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            var result = BusinessRules.Run(CheckClaimExists(userOperationClaim));

            if (result != null)
            {
                return(new ErrorResult(result.Message));
            }
            _userOperationClaimDal.Add(userOperationClaim);
            return(new SuccessResult());
        }
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            IResult result = BusinessRules.Run(CheckUserHasOperationClaim(userOperationClaim));

            if (result != null)
            {
                return(result);
            }
            _userOperationClaimDal.Add(userOperationClaim);
            return(new SuccessResult(Messages.UserOperationClaimAdded));
        }
Beispiel #8
0
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            var result = _userOperaitonClaimDal.GetAll(u => u.UserId == userOperationClaim.UserId && u.OperationClaimId == userOperationClaim.OperationClaimId);

            if (result.Count != 0)
            {
                return(new ErrorResult(Messages.UserOperationClaimAlreadyExist));
            }
            _userOperaitonClaimDal.Add(userOperationClaim);
            return(new SuccessResult(Messages.ListedUserOperationClaims));
        }
Beispiel #9
0
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            var result = BusinessRule.Run(CheckClaim(userOperationClaim));

            if (result != null)
            {
                return(new ErrorResult(result.Message));
            }

            _operationClaimDal.Add(userOperationClaim);
            return(new SuccessResult(Messages.Authorized));
        }
Beispiel #10
0
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            IResult result = BusinessRules.Run(
                CheckIfClaimAlreadyExists(userOperationClaim.UserId,
                                          userOperationClaim.OperationClaimId)
                );

            if (result != null)
            {
                return(result);
            }

            _userOperationClaimDal.Add(userOperationClaim);
            return(new SuccessResult());
        }
        public IResult Add(UserOperationClaim userOperationClaim)
        {
            IResult result = BusinessRule.Run
                             (
                CheckIfUserOperationClaimExist(userOperationClaim.Id)
                             );

            if (result == null)
            {
                return(new ErrorResult(UserOperationClaimMessages.ThisUserOperationClaimAlreadyExist));
            }

            _userOperationClaimDal.Add(userOperationClaim);
            return(new SuccessResult());
        }
Beispiel #12
0
        public IResult AddDefaultClaim(int userId)
        {
            var result = BusinessRules.Run(CheckIfExistsOfUser(userId));

            if (result != null)
            {
                return(result);
            }

            _userOperationClaimDal.Add(new UserOperationClaim
            {
                UserId           = userId,
                OperationClaimId = 3
            });

            return(new SuccessResult(Messages.UserOperationClaimInsertionSuccess));
        }
 public IResult Add(UserOperationClaim userOperationClaim)
 {
     _userOperationClaimDal.Add(userOperationClaim);
     return(new SuccessResult("eklendi"));
 }
 public IResult Add(UserOperationClaim entity)
 {
     _userOperationClaimDal.Add(entity);
     return(new SuccessResult(Messages.AddedSuccess));
 }
 public IResult Add(UserOperationClaim userOperationClaim)
 {
     _userOperationClaimDal.Add(userOperationClaim);
     return(new SuccessResult(BusinessMessages.UserOperationClaimAdded));
 }
 public IResult Add(UserOperationClaim operationClaim)
 {
     _userOperationClaimDal.Add(operationClaim);
     return(new SuccessResult());
 }
 public IResult Add(UserOperationClaim userOperationClaim)
 {
     _userOperationClaimDal.Add(userOperationClaim);
     return(new SuccessResult(Messages.Successful));
 }
Beispiel #18
0
 public IResult Add(UserOperationClaim claim)
 {
     claimDal.Add(claim);
     return(new SuccessResult("işlem yapma hakları" + claim.OperationClaimId + "olarak" + Messages.Updated));
 }
 public IResult Add(UserOperationClaims userOperationClaims)
 {
     userOperationClaimDal.Add(userOperationClaims);
     return(new SuccessResult());
 }