コード例 #1
0
        /// <summary>
        /// This method finds a  'NotificationHistory' object.
        /// This method uses the 'NotificationHistory_Find' procedure.
        /// </summary>
        /// <returns>A 'NotificationHistory' object.</returns>
        /// </summary>
        public NotificationHistory FindNotificationHistory(FindNotificationHistoryStoredProcedure findNotificationHistoryProc, DataConnector databaseConnector)
        {
            // Initial Value
            NotificationHistory notificationHistory = null;

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

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

                    // if row exists
                    if (row != null)
                    {
                        // Load NotificationHistory
                        notificationHistory = NotificationHistoryReader.Load(row);
                    }
                }
            }

            // return value
            return(notificationHistory);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <summary>
        /// This method creates an instance of a
        /// 'FindNotificationHistoryStoredProcedure' object and
        /// creates the sql parameter[] array needed
        /// to execute the procedure 'NotificationHistory_Find'.
        /// </summary>
        /// <param name="notificationHistory">The 'NotificationHistory' to use to
        /// get the primary key parameter.</param>
        /// <returns>An instance of an FetchUserStoredProcedure</returns>
        public static FindNotificationHistoryStoredProcedure CreateFindNotificationHistoryStoredProcedure(NotificationHistory notificationHistory)
        {
            // Initial Value
            FindNotificationHistoryStoredProcedure findNotificationHistoryStoredProcedure = null;

            // verify notificationHistory exists
            if (notificationHistory != null)
            {
                // Instanciate findNotificationHistoryStoredProcedure
                findNotificationHistoryStoredProcedure = new FindNotificationHistoryStoredProcedure();

                // Now create parameters for this procedure
                findNotificationHistoryStoredProcedure.Parameters = CreatePrimaryKeyParameter(notificationHistory);
            }

            // return value
            return(findNotificationHistoryStoredProcedure);
        }