/// <summary> /// This method updates a 'GitHubFollower'. /// This method uses the 'GitHubFollower_Update' procedure. /// </summary> /// <returns>True if successful false if not.</returns> /// </summary> public bool UpdateGitHubFollower(UpdateGitHubFollowerStoredProcedure updateGitHubFollowerProc, DataConnector databaseConnector) { // Initial Value bool saved = false; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // Execute Update. saved = this.DataHelper.UpdateRecord(updateGitHubFollowerProc, databaseConnector); } // return value return(saved); }
/// <summary> /// This method creates an instance of an /// 'UpdateGitHubFollowerStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'GitHubFollower_Update'. /// </summary> /// <param name="gitHubFollower"The 'GitHubFollower' object to update</param> /// <returns>An instance of a 'UpdateGitHubFollowerStoredProcedure</returns> public static UpdateGitHubFollowerStoredProcedure CreateUpdateGitHubFollowerStoredProcedure(GitHubFollower gitHubFollower) { // Initial Value UpdateGitHubFollowerStoredProcedure updateGitHubFollowerStoredProcedure = null; // verify gitHubFollower exists if(gitHubFollower != null) { // Instanciate updateGitHubFollowerStoredProcedure updateGitHubFollowerStoredProcedure = new UpdateGitHubFollowerStoredProcedure(); // Now create parameters for this procedure updateGitHubFollowerStoredProcedure.Parameters = CreateUpdateParameters(gitHubFollower); } // return value return updateGitHubFollowerStoredProcedure; }
/// <summary> /// This method updates a 'GitHubFollower' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'GitHubFollower' to update. /// <returns>A PolymorphicObject object with a value. internal PolymorphicObject UpdateGitHubFollower(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals GitHubFollower gitHubFollower = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Update StoredProcedure UpdateGitHubFollowerStoredProcedure updateGitHubFollowerProc = null; // verify the first parameters is a(n) 'GitHubFollower'. if (parameters[0].ObjectValue as GitHubFollower != null) { // Create GitHubFollower Parameter gitHubFollower = (GitHubFollower)parameters[0].ObjectValue; // verify gitHubFollower exists if (gitHubFollower != null) { // Now create updateGitHubFollowerProc from GitHubFollowerWriter // The DataWriter converts the 'GitHubFollower' // to the SqlParameter[] array needed to update a 'GitHubFollower'. updateGitHubFollowerProc = GitHubFollowerWriter.CreateUpdateGitHubFollowerStoredProcedure(gitHubFollower); } // Verify updateGitHubFollowerProc exists if (updateGitHubFollowerProc != null) { // Execute Update Stored Procedure bool saved = this.DataManager.GitHubFollowerManager.UpdateGitHubFollower(updateGitHubFollowerProc, dataConnector); // Create returnObject.Boolean returnObject.Boolean = new NullableBoolean(); // If save was successful if (saved) { // 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); }