Пример #1
0
        /// <summary>
        /// This method fetches a  'List<UIField>' object.
        /// This method uses the 'UIFields_FetchAll' procedure.
        /// </summary>
        /// <returns>A 'List<UIField>'</returns>
        /// </summary>
        public List <UIField> FetchAllUIFields(FetchAllUIFieldsStoredProcedure fetchAllUIFieldsProc, DataConnector databaseConnector)
        {
            // Initial Value
            List <UIField> uIFieldCollection = null;

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

                // Verify DataSet Exists
                if (allUIFieldsDataSet != null)
                {
                    // Get DataTable From DataSet
                    DataTable table = this.DataHelper.ReturnFirstTable(allUIFieldsDataSet);

                    // if table exists
                    if (table != null)
                    {
                        // Load Collection
                        uIFieldCollection = UIFieldReader.LoadCollection(table);
                    }
                }
            }

            // return value
            return(uIFieldCollection);
        }
Пример #2
0
        /// <summary>
        /// This method creates an instance of a
        /// 'FetchAllUIFieldsStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'UIField_FetchAll'.
        /// </summary>
        /// <returns>An instance of a(n) 'FetchAllUIFieldsStoredProcedure' object.</returns>
        public static FetchAllUIFieldsStoredProcedure CreateFetchAllUIFieldsStoredProcedure(UIField uIField)
        {
            // Initial value
            FetchAllUIFieldsStoredProcedure fetchAllUIFieldsStoredProcedure = new FetchAllUIFieldsStoredProcedure();

            // return value
            return(fetchAllUIFieldsStoredProcedure);
        }
Пример #3
0
        /// <summary>
        /// This method fetches all 'UIField' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'UIField' to delete.
        /// <returns>A PolymorphicObject object with all  'UIFields' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <UIField> uIFieldListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllUIFieldsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get UIFieldParameter
                // Declare Parameter
                UIField paramUIField = null;

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

                // Now create FetchAllUIFieldsProc from UIFieldWriter
                fetchAllProc = UIFieldWriter.CreateFetchAllUIFieldsStoredProcedure(paramUIField);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                uIFieldListCollection = this.DataManager.UIFieldManager.FetchAllUIFields(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }