Manage Portal Users

This component is used to manage users in a specific portal by allowing you to enable/disable accounts, edit users roles/applications, and it generates a URL along with a join key so you can allow new users to join the portal.

Component Code

The first section of the code contains various parameters and variables needed for the component to function. Below are the methods used by the component and their purpose.

OnParametersSetAsync()

This method is called when the component is initialized and when there’s an update to the parent component. Its purpose is to assign variables their values.

ReadItems(GridReadEventArgs args)

This method is called when the grid performs and CUD event. Its purpose is to pull and bind the latest data to the grid.

Task<DataTable> GetData()

This method is called by ReadItems and it’s purpose is to call the stored procedure GI_GetPortalUsers. If the call was successful the results are parsed and returned in a DataTable, otherwise an empty DataTable is returned.

RefreshButtonOnClickHandler()

This method is called when the refresh button on the grid is selected. Its purpose is to refresh the data on the grid.

OnContextMenu(GridRowClickEventArgs args)

This method is called when a row in the grid is right clicked. Its purpose is to display a little menu with options that can be applied to the selected user such as enabling or disabling the user account.

OnRightClickMenuItemClicked(RightClickMenuItem item)

This method is called when an item from the right click menu is selected. Its purpose is to parse the RightClickMenuItem that was passed to determine what action to take then do it.

RefreshListBoxes(string listboxType)

This method is called when the list boxes in the edit roles/applications popup need to be refreshed with new data. Its purpose is to fetch the latest data for the list boxes and display it.

Task<List<ListBoxItem>> GetAvailableListData(string XMLElementName)

This method is called when the “Available” list box needs new data. Its purpose is to pull all the available options then remove any items that are already in the “Selected” list box. The data will be returned as a list.

Task<List<ListBoxItem>> GetSelectedListData(string listboxType)

This method is called when the “Selected” list box needs new data. Its purpose is to call TSQL and get the list of items already assigned to the selected user. The data will be returned as a list.

Task<IEnumerable<ListBoxItem>> UpdateSelectedItems(string targetFieldName)

This method is called when data for the list boxes is refreshed. Its purpose is to reselect any items that were previously selected before the data was refreshed. The data will be returned as an IEnumerable.

FilterData(string newValue, string listboxToFilter)

This method is called when a filter is entered for one of the list boxes. Its purpose is to filter the data in that list box using a contains with the value the user entered.

OnListBoxTransfer(ListBoxTransferEventArgs<ListBoxItem> args)

This method is called when any items are moved from one list box to another by any means. Its purpose is to call TSQL to add or remove the selected items to or from the selected user.

OnListBoxDrop(ListBoxDropEventArgs<ListBoxItem> args, string originID)

This method is called when items are dragged and dropped from one list box into the other. Its purpose is to create a ListBoxTransferEventArgs and call OnListBoxTransfer.

Updated on May 1, 2024

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment