/// <summary> /// This method deletes a 'NotificationHistory' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'NotificationHistory' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject DeleteNotificationHistory(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 DeleteNotificationHistoryStoredProcedure deleteNotificationHistoryProc = null; // verify the first parameters is a(n) 'NotificationHistory'. if (parameters[0].ObjectValue as NotificationHistory != null) { // Create NotificationHistory NotificationHistory notificationHistory = (NotificationHistory)parameters[0].ObjectValue; // verify notificationHistory exists if (notificationHistory != null) { // Now create deleteNotificationHistoryProc from NotificationHistoryWriter // The DataWriter converts the 'NotificationHistory' // to the SqlParameter[] array needed to delete a 'NotificationHistory'. deleteNotificationHistoryProc = NotificationHistoryWriter.CreateDeleteNotificationHistoryStoredProcedure(notificationHistory); } } // Verify deleteNotificationHistoryProc exists if (deleteNotificationHistoryProc != null) { // Execute Delete Stored Procedure bool deleted = this.DataManager.NotificationHistoryManager.DeleteNotificationHistory(deleteNotificationHistoryProc, 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); }
/// <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); }