예제 #1
0
 public static PhysicalAddressDictionaryEntryType GetValueByType(PhysicalAddressDictionaryEntryType[] types, PhysicalAddressKeyType key, bool checkEmpty = false)
 {
     if (types != null)
     {
         foreach (PhysicalAddressDictionaryEntryType item in types)
         {
             if (item.Key == key)
             {
                 return(item);
             }
         }
     }
     if (checkEmpty)
     {
         throw new PXException("Email with type {0} has not found.", key.ToString());
     }
     return(null);
 }
 /// <summary>
 /// Factory method for creating a physical address part field uri
 /// </summary>
 /// <param name="part">Indicates which part of a physical address to use</param>
 /// <param name="fieldIndex">Indicates the address category (home, business, etc...)</param>
 /// <returns>Indexed field uri</returns>
 /// 
 public static PathToIndexedFieldType CreatePhysicalAddress(PhysicalAddressPart part, PhysicalAddressKeyType fieldIndex)
 {
     // Since we defined our enum to have the same values as the corresponding dictionary uris,
     // we can just cast our enum value here.
     //
     return new PathToIndexedFieldType((DictionaryURIType)part, fieldIndex.ToString());
 }
 public static PhysicalAddressDictionaryEntryType GetValueByType(PhysicalAddressDictionaryEntryType[] types, PhysicalAddressKeyType key, bool checkEmpty = false)
 {
     if (types != null)
     {
         foreach (PhysicalAddressDictionaryEntryType item in types)
         {
             if (item.Key == key)
             {
                 return(item);
             }
         }
     }
     if (checkEmpty)
     {
         throw new PXException(PXMessages.LocalizeFormatNoPrefix(Messages.EmailTypeNotFound, key.ToString()));
     }
     return(null);
 }