/// <summary>
        /// This method creates an instance of a
        /// 'FindUIFieldStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'UIField_Find'.
        /// </summary>
        /// <param name="uIField">The 'UIField' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static new FindUIFieldStoredProcedure CreateFindUIFieldStoredProcedure(UIField uIField)
        {
            // Initial Value
            FindUIFieldStoredProcedure findUIFieldStoredProcedure = null;

            // verify uIField exists
            if (uIField != null)
            {
                // Instanciate findUIFieldStoredProcedure
                findUIFieldStoredProcedure = new FindUIFieldStoredProcedure();

                // if uIField.FindByUserInterfaceId is true
                if (uIField.FindByUserInterfaceId)
                {
                    // Change the procedure name
                    findUIFieldStoredProcedure.ProcedureName = "UIField_FindByUserInterfaceId";

                    // Create the @UserInterfaceId parameter
                    findUIFieldStoredProcedure.Parameters = SqlParameterHelper.CreateSqlParameters("@UserInterfaceId", uIField.UserInterfaceId);
                }
                else
                {
                    // Now create parameters for this procedure
                    findUIFieldStoredProcedure.Parameters = CreatePrimaryKeyParameter(uIField);
                }
            }

            // return value
            return(findUIFieldStoredProcedure);
        }
        /// <summary>
        /// This method finds a  'UIField' object.
        /// This method uses the 'UIField_Find' procedure.
        /// </summary>
        /// <returns>A 'UIField' object.</returns>
        /// </summary>
        public UIField FindUIField(FindUIFieldStoredProcedure findUIFieldProc, DataConnector databaseConnector)
        {
            // Initial Value
            UIField uIField = null;

            // Verify database connection is connected
            if ((databaseConnector != null) && (databaseConnector.Connected))
            {
                // First Get Dataset
                DataSet uIFieldDataSet = this.DataHelper.LoadDataSet(findUIFieldProc, databaseConnector);

                // Verify DataSet Exists
                if (uIFieldDataSet != null)
                {
                    // Get DataTable From DataSet
                    DataRow row = this.DataHelper.ReturnFirstRow(uIFieldDataSet);

                    // if row exists
                    if (row != null)
                    {
                        // Load UIField
                        uIField = UIFieldReader.Load(row);
                    }
                }
            }

            // return value
            return(uIField);
        }
        /// <summary>
        /// This method finds a 'UIField' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'UIField' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindUIField(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            UIField uIField = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Find StoredProcedure
                FindUIFieldStoredProcedure findUIFieldProc = null;

                // verify the first parameters is a 'UIField'.
                if (parameters[0].ObjectValue as UIField != null)
                {
                    // Get UIFieldParameter
                    UIField paramUIField = (UIField)parameters[0].ObjectValue;

                    // verify paramUIField exists
                    if (paramUIField != null)
                    {
                        // Now create findUIFieldProc from UIFieldWriter
                        // The DataWriter converts the 'UIField'
                        // to the SqlParameter[] array needed to find a 'UIField'.
                        findUIFieldProc = UIFieldWriter.CreateFindUIFieldStoredProcedure(paramUIField);
                    }

                    // Verify findUIFieldProc exists
                    if (findUIFieldProc != null)
                    {
                        // Execute Find Stored Procedure
                        uIField = this.DataManager.UIFieldManager.FindUIField(findUIFieldProc, dataConnector);

                        // if dataObject exists
                        if (uIField != null)
                        {
                            // set returnObject.ObjectValue
                            returnObject.ObjectValue = uIField;
                        }
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
        /// <summary>
        /// This method creates an instance of a
        /// 'FindUIFieldStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'UIField_Find'.
        /// </summary>
        /// <param name="uIField">The 'UIField' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static FindUIFieldStoredProcedure CreateFindUIFieldStoredProcedure(UIField uIField)
        {
            // Initial Value
            FindUIFieldStoredProcedure findUIFieldStoredProcedure = null;

            // verify uIField exists
            if (uIField != null)
            {
                // Instanciate findUIFieldStoredProcedure
                findUIFieldStoredProcedure = new FindUIFieldStoredProcedure();

                // Now create parameters for this procedure
                findUIFieldStoredProcedure.Parameters = CreatePrimaryKeyParameter(uIField);
            }

            // return value
            return(findUIFieldStoredProcedure);
        }