/// <summary> /// This method inserts a 'NotificationHistory' object. /// This method uses the 'NotificationHistory_Insert' procedure. /// </summary> /// <returns>The identity value of the new record.</returns> /// </summary> public int InsertNotificationHistory(InsertNotificationHistoryStoredProcedure insertNotificationHistoryProc, DataConnector databaseConnector) { // Initial Value int newIdentity = -1; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // Execute Non Query newIdentity = this.DataHelper.InsertRecord(insertNotificationHistoryProc, databaseConnector); } // return value return(newIdentity); }
/// <summary> /// This method inserts a 'NotificationHistory' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'NotificationHistory' to insert. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject InsertNotificationHistory(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 Insert StoredProcedure InsertNotificationHistoryStoredProcedure insertNotificationHistoryProc = null; // verify the first parameters is a(n) 'NotificationHistory'. if (parameters[0].ObjectValue as NotificationHistory != null) { // Create NotificationHistory Parameter notificationHistory = (NotificationHistory)parameters[0].ObjectValue; // verify notificationHistory exists if (notificationHistory != null) { // Now create insertNotificationHistoryProc from NotificationHistoryWriter // The DataWriter converts the 'NotificationHistory' // to the SqlParameter[] array needed to insert a 'NotificationHistory'. insertNotificationHistoryProc = NotificationHistoryWriter.CreateInsertNotificationHistoryStoredProcedure(notificationHistory); } // Verify insertNotificationHistoryProc exists if (insertNotificationHistoryProc != null) { // Execute Insert Stored Procedure returnObject.IntegerValue = this.DataManager.NotificationHistoryManager.InsertNotificationHistory(insertNotificationHistoryProc, dataConnector); } } 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 an /// 'InsertNotificationHistoryStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'NotificationHistory_Insert'. /// </summary> /// <param name="notificationHistory"The 'NotificationHistory' object to insert</param> /// <returns>An instance of a 'InsertNotificationHistoryStoredProcedure' object.</returns> public static InsertNotificationHistoryStoredProcedure CreateInsertNotificationHistoryStoredProcedure(NotificationHistory notificationHistory) { // Initial Value InsertNotificationHistoryStoredProcedure insertNotificationHistoryStoredProcedure = null; // verify notificationHistory exists if (notificationHistory != null) { // Instanciate insertNotificationHistoryStoredProcedure insertNotificationHistoryStoredProcedure = new InsertNotificationHistoryStoredProcedure(); // Now create parameters for this procedure insertNotificationHistoryStoredProcedure.Parameters = CreateInsertParameters(notificationHistory); } // return value return(insertNotificationHistoryStoredProcedure); }