/// <summary> /// This method deletes a 'UserInterface' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'UserInterface' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject DeleteUserInterface(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 DeleteUserInterfaceStoredProcedure deleteUserInterfaceProc = null; // verify the first parameters is a(n) 'UserInterface'. if (parameters[0].ObjectValue as UserInterface != null) { // Create UserInterface UserInterface userInterface = (UserInterface)parameters[0].ObjectValue; // verify userInterface exists if (userInterface != null) { // Now create deleteUserInterfaceProc from UserInterfaceWriter // The DataWriter converts the 'UserInterface' // to the SqlParameter[] array needed to delete a 'UserInterface'. deleteUserInterfaceProc = UserInterfaceWriter.CreateDeleteUserInterfaceStoredProcedure(userInterface); } } // Verify deleteUserInterfaceProc exists if (deleteUserInterfaceProc != null) { // Execute Delete Stored Procedure bool deleted = this.DataManager.UserInterfaceManager.DeleteUserInterface(deleteUserInterfaceProc, 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 'UserInterface' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'UserInterface' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject FindUserInterface(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 Find StoredProcedure FindUserInterfaceStoredProcedure findUserInterfaceProc = null; // verify the first parameters is a 'UserInterface'. if (parameters[0].ObjectValue as UserInterface != null) { // Get UserInterfaceParameter UserInterface paramUserInterface = (UserInterface)parameters[0].ObjectValue; // verify paramUserInterface exists if (paramUserInterface != null) { // Now create findUserInterfaceProc from UserInterfaceWriter // The DataWriter converts the 'UserInterface' // to the SqlParameter[] array needed to find a 'UserInterface'. findUserInterfaceProc = UserInterfaceWriter.CreateFindUserInterfaceStoredProcedure(paramUserInterface); } // Verify findUserInterfaceProc exists if (findUserInterfaceProc != null) { // Execute Find Stored Procedure userInterface = this.DataManager.UserInterfaceManager.FindUserInterface(findUserInterfaceProc, dataConnector); // if dataObject exists if (userInterface != null) { // set returnObject.ObjectValue returnObject.ObjectValue = userInterface; } } } 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 'UserInterface' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'UserInterface' to delete. /// <returns>A PolymorphicObject object with all 'UserInterfaces' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <UserInterface> userInterfaceListCollection = null; // Create FetchAll StoredProcedure FetchAllUserInterfacesStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get UserInterfaceParameter // Declare Parameter UserInterface paramUserInterface = null; // verify the first parameters is a(n) 'UserInterface'. if (parameters[0].ObjectValue as UserInterface != null) { // Get UserInterfaceParameter paramUserInterface = (UserInterface)parameters[0].ObjectValue; } // Now create FetchAllUserInterfacesProc from UserInterfaceWriter fetchAllProc = UserInterfaceWriter.CreateFetchAllUserInterfacesStoredProcedure(paramUserInterface); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure userInterfaceListCollection = this.DataManager.UserInterfaceManager.FetchAllUserInterfaces(fetchAllProc, dataConnector); // if dataObjectCollection exists if (userInterfaceListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = userInterfaceListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }