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