/// <summary>
        /// Saves a 'UIField' object into the database.
        /// This method calls the 'Insert' or 'Update' method.
        /// </summary>
        /// <param name='uIField'>The 'UIField' object to save.</param>
        /// <returns>True if successful or false if not.</returns>
        public bool Save(ref UIField uIField)
        {
            // Initial value
            bool saved = false;

            // If the uIField exists.
            if (uIField != null)
            {
                // Is this a new UIField
                if (uIField.IsNew)
                {
                    // Insert new UIField
                    int newIdentity = this.Insert(uIField);

                    // if insert was successful
                    if (newIdentity > 0)
                    {
                        // Update Identity
                        uIField.UpdateIdentity(newIdentity);

                        // Set return value
                        saved = true;
                    }
                }
                else
                {
                    // Update UIField
                    saved = this.Update(uIField);
                }
            }

            // return value
            return(saved);
        }
        /// <summary>
        /// This method loads a 'UIField' object
        /// from the dataRow passed in.
        /// </summary>
        /// <param name='dataRow'>The 'DataRow' to load from.</param>
        /// <returns>A 'UIField' DataObject.</returns>
        public static UIField Load(DataRow dataRow)
        {
            // Initial Value
            UIField uIField = new UIField();

            // Create field Integers
            int captionfield         = 0;
            int dataTypefield        = 1;
            int dTNFieldIdfield      = 2;
            int fieldOrdinalfield    = 3;
            int idfield              = 4;
            int maxLengthfield       = 5;
            int maxRangefield        = 6;
            int minLengthfield       = 7;
            int minRangefield        = 8;
            int requiredfield        = 9;
            int userInterfaceIdfield = 10;

            try
            {
                // Load Each field
                uIField.Caption      = DataHelper.ParseString(dataRow.ItemArray[captionfield]);
                uIField.DataType     = (DataTypeEnum)DataHelper.ParseInteger(dataRow.ItemArray[dataTypefield], 0);
                uIField.DTNFieldId   = DataHelper.ParseInteger(dataRow.ItemArray[dTNFieldIdfield], 0);
                uIField.FieldOrdinal = DataHelper.ParseInteger(dataRow.ItemArray[fieldOrdinalfield], 0);
                uIField.UpdateIdentity(DataHelper.ParseInteger(dataRow.ItemArray[idfield], 0));
                uIField.MaxLength       = DataHelper.ParseInteger(dataRow.ItemArray[maxLengthfield], 0);
                uIField.MaxRange        = DataHelper.ParseDouble(dataRow.ItemArray[maxRangefield], 0);
                uIField.MinLength       = DataHelper.ParseInteger(dataRow.ItemArray[minLengthfield], 0);
                uIField.MinRange        = DataHelper.ParseDouble(dataRow.ItemArray[minRangefield], 0);
                uIField.Required        = DataHelper.ParseBoolean(dataRow.ItemArray[requiredfield], false);
                uIField.UserInterfaceId = DataHelper.ParseInteger(dataRow.ItemArray[userInterfaceIdfield], 0);
            }
            catch
            {
            }

            // return value
            return(uIField);
        }