Пример #1
0
        private EllieMae.EMLite.DataEngine.LoanDataMgr GetLoanDataMgr(EllieMae.Encompass.Client.Session session, string loanGuidID)
        {
            MethodInfo         dynMethod  = session.GetType().GetMethod("Unwrap", BindingFlags.NonPublic | BindingFlags.Instance);
            MarshalByRefObject sessionobj = dynMethod.Invoke(session, null) as MarshalByRefObject;
            ObjRef             objRef     = RemotingServices.GetObjRefForProxy(sessionobj);

            //EllieMae.EMLite.Server.Session serverSession = (EllieMae.EMLite.Server.Session)RemotingServices.Unmarshal(objRef);
            Elli.Server.Remoting.SessionObjects.Session serverSession = (Elli.Server.Remoting.SessionObjects.Session)RemotingServices.Unmarshal(objRef);
            //Initialize ClientServer session object with serverSession
            SessionObjects sessionObjects = new SessionObjects(serverSession);

            //Get LoanDataMgr by client server session object and loan GUID
            if (sessionObjects == null)
            {
                return(null);
            }

            EllieMae.EMLite.DataEngine.LoanDataMgr loanDataMgr;
            try
            {
                loanDataMgr = EllieMae.EMLite.DataEngine.LoanDataMgr.OpenLoan(sessionObjects, loanGuidID, false);
            }
            catch (Exception ex)
            {
                //Log exception
                return(null);
            }

            return(loanDataMgr);
        }
Пример #2
0
        public bool UploadIUSEligibilityData(string loanGuid, string htmlContent, string encompassInstance, string encompassUserName, string encompassPassword)
        {
            using (EllieMae.Encompass.Client.Session session = new EllieMae.Encompass.Client.Session())
            {
                session.Start(encompassInstance, encompassUserName, encompassPassword);
                Loan loan = null;

                try
                {
                    loan = session.Loans.Open("{" + loanGuid.ToString() + "}", true, true);// "{bd019591-41b1-4fa5-8c97-0554f483413c}";
                }
                catch (Exception ex)
                {
                    session.End();
                    throw new LoanLockedException(ex.Message);
                }

                if (loan == null)
                {
                    throw new FileNotFoundException();
                }

                try
                {
                    loan.Lock();

                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    // Got the below code from: $\Apps\Work\Encompass\Customizations\CodeBase\Impac Eligibility\Impac.Eligibility.Codebase\Impac.Eligibility.Codebase\WinForm\EligibilityResponseForm.cs
                    // private void SaveResponseHtml(string certHtmlDecision)
                    // AttachmentHelper.AddAttachment(Encoding.ASCII.GetBytes(certHtmlDecision), "Eligibility Certificate", ".html", _loan);
                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    AddAttachment(Encoding.ASCII.GetBytes(htmlContent), "TPO IUS Eligibility Certificate", ".html", loan);
                    loan.Commit();
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
                finally
                {
                    if (loan != null)
                    {
                        loan.Unlock();
                        loan.Close();
                    }

                    // end the encompass login session
                    session.End();
                }
            } // end using client.session - NOTE, i am guessing "using" call would just put this session object in the garabage collector. I don't think it will do session.End. So we have to call that in above.


            return(true);
        }
Пример #3
0
        public List <CreditContentModel> GetCreditContents(EllieMae.Encompass.Client.Session session, Loan loan)
        {
            List <CreditContentModel> creditContents = new List <CreditContentModel>();

            var _serverloanObj = GetLoanDataMgr(session, loan.Guid).LoanObject;

            string[] listofKeys = _serverloanObj.GetSupportingDataKeysOnCIFs().Where(k => k.ToUpper().Contains("LIABILITY")).ToArray();
            for (int borr = 0; borr < loan.BorrowerPairs.Count; borr++)
            {
                BorrowerPair bp = loan.BorrowerPairs[borr];
                //Pull CreditResponse XML
                if (listofKeys.Count() > 0)
                {
                    //Get Credit key by borrowerId
                    string key = listofKeys.Where(k => k.Contains(bp.Borrower.ID)).FirstOrDefault();
                    if (!string.IsNullOrEmpty(key))
                    {
                        BinaryObject binaryObject   = _serverloanObj.GetSupportingDataOnCIFs(key);
                        string       creditResponse = binaryObject.ToString().Replace("<?xml version=\"1.0\"?>", "");

                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(creditResponse);

                        //Removing EMBEDDED_FILE
                        XmlNode node = doc.SelectSingleNode("/RESPONSE_GROUP/RESPONSE/RESPONSE_DATA/CREDIT_RESPONSE/EMBEDDED_FILE");
                        if (node != null)
                        {
                            node.RemoveAll();
                        }
                        creditResponse = doc.OuterXml;

                        creditContents.Add(new CreditContentModel {
                            Content = creditResponse
                        });
                    }
                }
            }
            return(creditContents);
        }
Пример #4
0
        public bool UploadFNMFile(Guid loanGuid, string filePath, string encompassInstance, string encompassUserName, string encompassPassword)
        {
            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException();
            }

            using (EllieMae.Encompass.Client.Session session = new EllieMae.Encompass.Client.Session())
            {
                session.Start(encompassInstance, encompassUserName, encompassPassword);
                Loan loan;

                try
                {
                    loan = session.Loans.Open("{" + loanGuid.ToString() + "}", true, true);// "{bd019591-41b1-4fa5-8c97-0554f483413c}";
                }
                catch (Exception ex)
                {
                    throw new LoanLockedException(ex.Message);
                }

                if (loan == null)
                {
                    throw new FileNotFoundException();
                }

                loan.Lock();
                loan.Import(filePath, LoanImportFormat.FNMA3X);
                loan.Commit();
                loan.Unlock();
                loan.Close();
                session.End();
            }

            return(true);
        }
Пример #5
0
 public bool Init(EllieMae.Encompass.Client.Session session)
 {
     throw new NotImplementedException();
 }