Share via


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

Ff650125.e6a646fc-ef15-41dc-9f03-e6f876ac2a86(en-us,PandP.10).png

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

Ff650125.9bf84894-db51-4d3d-a9e4-8adf6ba8a5f6(en-us,PandP.10).png

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

Ff650125.3f618186-924f-4c77-9d8b-081077cdb0d5(en-us,PandP.10).png

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:

Home page on MSDN | Community site