using System;
using System.Collections;
using System.IO;
using System.Threading;
using EllieMae.Encompass.Client;
using EllieMae.Encompass.BusinessObjects;
using EllieMae.Encompass.BusinessObjects.Contacts;
class ContactManager
{
public static void Main(string[] args)
{
// Open the session to the remote server
Session session = new Session();
session.Start(“myserver”, “mary”, “maryspwd”);
// Create the query criterion to find all borrowers with an opportunity who
// have a current mortgage rate of less than 4%.
NumericFieldCriterion cri = new NumericFieldCriterion(“Opp.MortRate”, 4,
OrdinalFieldMatchType.LessThan);
// Perform the query
ContactList contacts = session.Contacts.Query(cri, ContactLoanMatchType.None, ContactType.Borrower);
// For each of these contacts, delete the associate opportunity
foreach (BorrowerContact contact in contacts)
contact.Opportunities.Remove(contact.Opportunities[0]);
// End the session to gracefully disconnect from the server
session.End();
}
}