public IResult Delete(int id) { var result = _operationClaimDal.Get(o => o.Id == id); _operationClaimDal.Delete(result); return(new SuccessResult(Messages.DeletedSuccess)); }
public IDataResult <OperationClaim> GetById(int id) { var result = BusinessRules.Run(CheckIfEntityIdValid(id)); if (result == null) { return(new SuccessDataResult <OperationClaim>(_operationClaimDal.Get(c => c.Id == id), BusinessMessages.OperationClaimDetailsListed)); } return(new ErrorDataResult <OperationClaim>()); }
public IDataResult <OperationClaim> GetById(int id) { IResult result = BusinessRule.Run ( CheckIfClaimExist(id) ); if (result != null) { return(new ErrorDataResult <OperationClaim>(result.Message)); } return(new SuccessDataResult <OperationClaim>(_operationClaimDal.Get(op => op.Id == id))); }
private IResult CheckIfOperationClaimAlreadyExist(OperationClaim operationClaim) { var result = _operationClaimDal.Get(o => o.OperationClaimName == operationClaim.OperationClaimName); if (result != null) { if (result.OperationClaimID != operationClaim.OperationClaimID) { return(new ErrorResult(Messages.OperationClaimAlreadyExist)); } } return(new SuccessResult()); }
public IDataResult <OperationClaim> GetById(int id) { return(new SuccessDataResult <OperationClaim>(_operationClaimDal.Get(o => o.Id == id))); }
private bool IsClaimExists(string claimName) { return(_operationClaimDal.Get(x => x.Name == claimName) is null ? false : true); }
public IDataResult <OperationClaim> GetById(int id) { return(new SuccessDataResult <OperationClaim>(_userDal.Get(x => x.Id == id), Messages.ItemGetted)); }
public IDataResult <OperationClaim> GetById(int id) { var result = _operationClaimDal.Get(op => op.Id == id); return(new SuccessDataResult <OperationClaim>(result, Messages.OperationClaim.GetByIdSuccess)); }
public IDataResult <OperationClaim> GetByName(string name) { return(new SuccessDataResult <OperationClaim>(_operationClaimDal.Get(operationC => operationC.Name == name))); }