示例#1
0
 /// <summary>
 ///     Find the <see cref="OrganizationObj" /> that matches id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 protected internal OrganizationObj FindOrganization(string id)
 {
     if (string.IsNullOrWhiteSpace(id))
     {
         return(null);
     }
     try
     {
         var result = AuditCollection.Where(item => item.Id == id).ToList();
         if (result.Count > 0)
         {
             foreach (var item in result)
             {
                 var o = item as OrganizationObj;
                 if (o != null)
                 {
                     return(o);
                 }
             }
         }
     }
     catch
     {
         // Ignore errors; must resolve reference later...
     }
     return(null);
 }
示例#2
0
 /// <summary>
 ///     Find the <see cref="AbstractContactObj" /> that matches id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 protected internal AbstractContactObj FindContact(string id)
 {
     if (string.IsNullOrWhiteSpace(id))
     {
         return(null);
     }
     try
     {
         var result = AuditCollection.Where(item => item.Id == id).ToList();
         if (result.Count > 0)
         {
             return(result.First());
         }
     }
     catch
     {
         // Ignore errors; must resolve reference later...
     }
     return(null);
 }