Пример #1
0
        public ResultCodeModel SaveSelfReported(LoanCanonicalType SelfReported)
        {
            ResultCodeModel rcm = new ResultCodeModel();

            rcm.ResultCode = 1;// Success.
            return(rcm);
        }
Пример #2
0
        public ResultCodeModel SaveSelfReported(LoanCanonicalType SelfReported)
        {
            _log.Info("InvokeSelfReportedService.SaveSelfReported() starting ...");
            LoanManagementClient        client      = null;
            Dictionary <string, string> paramList   = null;
            ResponseMessageList         messageList = new ResponseMessageList();

            //try/catch here, and handle results/errors appropriately...
            ResultCodeModel result = new ResultCodeModel();


            try
            {
                client            = new LoanManagementClient();
                result.ResultCode = client.SaveLoanSelfReportedEntry(paramList, ref SelfReported, out messageList);
            }
            catch (TimeoutException timeout)
            {
                ErrorModel error = new ErrorModel("There was a timeout problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                ProxyHelper.HandleServiceException(client);
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Timeout Exception:" + timeout.Message);
            }
            catch (CommunicationException comm)
            {
                ErrorModel error = new ErrorModel("There was a communication problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                ProxyHelper.HandleServiceException(client);
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Communication Exception:" + comm.Message);
            }
            catch (Exception e)
            {
                ErrorModel error = new ErrorModel("There was an exception thrown calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }


            _log.Info("InvokeSelfReportedService.SaveSelfReported() ending ...");
            return(result);
        }
Пример #3
0
        private LoanCanonicalType GetNewLoanCanonicalType(int loanId, DateTime repayDt, decimal balance, decimal nextPmt, string schoolName, string lenderName)
        {
            LoanCanonicalType loanCanonical = new LoanCanonicalType();

            loanCanonical.LoanTier1 = new LoanTier1Type();
            loanCanonical.LoanTier2 = new LoanTier2Type();
            loanCanonical.LoanTier2.LoanInfoType = new LoanTier2Type.LoanInfoTypeType();

            loanCanonical.LoanTier2.LoanInfoType.LoanId = loanId;
            loanCanonical.LoanTier1.CustomerId          = 2;
            loanCanonical.LoanTier2.LoanInfoType.EnteredRepaymentDate            = repayDt;
            loanCanonical.LoanTier2.LoanInfoType.LoanStatusId                    = "DF";
            loanCanonical.LoanTier2.LoanInfoType.LoanStatusDate                  = new DateTime(2011, 5, 15);
            loanCanonical.LoanTier2.LoanInfoType.LoanTypeId                      = "SF";
            loanCanonical.LoanTier2.LoanInfoType.OutstandingPrincipalBalance     = balance;
            loanCanonical.LoanTier2.LoanInfoType.OutstandingPrincipalBalanceDate = new DateTime(2011, 6, 5);;
            loanCanonical.LoanTier2.LoanInfoType.InterestRate                    = 6.2;
            loanCanonical.LoanTier2.RepaymentInfoType = new LoanTier2Type.RepaymentInfoTypeType();
            loanCanonical.LoanTier2.RepaymentInfoType.NextPaymentDueAmount = nextPmt;
            loanCanonical.LoanTier2.RepaymentInfoType.NextPaymentDueDate   = new DateTime(2011, 8, 15);

            loanCanonical.LoanTier2.OrganizationArray = new LoanTier2Type.OrganizationArrayType();
            OrganizationType org1 = new OrganizationType();

            org1.OrganizationId           = 7;
            org1.OrganizationRoleId       = "SCHL";
            org1.ReadOnlyOrganizationName = schoolName;
            loanCanonical.LoanTier2.OrganizationArray.Add(org1);

            OrganizationType org2 = new OrganizationType();

            org2.OrganizationId           = 8;
            org2.OrganizationRoleId       = "LEND";
            org2.ReadOnlyOrganizationName = lenderName;
            loanCanonical.LoanTier2.OrganizationArray.Add(org2);

            return(loanCanonical);
        }