Registration Approval Use Case
The Registration Approval use case occurs when a manager approves or rejects a registration approval request that is submitted by an employee. The code that implements this use case demonstrates how to update a field of a list item and how to query for tasks.
Managers begin by selecting an approval task on their dashboards. The following illustration shows the manager dashboard.
The manager dashboard
Selecting an item from the Registration Approval Tasks Web Part generates an HTTP request. This request initiates the Page_Load handler that validates the request and calculates the fields that are used in the ASPX page. If the request passes this process, the manager sees the approval form that is shown in the following illustration.
Manager approval form
Selecting either Approved or Rejected from the drop-down list and clicking Submit causes the registration to be updated in the SharePoint list. The workflow process automatically generates the appropriate accounting entries. For more information, see Registration Workflow Implementation.
Classes Used by the Registration Approval Use Case
The following illustration shows the control flow for handling HTTP requests for the Registration Approval use case.
Registration approval control flow
The arrows in the preceding diagram represent the direction of the control flow. The following five classes are involved:
- RegistrationApproval. This class is the ASPX page definition produced by the Visual Studio designer. Internet Information Services (IIS) invokes handler methods of the RegistrationApproval class when it receives HTTP requests.
- RegistrationApprovalPresenter. This class is the presenter for the RegistrationApproval.aspx.
- TrainingCourseRepository. This class is the interface to the SharePoint list of available courses.
- RegistrationRepository. This class provides an Update method that modifies the field values of an existing registration.
- ListItemRepository. This class encapsulates some of the details of interacting with SharePoint lists.
Registration Phases
The Registration Approval use case occurs in two phases:
- The Page_Load phase
- The Submit_Click phase
These phases correspond to rendering the initial approval form in response to the initial HTTP request from the manager and processing the button click when the manager confirms the request for a new registration. The second phase updates the registration list item.
The Registration use case discusses the following topics:
- Registration Approval Page Load. This topic explains the page load process that begins when a manager submits an HTTP request to begin the registration process.
- Updating a Registration List Item. This topic explains how to update an item in the Registrations list. In this case, the item's status is updated.