Ejemplo n.º 1
0
        public Dictionary <List <Loan>, string> Loans(string userName, string password, List <string> dataFolders, string selectedLoanType = "Borrower", string searchByType = "FileName", string searchOption = "BeginsWith", string searchContent = "")
        {
            Dictionary <List <Loan>, string> response = new Dictionary <List <Loan>, string>();
            List <Loan> officerLoans = new List <Loan>();

            try
            {
                this.ClientLogin(userName, password);
                Calyx.Point.SDK.Results.GetLoanResults apiResponse = this.GetLoansFromApi(dataFolders, selectedLoanType, searchByType, searchOption, searchContent);

                foreach (Calyx.Point.Data.DataFolderServices.LoanInfo item in apiResponse.Loans)
                {
                    officerLoans.Add(new Loan()
                    {
                        BorrowerBusinessPhone   = item.Attributes.BorrowerBusinessPhone,
                        BorrowerFirstName       = item.Attributes.BorrowerFirstName,
                        BorrowerHomePhone       = item.Attributes.BorrowerHomePhone,
                        BorrowerLastName        = item.Attributes.BorrowerLastName,
                        BorrowerPreferredName   = item.Attributes.BorrowerPreferredName,
                        CoBorrowerBuisnessPhone = item.Attributes.CoBorrowerBuisnessPhone,
                        CoBorrowerFirstName     = item.Attributes.CoBorrowerFirstName,
                        CoBorrowerHomePhone     = item.Attributes.CoBorrowerHomePhone,
                        CoBorrowerLastName      = item.Attributes.CoBorrowerLastName,
                        ContactDate             = item.Attributes.ContactDate,
                        EstClose               = item.Attributes.EstClose,
                        FileName               = item.Attributes.FileName,
                        LoanRep                = item.Attributes.LoanRep,
                        LoanStatus             = item.Attributes.LoanStatus.ToString(),
                        LoanStatusDate         = item.Attributes.LoanStatusDate,
                        PresentAddress         = item.Attributes.PresentAddress,
                        Processor              = item.Attributes.Processor,
                        RateLockExpiration     = item.Attributes.RateLockExpiration,
                        SubjectPropertyAddress = item.Attributes.SubjectPropertyAddress,
                        TypeOfLoan             = item.Attributes.TypeOfLoan.ToString()
                    });
                }
                response.Add(officerLoans, "");
            }
            catch (Exception exp)
            {
                _errorLogService.logerror("Calyx SDK : Failed to getting Loans.", exp.Message, ErrorType.GeneralException, ErrorSeverity.Error);
                response.Add(officerLoans, "Error occurred in getting Loans. Error Deatils: " + exp.Message);
            }
            return(response);
        }