Project Requirements Specification: Visual C#
Windows Forms E-commerce Application
1. Introduction
1.1 Purpose
This document outlines the functional and data requirements for a desktop e-commerce application. The
application will serve two primary user roles: Clients (customers) and Administrators. Clients will use the
application to browse products, manage their shopping cart, place orders, and view their account information.
Administrators will use the application to manage products, categories, orders, and users.
1.2 Scope
The project involves developing a Windows Forms application using C# and the .NET platform. It will
implement the Onion Architecture pattern to ensure a clean separation of concerns, maintainability, and
testability. The core functionalities include user management, product catalog management, shopping cart
functionality, order processing, and administration capabilities.
2. Architectural Requirements
2.1 Platform & Language
• Language: C#
• Framework: .NET
• User Interface: Windows Forms (WinForms)
2.2 Architecture Style
• Pattern: Onion Architecture
o Core Layer: Contains domain entities (models). It has no dependencies on other layers.
o Domain Services Layer / Application Layer: Contains application logic, repository interfaces,
DTOs, and implementations of core interfaces. Depends only on the Core layer.
o Infrastructure Layer: Contains implementations for external concerns like database access
(Repositories), etc. Depends on the Application/Core layers (through interfaces).
o Presentation Layer (UI): The Windows Forms application itself. Depends on the Application
Layer.
3. Data Models (Core Layer Entities)
The following data models are required:
3.1 User
Represents both Client and Admin users, differentiated by a role attribute.
• UserID (Primary Key, e.g., integer or GUID)
• Username (string, unique)
• Password (string - Never store plain text passwords)
• Email (string, unique)
• FirstName (string)
• LastName (string)
• Role (e.g., enum: "Client", "Admin")
• IsActive (boolean, default: true)
• DateCreated (DateTime)
• LastLoginDate (DateTime, nullable)
3.2 Product
Represents items available for sale.
• ProductID (Primary Key, e.g., integer or GUID)
• Name (string)
• Description (string)
• Price (decimal)
• UnitsInStock (integer)
• CategoryID (Foreign Key referencing Category)
• ImagePath (string, optional - path to product image)
3.3 Category
Represents product categories for organization.
• CategoryID (Primary Key, e.g., integer or GUID)
• Name (string, unique)
• Description (string, optional)
3.4 Order
Represents a customer's submitted order.
• OrderID (Primary Key, e.g., integer or GUID)
• UserID (Foreign Key referencing User - the client who placed the order)
• OrderDate (DateTime)
• TotalAmount (decimal)
• Status (e.g., enum or string: "Pending", "Approved", "Denied", "Shipped")
• DateProcessed (DateTime, nullable - when approved/denied)
3.5 OrderDetail
Represents individual line items within an Order.
• OrderDetailID (Primary Key, e.g., integer or GUID)
• OrderID (Foreign Key referencing Order)
• ProductID (Foreign Key referencing Product)
• Quantity (integer)
3.6 Cart / CartItem
Represents items a client has added to their shopping cart before checkout. This might be implemented as a
collection of CartItem objects associated with a user session or user ID, potentially stored temporarily or in the
database.
• CartItemID (Primary Key, if stored in DB)
• UserID (Foreign Key referencing User)
• ProductID (Foreign Key referencing Product)
• Quantity (integer)
• DateAdded (DateTime)
4. Functional Requirements
4.1 Client User Functionality
ID Requirement Description
01 User shall be able to register a new client account.
02 User shall be able to log in using their credentials.
03 User shall be able to view a list/grid of available products.
04 User shall be able to view detailed information for a specific product.
05 User shall be able to add a specified quantity of a product to their shopping cart.
06 User shall be able to view the contents of their shopping cart (products, quantities, total price).
07 User shall be able to modify quantities or remove items from the cart.
08 User shall be able to submit the items in their cart as a new order.
09 User shall be able to view a history of their past orders and their status.
10 User shall be able to view their own account details (name, email).
11 User shall be able to edit their own account details (e.g., name, email, password).
4.2 Admin User Functionality
ID Requirement Description
01 Admin user shall be able to log in to a distinct Admin Panel/section.
02 Admin shall be able to view a list of all product categories.
03 Admin shall be able to create a new product category.
04 Admin shall be able to update the details of an existing product category.
05 Admin shall be able to delete a product category (Consider implications: disallow if products exist).
06 Admin shall be able to view a list of all products.
07 Admin shall be able to create a new product and assign it to a category.
08 Admin shall be able to update the details of an existing product (name, description, price, stock, category).
09 Admin shall be able to delete a product.
10 Admin shall be able to view a list of orders, filterable by status (especially "Pending").
11 Admin shall be able to approve a pending order, changing its status.
12 Admin shall be able to deny/reject a pending order, changing its status.
13 Admin shall be able to view a list of all client users.
14 Admin shall be able to activate a client user's account.
15 Admin shall be able to deactivate a client user's account.
16 Admin shall be able to add a new user with the "Admin" role.
17 Admin shall be able to view a list of all admin users.
18 Admin shall be able to manage other admin users (e.g., activate/deactivate).
5. Non-Functional Requirements (Examples)
• Usability: The user interface should be intuitive and easy to navigate for both client and admin users
within the Windows Forms environment.
• Performance: Data retrieval and updates should be performed within acceptable time limits (e.g.,
loading product lists within 2-3 seconds).
• Security: Passwords must be securely hashed. Authorization checks must prevent clients from accessing
admin functions and vice-versa.
• Maintainability: Code must adhere to Onion Architecture principles, be well-commented, and follow
consistent coding standards.
• Reliability: The application should handle potential errors gracefully (e.g., database connection issues,
invalid user input) without crashing.