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

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Delete StoredProcedure
                DeleteEnumerationStoredProcedure deleteEnumerationProc = null;

                // verify the first parameters is a(n) 'Enumeration'.
                if (parameters[0].ObjectValue as Enumeration != null)
                {
                    // Create Enumeration
                    Enumeration enumeration = (Enumeration)parameters[0].ObjectValue;

                    // verify enumeration exists
                    if (enumeration != null)
                    {
                        // Now create deleteEnumerationProc from EnumerationWriter
                        // The DataWriter converts the 'Enumeration'
                        // to the SqlParameter[] array needed to delete a 'Enumeration'.
                        deleteEnumerationProc = EnumerationWriter.CreateDeleteEnumerationStoredProcedure(enumeration);
                    }
                }

                // Verify deleteEnumerationProc exists
                if (deleteEnumerationProc != null)
                {
                    // Execute Delete Stored Procedure
                    bool deleted = this.DataManager.EnumerationManager.DeleteEnumeration(deleteEnumerationProc, dataConnector);

                    // Create returnObject.Boolean
                    returnObject.Boolean = new NullableBoolean();

                    // If delete was successful
                    if (deleted)
                    {
                        // Set returnObject.Boolean.Value to true
                        returnObject.Boolean.Value = NullableBooleanEnum.True;
                    }
                    else
                    {
                        // Set returnObject.Boolean.Value to false
                        returnObject.Boolean.Value = NullableBooleanEnum.False;
                    }
                }
            }
            else
            {
                // Raise Error Data Connection Not Available
                throw new Exception("The database connection is not available.");
            }

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

            // locals
            NotificationHistory notificationHistory = null;

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

                // verify the first parameters is a 'NotificationHistory'.
                if (parameters[0].ObjectValue as NotificationHistory != null)
                {
                    // Get NotificationHistoryParameter
                    NotificationHistory paramNotificationHistory = (NotificationHistory)parameters[0].ObjectValue;

                    // verify paramNotificationHistory exists
                    if (paramNotificationHistory != null)
                    {
                        // Now create findNotificationHistoryProc from NotificationHistoryWriter
                        // The DataWriter converts the 'NotificationHistory'
                        // to the SqlParameter[] array needed to find a 'NotificationHistory'.
                        findNotificationHistoryProc = NotificationHistoryWriter.CreateFindNotificationHistoryStoredProcedure(paramNotificationHistory);
                    }

                    // Verify findNotificationHistoryProc exists
                    if (findNotificationHistoryProc != null)
                    {
                        // Execute Find Stored Procedure
                        notificationHistory = this.DataManager.NotificationHistoryManager.FindNotificationHistory(findNotificationHistoryProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method finds a 'RawImport' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindRawImport(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            RawImport rawImport = null;

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

                // verify the first parameters is a 'RawImport'.
                if (parameters[0].ObjectValue as RawImport != null)
                {
                    // Get RawImportParameter
                    RawImport paramRawImport = (RawImport)parameters[0].ObjectValue;

                    // verify paramRawImport exists
                    if (paramRawImport != null)
                    {
                        // Now create findRawImportProc from RawImportWriter
                        // The DataWriter converts the 'RawImport'
                        // to the SqlParameter[] array needed to find a 'RawImport'.
                        findRawImportProc = RawImportWriter.CreateFindRawImportStoredProcedure(paramRawImport);
                    }

                    // Verify findRawImportProc exists
                    if (findRawImportProc != null)
                    {
                        // Execute Find Stored Procedure
                        rawImport = this.DataManager.RawImportManager.FindRawImport(findRawImportProc, dataConnector);

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

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

            // locals
            Adverb adverb = null;

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

                // verify the first parameters is a 'Adverb'.
                if (parameters[0].ObjectValue as Adverb != null)
                {
                    // Get AdverbParameter
                    Adverb paramAdverb = (Adverb)parameters[0].ObjectValue;

                    // verify paramAdverb exists
                    if (paramAdverb != null)
                    {
                        // Now create findAdverbProc from AdverbWriter
                        // The DataWriter converts the 'Adverb'
                        // to the SqlParameter[] array needed to find a 'Adverb'.
                        findAdverbProc = AdverbWriter.CreateFindAdverbStoredProcedure(paramAdverb);
                    }

                    // Verify findAdverbProc exists
                    if (findAdverbProc != null)
                    {
                        // Execute Find Stored Procedure
                        adverb = this.DataManager.AdverbManager.FindAdverb(findAdverbProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 5
0
        /// <summary>
        /// This method finds a 'Method' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Method' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindMethod(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            Method method = null;

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

                // verify the first parameters is a 'Method'.
                if (parameters[0].ObjectValue as Method != null)
                {
                    // Get MethodParameter
                    Method paramMethod = (Method)parameters[0].ObjectValue;

                    // verify paramMethod exists
                    if (paramMethod != null)
                    {
                        // Now create findMethodProc from MethodWriter
                        // The DataWriter converts the 'Method'
                        // to the SqlParameter[] array needed to find a 'Method'.
                        findMethodProc = MethodWriter.CreateFindMethodStoredProcedure(paramMethod);
                    }

                    // Verify findMethodProc exists
                    if (findMethodProc != null)
                    {
                        // Execute Find Stored Procedure
                        method = this.DataManager.MethodManager.FindMethod(findMethodProc, dataConnector);

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

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

            // locals
            FirstName firstName = null;

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

                // verify the first parameters is a 'FirstName'.
                if (parameters[0].ObjectValue as FirstName != null)
                {
                    // Get FirstNameParameter
                    FirstName paramFirstName = (FirstName)parameters[0].ObjectValue;

                    // verify paramFirstName exists
                    if (paramFirstName != null)
                    {
                        // Now create findFirstNameProc from FirstNameWriter
                        // The DataWriter converts the 'FirstName'
                        // to the SqlParameter[] array needed to find a 'FirstName'.
                        findFirstNameProc = FirstNameWriter.CreateFindFirstNameStoredProcedure(paramFirstName);
                    }

                    // Verify findFirstNameProc exists
                    if (findFirstNameProc != null)
                    {
                        // Execute Find Stored Procedure
                        firstName = this.DataManager.FirstNameManager.FindFirstName(findFirstNameProc, dataConnector);

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

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

            // locals
            Enumeration enumeration = null;

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

                // verify the first parameters is a 'Enumeration'.
                if (parameters[0].ObjectValue as Enumeration != null)
                {
                    // Get EnumerationParameter
                    Enumeration paramEnumeration = (Enumeration)parameters[0].ObjectValue;

                    // verify paramEnumeration exists
                    if (paramEnumeration != null)
                    {
                        // Now create findEnumerationProc from EnumerationWriter
                        // The DataWriter converts the 'Enumeration'
                        // to the SqlParameter[] array needed to find a 'Enumeration'.
                        findEnumerationProc = EnumerationWriter.CreateFindEnumerationStoredProcedure(paramEnumeration);
                    }

                    // Verify findEnumerationProc exists
                    if (findEnumerationProc != null)
                    {
                        // Execute Find Stored Procedure
                        enumeration = this.DataManager.EnumerationManager.FindEnumeration(findEnumerationProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 8
0
        /// <summary>
        /// This method finds a 'ToDo' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'ToDo' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindToDo(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            ToDo toDo = null;

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

                // verify the first parameters is a 'ToDo'.
                if (parameters[0].ObjectValue as ToDo != null)
                {
                    // Get ToDoParameter
                    ToDo paramToDo = (ToDo)parameters[0].ObjectValue;

                    // verify paramToDo exists
                    if (paramToDo != null)
                    {
                        // Now create findToDoProc from ToDoWriter
                        // The DataWriter converts the 'ToDo'
                        // to the SqlParameter[] array needed to find a 'ToDo'.
                        findToDoProc = ToDoWriter.CreateFindToDoStoredProcedure(paramToDo);
                    }

                    // Verify findToDoProc exists
                    if (findToDoProc != null)
                    {
                        // Execute Find Stored Procedure
                        toDo = this.DataManager.ToDoManager.FindToDo(findToDoProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 9
0
        /// <summary>
        /// This method finds a 'CustomReader' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'CustomReader' to delete.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject FindCustomReader(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            CustomReader customReader = null;

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

                // verify the first parameters is a 'CustomReader'.
                if (parameters[0].ObjectValue as CustomReader != null)
                {
                    // Get CustomReaderParameter
                    CustomReader paramCustomReader = (CustomReader)parameters[0].ObjectValue;

                    // verify paramCustomReader exists
                    if (paramCustomReader != null)
                    {
                        // Now create findCustomReaderProc from CustomReaderWriter
                        // The DataWriter converts the 'CustomReader'
                        // to the SqlParameter[] array needed to find a 'CustomReader'.
                        findCustomReaderProc = CustomReaderWriter.CreateFindCustomReaderStoredProcedure(paramCustomReader);
                    }

                    // Verify findCustomReaderProc exists
                    if (findCustomReaderProc != null)
                    {
                        // Execute Find Stored Procedure
                        customReader = this.DataManager.CustomReaderManager.FindCustomReader(findCustomReaderProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 10
0
        /// <summary>
        /// This method fetches all 'CustomReader' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'CustomReader' to delete.
        /// <returns>A PolymorphicObject object with all  'CustomReaders' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <CustomReader> customReaderListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllCustomReadersStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get CustomReaderParameter
                // Declare Parameter
                CustomReader paramCustomReader = null;

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

                // Now create FetchAllCustomReadersProc from CustomReaderWriter
                fetchAllProc = CustomReaderWriter.CreateFetchAllCustomReadersStoredProcedure(paramCustomReader);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                customReaderListCollection = this.DataManager.CustomReaderManager.FetchAllCustomReaders(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 11
0
        /// <summary>
        /// This method fetches all 'RawImport' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete.
        /// <returns>A PolymorphicObject object with all  'RawImports' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <RawImport> rawImportListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllRawImportsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get RawImportParameter
                // Declare Parameter
                RawImport paramRawImport = null;

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

                // Now create FetchAllRawImportsProc from RawImportWriter
                fetchAllProc = RawImportWriter.CreateFetchAllRawImportsStoredProcedure(paramRawImport);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                rawImportListCollection = this.DataManager.RawImportManager.FetchAllRawImports(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 12
0
        /// <summary>
        /// This method fetches all 'ToDo' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'ToDo' to delete.
        /// <returns>A PolymorphicObject object with all  'ToDos' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <ToDo> toDoListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllToDosStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get ToDoParameter
                // Declare Parameter
                ToDo paramToDo = null;

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

                // Now create FetchAllToDosProc from ToDoWriter
                fetchAllProc = ToDoWriter.CreateFetchAllToDosStoredProcedure(paramToDo);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                toDoListCollection = this.DataManager.ToDoManager.FetchAllToDos(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
        /// <summary>
        /// This method fetches all 'NotificationHistory' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'NotificationHistory' to delete.
        /// <returns>A PolymorphicObject object with all  'NotificationHistorys' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <NotificationHistory> notificationHistoryListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllNotificationHistorysStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get NotificationHistoryParameter
                // Declare Parameter
                NotificationHistory paramNotificationHistory = null;

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

                // Now create FetchAllNotificationHistorysProc from NotificationHistoryWriter
                fetchAllProc = NotificationHistoryWriter.CreateFetchAllNotificationHistorysStoredProcedure(paramNotificationHistory);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                notificationHistoryListCollection = this.DataManager.NotificationHistoryManager.FetchAllNotificationHistorys(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
        /// <summary>
        /// This method fetches all 'FirstName' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'FirstName' to delete.
        /// <returns>A PolymorphicObject object with all  'FirstNames' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <FirstName> firstNameListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllFirstNamesStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get FirstNameParameter
                // Declare Parameter
                FirstName paramFirstName = null;

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

                // Now create FetchAllFirstNamesProc from FirstNameWriter
                fetchAllProc = FirstNameWriter.CreateFetchAllFirstNamesStoredProcedure(paramFirstName);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                firstNameListCollection = this.DataManager.FirstNameManager.FetchAllFirstNames(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 15
0
        /// <summary>
        /// This method fetches all 'Enumeration' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Enumeration' to delete.
        /// <returns>A PolymorphicObject object with all  'Enumerations' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <Enumeration> enumerationListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllEnumerationsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get EnumerationParameter
                // Declare Parameter
                Enumeration paramEnumeration = null;

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

                // Now create FetchAllEnumerationsProc from EnumerationWriter
                fetchAllProc = EnumerationWriter.CreateFetchAllEnumerationsStoredProcedure(paramEnumeration);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                enumerationListCollection = this.DataManager.EnumerationManager.FetchAllEnumerations(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 16
0
        /// <summary>
        /// This method fetches all 'Method' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Method' to delete.
        /// <returns>A PolymorphicObject object with all  'Methods' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <Method> methodListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllMethodsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get MethodParameter
                // Declare Parameter
                Method paramMethod = null;

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

                // Now create FetchAllMethodsProc from MethodWriter
                fetchAllProc = MethodWriter.CreateFetchAllMethodsStoredProcedure(paramMethod);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                methodListCollection = this.DataManager.MethodManager.FetchAllMethods(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 17
0
        /// <summary>
        /// This method fetches all 'Adverb' objects.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Adverb' to delete.
        /// <returns>A PolymorphicObject object with all  'Adverbs' objects.
        internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            List <Adverb> adverbListCollection = null;

            // Create FetchAll StoredProcedure
            FetchAllAdverbsStoredProcedure fetchAllProc = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Get AdverbParameter
                // Declare Parameter
                Adverb paramAdverb = null;

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

                // Now create FetchAllAdverbsProc from AdverbWriter
                fetchAllProc = AdverbWriter.CreateFetchAllAdverbsStoredProcedure(paramAdverb);
            }

            // Verify fetchAllProc exists
            if (fetchAllProc != null)
            {
                // Execute FetchAll Stored Procedure
                adverbListCollection = this.DataManager.AdverbManager.FetchAllAdverbs(fetchAllProc, dataConnector);

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

            // return value
            return(returnObject);
        }
Exemplo n.º 18
0
        /// <summary>
        /// This method inserts a 'UIField' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'UIField' to insert.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject InsertUIField(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 Insert StoredProcedure
                InsertUIFieldStoredProcedure insertUIFieldProc = null;

                // verify the first parameters is a(n) 'UIField'.
                if (parameters[0].ObjectValue as UIField != null)
                {
                    // Create UIField Parameter
                    uIField = (UIField)parameters[0].ObjectValue;

                    // verify uIField exists
                    if (uIField != null)
                    {
                        // Now create insertUIFieldProc from UIFieldWriter
                        // The DataWriter converts the 'UIField'
                        // to the SqlParameter[] array needed to insert a 'UIField'.
                        insertUIFieldProc = UIFieldWriter.CreateInsertUIFieldStoredProcedure(uIField);
                    }

                    // Verify insertUIFieldProc exists
                    if (insertUIFieldProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.UIFieldManager.InsertUIField(insertUIFieldProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

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

            // locals
            Member member = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Insert StoredProcedure
                InsertMemberStoredProcedure insertMemberProc = null;

                // verify the first parameters is a(n) 'Member'.
                if (parameters[0].ObjectValue as Member != null)
                {
                    // Create Member Parameter
                    member = (Member)parameters[0].ObjectValue;

                    // verify member exists
                    if (member != null)
                    {
                        // Now create insertMemberProc from MemberWriter
                        // The DataWriter converts the 'Member'
                        // to the SqlParameter[] array needed to insert a 'Member'.
                        insertMemberProc = MemberWriter.CreateInsertMemberStoredProcedure(member);
                    }

                    // Verify insertMemberProc exists
                    if (insertMemberProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.MemberManager.InsertMember(insertMemberProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

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

            // locals
            StreetName streetName = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Insert StoredProcedure
                InsertStreetNameStoredProcedure insertStreetNameProc = null;

                // verify the first parameters is a(n) 'StreetName'.
                if (parameters[0].ObjectValue as StreetName != null)
                {
                    // Create StreetName Parameter
                    streetName = (StreetName)parameters[0].ObjectValue;

                    // verify streetName exists
                    if (streetName != null)
                    {
                        // Now create insertStreetNameProc from StreetNameWriter
                        // The DataWriter converts the 'StreetName'
                        // to the SqlParameter[] array needed to insert a 'StreetName'.
                        insertStreetNameProc = StreetNameWriter.CreateInsertStreetNameStoredProcedure(streetName);
                    }

                    // Verify insertStreetNameProc exists
                    if (insertStreetNameProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.StreetNameManager.InsertStreetName(insertStreetNameProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
Exemplo n.º 21
0
        /// <summary>
        /// This method inserts a 'Artist' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Artist' to insert.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject InsertArtist(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            Artist artist = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Insert StoredProcedure
                InsertArtistStoredProcedure insertArtistProc = null;

                // verify the first parameters is a(n) 'Artist'.
                if (parameters[0].ObjectValue as Artist != null)
                {
                    // Create Artist Parameter
                    artist = (Artist)parameters[0].ObjectValue;

                    // verify artist exists
                    if (artist != null)
                    {
                        // Now create insertArtistProc from ArtistWriter
                        // The DataWriter converts the 'Artist'
                        // to the SqlParameter[] array needed to insert a 'Artist'.
                        insertArtistProc = ArtistWriter.CreateInsertArtistStoredProcedure(artist);
                    }

                    // Verify insertArtistProc exists
                    if (insertArtistProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.ArtistManager.InsertArtist(insertArtistProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
Exemplo n.º 22
0
        /// <summary>
        /// This method inserts a 'Notification' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Notification' to insert.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject InsertNotification(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            Notification notification = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Insert StoredProcedure
                InsertNotificationStoredProcedure insertNotificationProc = null;

                // verify the first parameters is a(n) 'Notification'.
                if (parameters[0].ObjectValue as Notification != null)
                {
                    // Create Notification Parameter
                    notification = (Notification)parameters[0].ObjectValue;

                    // verify notification exists
                    if (notification != null)
                    {
                        // Now create insertNotificationProc from NotificationWriter
                        // The DataWriter converts the 'Notification'
                        // to the SqlParameter[] array needed to insert a 'Notification'.
                        insertNotificationProc = NotificationWriter.CreateInsertNotificationStoredProcedure(notification);
                    }

                    // Verify insertNotificationProc exists
                    if (insertNotificationProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.NotificationManager.InsertNotification(insertNotificationProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
Exemplo n.º 23
0
        /// <summary>
        /// This method inserts a 'Verb' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'Verb' to insert.
        /// <returns>A PolymorphicObject object with a Boolean value.
        internal PolymorphicObject InsertVerb(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            Verb verb = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Insert StoredProcedure
                InsertVerbStoredProcedure insertVerbProc = null;

                // verify the first parameters is a(n) 'Verb'.
                if (parameters[0].ObjectValue as Verb != null)
                {
                    // Create Verb Parameter
                    verb = (Verb)parameters[0].ObjectValue;

                    // verify verb exists
                    if (verb != null)
                    {
                        // Now create insertVerbProc from VerbWriter
                        // The DataWriter converts the 'Verb'
                        // to the SqlParameter[] array needed to insert a 'Verb'.
                        insertVerbProc = VerbWriter.CreateInsertVerbStoredProcedure(verb);
                    }

                    // Verify insertVerbProc exists
                    if (insertVerbProc != null)
                    {
                        // Execute Insert Stored Procedure
                        returnObject.IntegerValue = this.DataManager.VerbManager.InsertVerb(insertVerbProc, dataConnector);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }

            // return value
            return(returnObject);
        }
Exemplo n.º 24
0
        /// <summary>
        /// Tests the connection to the database
        /// </summary>
        internal PolymorphicObject TestDataConnection(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // Create returnObject.Boolean
            returnObject.Boolean = new NullableBoolean();

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Set Boolean To True
                returnObject.Boolean.Value = NullableBooleanEnum.True;
            }
            else
            {
                // Raise Error Data Connection Not Available
                throw new Exception("The database connection is not available.");
            }

            // return value
            return(returnObject);
        }
        /// <summary>
        /// This method updates a 'FirstName' object.
        /// </summary>
        /// <param name='List<PolymorphicObject>'>The 'FirstName' to update.
        /// <returns>A PolymorphicObject object with a value.
        internal PolymorphicObject UpdateFirstName(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // Initial Value
            PolymorphicObject returnObject = new PolymorphicObject();

            // locals
            FirstName firstName = null;

            // If the data connection is connected
            if ((dataConnector != null) && (dataConnector.Connected == true))
            {
                // Create Update StoredProcedure
                UpdateFirstNameStoredProcedure updateFirstNameProc = null;

                // verify the first parameters is a(n) 'FirstName'.
                if (parameters[0].ObjectValue as FirstName != null)
                {
                    // Create FirstName Parameter
                    firstName = (FirstName)parameters[0].ObjectValue;

                    // verify firstName exists
                    if (firstName != null)
                    {
                        // Now create updateFirstNameProc from FirstNameWriter
                        // The DataWriter converts the 'FirstName'
                        // to the SqlParameter[] array needed to update a 'FirstName'.
                        updateFirstNameProc = FirstNameWriter.CreateUpdateFirstNameStoredProcedure(firstName);
                    }

                    // Verify updateFirstNameProc exists
                    if (updateFirstNameProc != null)
                    {
                        // Execute Update Stored Procedure
                        bool saved = this.DataManager.FirstNameManager.UpdateFirstName(updateFirstNameProc, dataConnector);

                        // Create returnObject.Boolean
                        returnObject.Boolean = new NullableBoolean();

                        // If save was successful
                        if (saved)
                        {
                            // Set returnObject.Boolean.Value to true
                            returnObject.Boolean.Value = NullableBooleanEnum.True;
                        }
                        else
                        {
                            // Set returnObject.Boolean.Value to false
                            returnObject.Boolean.Value = NullableBooleanEnum.False;
                        }
                    }
                    else
                    {
                        // Raise Error Data Connection Not Available
                        throw new Exception("The database connection is not available.");
                    }
                }
            }

            // return value
            return(returnObject);
        }
Exemplo n.º 26
0
        /// <summary>
        /// This method is used to execute a query that does not return a value.
        /// To call this method, you must set following:
        /// </summary>
        /// <param name="parameters">The parameters must be set to call this method.
        /// 1. 'ProcedureName' - The String value must be set for this parameter.
        /// 2. 'SqlParameters' (Optional) - If the stored procedure to be called requires parameters
        /// then you must pass in the SqlParameters[] array as this parameter.
        /// It does not matter the order of these parameters.
        /// </param>
        /// <param name="dataConnector">The database connection to use to execute this procedure.</param>
        /// A successful will call will set returnValue.Boolean to true (executed)
        /// In the event the procedure does not execute (returnValue.Boolean = false)
        /// check the following:
        /// returnValue.Name   = 'Error" - Will be set to error
        /// returnValue.Text   = Will be set to the Exception.ToString();
        /// returnValue.Object = Will Contain the Exception that occurred.
        public PolymorphicObject ExecuteNonQuery(List <PolymorphicObject> parameters, DataConnector dataConnector)
        {
            // initial value
            PolymorphicObject returnValue = new PolymorphicObject();

            // Set to false
            returnValue.Boolean = new NullableBoolean(false);

            // locals
            bool executed = false;

            try
            {
                // If the data connection is connected
                if ((dataConnector != null) && (dataConnector.Connected == true))
                {
                    // Create a StoredProcedure
                    StoredProcedure storedProcedure = new StoredProcedure();

                    // Create a StoredProcedure object
                    storedProcedure.ProcedureName = FindProcedureName(parameters);

                    // Set the Parameters for the StoredProcedure
                    storedProcedure.Parameters = FindSqlParameters(parameters);

                    // if the ProcedureName is set
                    if (!String.IsNullOrEmpty(storedProcedure.ProcedureName))
                    {
                        // Create an instance of the DataHelper
                        DataHelper dataHelper = new DataHelper();

                        // Perform an update
                        executed = dataHelper.UpdateRecord(storedProcedure, dataConnector);

                        // set the return value
                        returnValue.Boolean = new NullableBoolean(executed);
                    }
                }
                else
                {
                    // Raise Error Data Connection Not Available
                    throw new Exception("The database connection is not available.");
                }
            }
            catch (Exception error)
            {
                // for debugging only
                string err = error.ToString();

                // Set the text of the
                returnValue.Name = "Error";

                // Set the text for the returnValue
                returnValue.Text = err;

                // set the return value
                returnValue.ObjectValue = error;
            }

            // return value
            return(returnValue);
        }