public IResult GetApprovalEvents(int approvalId, Guid entityId)
        {
            var result = new Result
            {
                Operation = Operation.Read,
                Status    = Status.Success
            };

            try
            {
                var approvalEventAndTransactionDetail = new ApprovalEventAndTransactionDetail();
                var data = _approvalRepository.GetApprovalEvents(approvalId);
                if (data.Any())
                {
                    approvalEventAndTransactionDetail.approvalEventViewModel = data.Select(t =>
                    {
                        var eventViewModel = new ApprovalEventViewModel();
                        eventViewModel.MapFromModel(t);
                        if (t.ApprovalActions.Any())
                        {
                            var actionViewModel            = new List <ApprovalActionViewModel>();
                            eventViewModel.ApprovalActions = actionViewModel
                                                             .MapFromModel <ApprovalActions, ApprovalActionViewModel>(t.ApprovalActions.ToList());
                            var users            = _approvalRepository.GetApprovedUsers(t.ApprovalEventId);
                            var userModels       = new List <UserViewModel>();
                            eventViewModel.Users = userModels.MapFromModel <Users, UserViewModel>(users);
                        }
                        return(eventViewModel);
                    }).ToList();
                }

                var userId           = GetUserId();
                var permissibleEvent = 0;
                if (entityId != Guid.Empty)
                {
                    var approvalTransactionViewModel = new ApprovalTransactionViewModel();
                    var approvalTransactionModel     = _approvalRepository.GetApprovalTransactionByEntity(entityId);
                    if (approvalTransactionModel != null)
                    {
                        approvalEventAndTransactionDetail.approvalTransactionViewModel = (ApprovalTransactionViewModel)approvalTransactionViewModel.MapFromModel(approvalTransactionModel);
                    }
                    permissibleEvent = _approvalRepository.GetApprovalEventOrderOfUser(entityId, userId, approvalId);
                }

                if (permissibleEvent > 0 && approvalEventAndTransactionDetail.approvalTransactionViewModel != null)
                {
                    approvalEventAndTransactionDetail.approvalTransactionViewModel.PermissibleEvent = permissibleEvent;
                }

                result.Body = approvalEventAndTransactionDetail;
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.Status  = Status.Error;
            }
            return(result);
        }