/// <summary> /// This method deletes a 'DTNProcedure' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'DTNProcedure' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject DeleteDTNProcedure(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 DeleteDTNProcedureStoredProcedure deleteDTNProcedureProc = null; // verify the first parameters is a(n) 'DTNProcedure'. if (parameters[0].ObjectValue as DTNProcedure != null) { // Create DTNProcedure DTNProcedure dTNProcedure = (DTNProcedure)parameters[0].ObjectValue; // verify dTNProcedure exists if (dTNProcedure != null) { // Now create deleteDTNProcedureProc from DTNProcedureWriter // The DataWriter converts the 'DTNProcedure' // to the SqlParameter[] array needed to delete a 'DTNProcedure'. deleteDTNProcedureProc = DTNProcedureWriter.CreateDeleteDTNProcedureStoredProcedure(dTNProcedure); } } // Verify deleteDTNProcedureProc exists if (deleteDTNProcedureProc != null) { // Execute Delete Stored Procedure bool deleted = this.DataManager.DTNProcedureManager.DeleteDTNProcedure(deleteDTNProcedureProc, 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 'DTNProcedure' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'DTNProcedure' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject FindDTNProcedure(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals DTNProcedure dTNProcedure = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Find StoredProcedure FindDTNProcedureStoredProcedure findDTNProcedureProc = null; // verify the first parameters is a 'DTNProcedure'. if (parameters[0].ObjectValue as DTNProcedure != null) { // Get DTNProcedureParameter DTNProcedure paramDTNProcedure = (DTNProcedure)parameters[0].ObjectValue; // verify paramDTNProcedure exists if (paramDTNProcedure != null) { // Now create findDTNProcedureProc from DTNProcedureWriter // The DataWriter converts the 'DTNProcedure' // to the SqlParameter[] array needed to find a 'DTNProcedure'. findDTNProcedureProc = DTNProcedureWriter.CreateFindDTNProcedureStoredProcedure(paramDTNProcedure); } // Verify findDTNProcedureProc exists if (findDTNProcedureProc != null) { // Execute Find Stored Procedure dTNProcedure = this.DataManager.DTNProcedureManager.FindDTNProcedure(findDTNProcedureProc, dataConnector); // if dataObject exists if (dTNProcedure != null) { // set returnObject.ObjectValue returnObject.ObjectValue = dTNProcedure; } } } 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 'DTNProcedure' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'DTNProcedure' to delete. /// <returns>A PolymorphicObject object with all 'DTNProcedures' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <DTNProcedure> dTNProcedureListCollection = null; // Create FetchAll StoredProcedure FetchAllDTNProceduresStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get DTNProcedureParameter // Declare Parameter DTNProcedure paramDTNProcedure = null; // verify the first parameters is a(n) 'DTNProcedure'. if (parameters[0].ObjectValue as DTNProcedure != null) { // Get DTNProcedureParameter paramDTNProcedure = (DTNProcedure)parameters[0].ObjectValue; } // Now create FetchAllDTNProceduresProc from DTNProcedureWriter fetchAllProc = DTNProcedureWriter.CreateFetchAllDTNProceduresStoredProcedure(paramDTNProcedure); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure dTNProcedureListCollection = this.DataManager.DTNProcedureManager.FetchAllDTNProcedures(fetchAllProc, dataConnector); // if dataObjectCollection exists if (dTNProcedureListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = dTNProcedureListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }