internal Response <FundsLoadListModel> Reject(FundsLoadStatusType statusType, long fundsLoadId, bool v, long userId, string workstation)
        {
            FundsLoadListModel result = new FundsLoadListModel();

            switch (statusType)
            {
            case FundsLoadStatusType.Created:
                if (_fundsOperations.ReviewReject(fundsLoadId, userId, workstation) == SystemResponseCode.SUCCESS)
                {
                    return(new Response <FundsLoadListModel>(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
                }
                break;

            case FundsLoadStatusType.Reviewed:
                if (_fundsOperations.ApprovalReject(fundsLoadId, userId, workstation) == SystemResponseCode.SUCCESS)
                {
                    return(new Response <FundsLoadListModel>(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
                }
                break;

            default:
                break;
            }

            return(new Response <FundsLoadListModel>(result, ResponseType.UNSUCCESSFUL,
                                                     "Funds load reject action failed.",
                                                     "Funds load reject action failed.  Check account and connectivity."));
        }
        internal Response <List <FundsLoadListModel> > ApproveBulk(FundsLoadStatusType statusType, List <long> fundsLoads, int languageId, long auditUserId, string auditWorkstation)
        {
            try
            {
                List <FundsLoadListModel> result = new List <FundsLoadListModel>();
                bool allProcessed = true;
                foreach (var item in fundsLoads)
                {
                    switch (statusType)
                    {
                    case FundsLoadStatusType.Created:
                        _fundsOperations.ReviewAccept(item, auditUserId, auditWorkstation);
                        break;

                    case FundsLoadStatusType.Reviewed:
                        _fundsOperations.ApprovalAccept(item, auditUserId, auditWorkstation);
                        break;

                    case FundsLoadStatusType.Approved:
                        allProcessed = allProcessed && ExecuteFundsLoadNoCardReason(item, auditUserId, auditWorkstation, languageId);
                        break;

                    default:
                        break;
                    }
                }
                if (allProcessed)
                {
                    return(new Response <List <FundsLoadListModel> >(result, ResponseType.SUCCESSFUL,
                                                                     string.Empty,
                                                                     string.Empty));
                }
                else
                {
                    return(new Response <List <FundsLoadListModel> >(null, ResponseType.UNSUCCESSFUL,
                                                                     "Approve Bulk Failed on one or more entries",
                                                                     "Not all entries were successully loaded"));
                }
            }
            catch (Exception exp)
            {
                return(new Response <List <FundsLoadListModel> >(null, ResponseType.UNSUCCESSFUL,
                                                                 "Approve Bulk Failed on one or more entries",
                                                                 exp.Message));
            }
        }
 internal Response <List <FundsLoadListModel> > List(FundsLoadStatusType statusType, int issuerId, int branchId, bool checkMasking, long auditUserId, string auditWorkStation)
 {
     try
     {
         var response = _fundsOperations.List(statusType, issuerId, branchId, checkMasking, auditUserId, auditWorkStation).ToList();
         return(new Response <List <FundsLoadListModel> >(response, ResponseType.SUCCESSFUL,
                                                          string.Empty,
                                                          string.Empty));
     }
     catch (Exception ex)
     {
         log.Error(ex);
         return(new Response <List <FundsLoadListModel> >(null, ResponseType.ERROR,
                                                          "Error processing request, please try again.",
                                                          log.IsDebugEnabled || log.IsTraceEnabled ? ex.Message : ""));
     }
 }
        internal Response <FundsLoadListModel> Approve(FundsLoadStatusType statusType, long fundsLoadId, bool v, long userId, string workstation, int languageId, int cardIssueReasonId)
        {
            FundsLoadListModel result = new FundsLoadListModel();

            switch (statusType)
            {
            case FundsLoadStatusType.Created:
                if (_fundsOperations.ReviewAccept(fundsLoadId, userId, workstation) == SystemResponseCode.SUCCESS)
                {
                    return(new Response <FundsLoadListModel>(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
                }
                break;

            case FundsLoadStatusType.Reviewed:
                if (_fundsOperations.ApprovalAccept(fundsLoadId, userId, workstation) == SystemResponseCode.SUCCESS)
                {
                    return(new Response <FundsLoadListModel>(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
                }
                break;

            case FundsLoadStatusType.Approved:
                if (ExecuteFundsLoad(fundsLoadId, userId, workstation, languageId, cardIssueReasonId))
                {
                    _fundsOperations.Load(fundsLoadId, userId, workstation);
                    return(new Response <FundsLoadListModel>(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
                }
                break;

            default:
                break;
            }
            return(new Response <FundsLoadListModel>(null, ResponseType.UNSUCCESSFUL,
                                                     "Funds load action failed",
                                                     "Funds load action failed, either insufficient funds or a technical issue."));
        }
        internal Response <List <FundsLoadListModel> > RejectBulk(FundsLoadStatusType statusType, List <long> fundsLoads, bool v, long userId, string workstation)
        {
            List <FundsLoadListModel> result = new List <FundsLoadListModel>();

            foreach (var item in fundsLoads)
            {
                switch (statusType)
                {
                case FundsLoadStatusType.Created:
                    _fundsOperations.ReviewReject(item, userId, workstation);
                    break;

                case FundsLoadStatusType.Reviewed:
                    _fundsOperations.ApprovalReject(item, userId, workstation);
                    break;

                default:
                    break;
                }
            }
            return(new Response <List <FundsLoadListModel> >(result, ResponseType.SUCCESSFUL,
                                                             string.Empty,
                                                             string.Empty));
        }