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