Admin View Approve Seller - aditya1962/BuyGrand GitHub Wiki

Table of Contents

  1. Basic Overview
  2. States
  3. Data processing architecture
  4. Features
  5. Demos

Basic Overview

This page serves the admin to approve sellers. When a seller registers in the seller view the status of that seller is stored as unapproved. The seller cannot authorize for system resources until the admin approves the seller. The admin has the ability to approve a seller given their correct login credentials.

States

The usual data processing overview for other pages is to validate the user before performing an operation. For example, the username and the password of the user is validated before editing a category, before sending an email etc. However, for approving sellers this operation seems redundant. Therefore, state management is used as shown in the following image:

States

As shown in the image when the page loads initially the application checks whether the admin has validated to approve sellers. If not a validate button is displayed. Upon click of this button a modal is pop up where the username and the password is captured and validated. If the validation is successful, the state is set to validated and the page is reloaded. Upon reload the state is checked and if it is validated then the list of sellers who have not been approved are displayed. If the validation is unsuccessful then an error message is displayed and the state is set to invalidated.

The state management in this page occurs using enums in .NET. The following snippet shows how the states are stored within the code:

public partial class ApproveSeller : System.Web.UI.Page
{
       ...
        public enum State
        {
            Validated,
            Unvalidated,
            Invalidated
        }
       ...
}

Data Processing Overview

The data processing workflow for this page is shown in the image below:

Data Processing Workflow

As shown in the image, on page pre load state management is used to check whether the admin has validated to perform seller approvals. If validated, a list of sellers is loaded using the ApproveSeller web service in the ServiceApplicationBuyGrandAdmin application. By this way the admin does not require redundant validations at each approval. If it is the initial load a message to validate with a button which pop up a modal with username and password is displayed. At this state the state of the page is set to "unvalidated". On admin input the username and password is validated using the ~/Data/DataAccess.cs functions and the state is either set to "validated" (if correct) or "invalidated" (if incorrect). If "invalidated" an error message is displayed. Else, the page is reloaded.

AJAX is used to prevent the page from refreshing while repeatedly approving users. This way user experience is maintained and a successful approval message is displayed at every approval. During the process an intermediate code is used to bridge the AJAX request with the ApproveSeller web reference.

There are two databases used in this page. The BuyGrandAdminRR (or Read Replica) database is used for only reading data and the other database BuyGrandAdmin is used for all other operations such as inserting, updating and deleting data.

Features

  1. View seller details - On page load the following content for each seller is loaded in a table. Additionally, pagination is enabled with filters starting from 25 items per page.
    • Username
    • Name
    • Country
    • Gender
    • Email address
    • Button to approve the seller
  2. Approve seller - An unapproved seller could be approved

Demos