/// <summary>
 /// Get special field from message with field enum
 /// </summary>
 /// <param name="field">field enum</param>
 /// <returns></returns>
 /// <exception cref="ISOException">throws ISOException if field does not exists</exception>
 public byte[] GetField(FIELDS field)
 {
     if (!dataElements.ContainsKey(field.GetNo()))
     {
         throw new ISOException("Field No " + field.GetNo() + " does not exists");
     }
     return(dataElements[field.GetNo()]);
 }
 private void AddOrUpdateElement(FIELDS field, byte[] fValue)
 {
     if (dataElements.ContainsKey(field.GetNo()))
     {
         dataElements[field.GetNo()] = fValue;
     }
     else
     {
         dataElements.Add(field.GetNo(), fValue);
     }
 }
        /// <summary>
        /// Get string representation of field enum
        /// </summary>
        /// <param name="field">Field enum</param>
        /// <param name="asciiFix">Fix ascii characters</param>
        /// <returns>Field value in string</returns>
        public string GetStringField(FIELDS field, bool asciiFix)
        {
            string temp = StringUtil.FromByteArray(GetField(field.GetNo()));

            if (asciiFix && !field.getType().Equals("n"))
            {
                return(StringUtil.HexToAscii(temp));
            }
            return(temp);
        }
 /// <summary>
 /// Check if fields exists by field enum
 /// </summary>
 /// <param name="field">Field enum</param>
 /// <returns>Returns true if field already exists</returns>
 public bool FieldExits(FIELDS field)
 {
     return(FieldExits(field.GetNo()));
 }
 /// <summary>
 /// Add new field to data element stack
 /// </summary>
 /// <param name="field">field enum</param>
 /// <param name="data">field data</param>
 private void AddElement(FIELDS field, byte[] data)
 {
     dataElements.Add(field.GetNo(), data);
 }