SIMS 7 - Agency
            Preamble
Agencies have a list of agents. This can be accessed as follows:
Data Format
   public class dAgency
    {
        public int? agency_id { get; set; }
        public int? address_id { get; set; }
        public string agency_name { get; set; }
        public int? agency_type_id { get; set; }
        public List<dAgencyAgentLink> links { get; set; }   
        public List<dEmail> emails = new List<dEmail>();
        public List<dTelephone> telephones = new List<dTelephone>();    
        public List<dStudentLink> students = new List<dStudentLink>();
    }
Iteration
         public static string wild = "?";
        public List<dAgent> GetAgents()
        {
            List<dAgent> agents = new List<dAgent>();
            SIMS.Processes.BrowseAgent ba = new SIMS.Processes.BrowseAgent();
            ba.Browse(wild, wild, wild, wild, null, false, DateTime.Now);
            foreach(SIMS.Entities.Agent a in ba.Agents)
            {
                dAgent da = new dAgent();
                da.PersonId = a.PersonID;
                da.Surname = a.Surname;
                da.Forename = a.Forename;
                da.JobTitle =  a.JobTitle.Description;
                // Much more 
            }    
            return agents;
        }
Population
foreach(SIMS.Entities.Agent a in ba.Agents)
            {
                dAgent da = new dAgent();
                da.PersonId = a.PersonID;
                da.Surname = a.Surname;
                da.Forename = a.Forename;
                da.JobTitle =  a.JobTitle.Description;
                // Much more 
            }