Encompass SDK – The following code displays all of the Milestone information for a loan.
using System;
using System.IO;
using EllieMae.Encompass.Client;
using EllieMae.Encompass.BusinessEnums;
using EllieMae.Encompass.BusinessObjects.Loans;
using EllieMae.Encompass.BusinessObjects.Loans.Events;
class LoanReader
{
public static void Main()
{
// Open the session to the remote server
Session session = new Session();
session.Start(“myserver”, “mary”, “maryspwd”);
// Open a loan using its GUID
Loan loan = session.Loans.Folders[“My Pipeline”].OpenLoan(“Sample”);
// Get the first milestone from the processing sequence
Milestone ms = session.Loans.Milestones.First;
while (ms != null)
{
// Get the loan’s MilestoneEvent for the current milestone
MilestoneEvent entry = loan.Log.MilestoneEvents.GetEventForMilestone(ms.Name);
if (entry != null)
{
if (entry.Completed)
Console.WriteLine(“Milestone ” + ms.Name + ” was completed on ” + entry.Date);
else if (entry.Date != null)
Console.WriteLine(“Milestone ” + ms.Name + ” is scheduled for completion on ” + entry.Date);
else
Console.WriteLine(“Milestone ” + ms.Name + ” is not currently scheduled for completion”);
}
// Move to the next Milestone in the sequence
ms = ms.Next;
}
// Close the loan
loan.Close();
// End the session to gracefully disconnect from the server
session.End();
}
}