A.S.M Jayasinghe - ADCoursework1
A.S.M Jayasinghe - ADCoursework1
ID Number: 00217779
1
Table of Contents
ABSTRACT ........................................................................................................................................... 4
1. CHAPTER 01 - INTRODUCTION ..................................................................................................... 5
1.1 Project Overview ............................................................................................................................... 5
1.2 Purpose & Scope ............................................................................................................................... 5
2. CHAPTER 02 – ANALYSIS ................................................................................................................ 6
2.1 Introduction ....................................................................................................................................... 6
2.2 Scope ................................................................................................................................................. 6
2.3. Non-Functional Requirements ......................................................................................................... 7
2.4 Use Cases .......................................................................................................................................... 8
2.5. System Constraints ......................................................................................................................... 12
2.6. Assumptions ................................................................................................................................... 13
03.CHAPTER 03 – SYSTEM DESIGN ................................................................................................. 14
3.1. Introduction .................................................................................................................................... 14
3.2. Architectural Overview .................................................................................................................. 14
3.3. Original Classes.............................................................................................................................. 19
3.4. Database Design ............................................................................................................................. 20
3.5. Interface Design ............................................................................................................................. 24
04. CHAPTER 04 – IMPLEMENTATION .......................................................................................... 30
4.1. Introduction .................................................................................................................................... 30
4.2. Programming Style ......................................................................................................................... 30
4.3. Method Reference Guide................................................................................................................ 37
4.4. OOP Concepts ................................................................................................................................ 46
4.5. User Interface and Usability ........................................................................................................... 48
4.6. Search Algorithm ........................................................................................................................... 49
05. CHAPTER 05 – USER GUIDE & INTERFACE OVERVIEW ................................................... 51
5.1. Introduction .................................................................................................................................... 51
5.2. System Overview ........................................................................................................................... 51
5.3. User Roles ...................................................................................................................................... 51
5.4. Getting Started................................................................................................................................ 52
5.5. ADMIN USER GUIDE .................................................................................................................. 56
5.6. CUSTOMER USER GUIDE.......................................................................................................... 75
2
6. CHAPTER 06 – REFLECTION OF EXPERIENCE ...................................................................... 84
6.1. Personal Reflection on Using C# and Visual Studio ...................................................................... 84
6.2. Issues/Challenges and Solutions .................................................................................................... 84
6.3. Features You Liked and Why......................................................................................................... 86
7. CHAPTER 07– CONCLUSION ........................................................................................................ 87
7.1. Summary of Key Points ................................................................................................................. 87
7.2. Final Thoughts................................................................................................................................ 87
8. CHAPTER 08– REFERENCES......................................................................................................... 88
3
ABSTRACT
The ABC Car Traders Windows Forms application has been designed to help the ABC Car
Traders deal effectively with the management of the stock and the customer theme. The system
has two major users which are the administrator and customers. Administrators are empowered
to use the system to manage car and car parts inventory, process customer orders as well as
prepare various business reports while the customers can register, check out the stock available,
place orders and check on their order status.
The application is developed within the .Net Framework which embodies a 3-tiered MVC
development architecture and employs ADO.NET as the backend database management system
and iTextSharp for PDF presentation. The interfaces of the systems, the usage of attributes
according to users, and the designed business logic help the system to be to the point and
effective for all parties involved in the process.
This document presents the analysis features, the system design, implementation, features of the
user interface, and development of the system with respect to the challenges encountered and
lessons learnt.
4
1. CHAPTER 01 - INTRODUCTION
Technical Stack:
Admin Module:
Customer Module:
5
2. CHAPTER 02 – ANALYSIS
2.1 Introduction
The main focus of Requirement Analysis is to understand the functional and non-functional
requirements of the system and document them. This section will identify, in a systematic way,
the needs of the users of the system, including administrators and customers, to ensure that the
software will meet the business objectives of ABC Car Traders. It includes detailed use cases
that show how different users will interact with the system. It also outlines constraints and
assumptions that guide the development process.
2.2 Scope
The functionalities of the software system developed for ABC Car Traders are enumerated
below.
✓ Login & customer registration: this would provide access to the administrators in
managing the system. If they want to manually create an account, admin ca use the same
screen to register a customer too
✓ Manage Car Details: Add, edit and delete car details in the inventory.
✓ Manage Car Parts Details: Stock of the car parts shall be managed, adding items,
editing, or deleting them.
✓ Manage Customer Details: Customer details are to be updated as and when required.
✓ Reports: Reports on current Orders, Stock report for Cars and Car Parts, customers.
6
2.2.2 Customer Module:
✓ Login: Allow the customer to securely log in to their account and the features provided
by this system.
✓ Browse Car Details and Order: Allow the customer to search for available cars within
the inventory and place an order for cars and car parts.
✓ Browse Car Parts Details: Allow customers to search for available car parts and place
orders for cars and car parts.- Automatically, order details will be downloaded upon
order confirmation.
✓ View Order Status: Customers can check on order status of their history
The system will be designed to ensure that the use of the system is smooth and easy for both
administrators and customers so that ABC Car Traders can further provide quality service and
achieve profitable growth through efficient business operations.
• Usability Requirements
• Reliability Requirements
7
2.4 Use Cases
2.4.1. Use Case Diagram
A use case diagram is a visual representation that shows the interactions between users (actors)
and the system. It provides a high-level overview of how different types of users engage with
the system's functionalities.
8
2.4.2. Detailed Use Case Descriptions
1. Login
2. Register
• Actor(s): Unregistered Customer, Admin (incase of customer needed help to register his
account in the physical service center)
• Description: Allows unregistered customers to create an account. Admins can also
facilitate registration for customers in person.
• Precondition: Customer is not yet registered in the system.
• Postcondition: New customer account is created and can log in.
• Actor(s): Admin
• Description: Admin can add, edit, or delete car details in the inventory.
• Precondition: Admin is logged in.
• Postcondition: Car inventory is updated.
• Actor(s): Admin
• Description: Admin can manage car part details in the inventory.
• Precondition: Admin is logged in.
• Postcondition: Car parts inventory is updated.
• Actor(s): Customer/Admin
• Description: Customers and Admins both can browse and view details of cars.
• Precondition: Customer/Admin is logged in.
• Postcondition: Customer/Admin can view car details.
6. Order Car
• Actor(s): Customer
9
• Description: Customer View car details and from there and orders a car from the
inventory.
• Precondition: Customer is logged in and has selected a car.
• Postcondition: Car order is placed.
• Actor(s): Customer
• Description: Customer selects and orders car parts from the inventory.
• Precondition: Customer is logged in and has selected car parts.
• Postcondition: Car parts order is placed.
8. Confirm Order
• Actor(s): Customer
• Description: Customer confirms the order after reviewing the details.(common details
will be auto populated from the system)
• Precondition: Customer has selected items to purchase.
• Postcondition: Order is confirmed and awaiting admin action.
• Actor(s): System
• Description: System generates a PDF confirmation for the customer’s order.
• Precondition: Order is confirmed.
• Postcondition: Order confirmation PDF is generated.
• Actor(s): System
• Description: System calculates the total value of the order.
• Precondition: Customer has added items to the order.
• Postcondition: Total order value is calculated.
• Actor(s): Admin
• Description: Admin reviews and processes the confirmed order.
• Precondition: Order is confirmed by the customer.
• Postcondition: Order is processed and ready for fulfillment.
• Actor(s): Admin
• Description: Admin rejects the order if necessary (e.g., due to out-of-stock items).
• Precondition: Order is confirmed by the customer.
10
• Postcondition: Order is rejected, and the customer can view it in the order history
• Actor(s): Admin
• Description: Admin marks the order as complete after processing.
• Precondition: Order is processed.
• Postcondition: Order is marked as complete.
• Actor(s): Customer
• Description: Customers can view their past orders and current order status.
• Precondition: Customer is logged in.
• Postcondition: Order history is displayed.
• Actor(s): Customer
• Description: Customer cancels an order that is still pending.
• Precondition: Order is in pending status.
• Postcondition: Order is canceled.
• Actor(s): Admin
• Description: Admin generates various reports, including customer reports, order
reports, and stock reports.
• Precondition: Admin is logged in.
• Postcondition: Selected report is generated.
• a. Customer Report: Extends "Generate Reports" to produce a report on customer data.
• b. Order Report: Extends "Generate Reports" to produce a report on order data.
11
2.5. System Constraints
Hardware Constraints:
• Minimum Requirements:
✓ The application must run on client machines with at least 8GB of RAM and an
Intel i3 processor or equivalent.
✓ The application requires a minimum of 500MB of available disk space for
installation.
• Peripheral Compatibility:
✓ The application should support common input devices, such as a keyboard and
mouse.
✓ The system must be compatible with standard printers for printing order
confirmations and reports.
Software Constraints:
• Operating System:
o The application must be compatible with Windows 10 and Windows 11.
• Development Framework:
o The application is developed using .NET Framework 4.8, and it must be
deployed in environments that support this framework. Used Visual Studio 2022
for coding.
• Database:
o The system must integrate with Microsoft SQL Server 2019 for data storage.
• Dependencies:
✓ The application relies on certain third-party libraries for PDF generation and data
visualization, (iTextSharp)
12
2.6. Assumptions
1. User Proficiency:
✓ The system is developed on the premise of users who are at least computer
literate. In other words, they are familiar with working in Windows, using
general functions like mouse and keyboard controls, and following simple
instructions on the screen.
✓ Users will then be able to independently register in the system or, if necessary,
with the support of an Admin in a service center when ordering a car.
13
03.CHAPTER 03 – SYSTEM DESIGN
3.1. Introduction
System design represents the translation of the requirements above into a concrete architecture,
which defines how the system will be structured and how different components will interact. It
would include detailed design diagrams, including class diagrams and ER diagrams, with design
considerations over key components like user authentication, order processing, and inventory
management.
14
The application uses a 3-tier structure with the MVC (Model-View-Controller)
pattern. This helps keep different parts separate, making it easier to maintain and grow.
The UI is designed in .NET using Windows Forms, which works as the View in an
MVC architecture. This part collects input from the user through forms like Add Car,
Edit Car, and Car Listing and displays data back to the user.
3. Model Layer:
Model represents the organization of data in an application, which includes things such
as cars. It organizes the data in an application and is used by Controller to handle data
interaction with the database.
15
4. Data Layer
ADO.NET acts as a data access layer in order to interact with the SQL Server
database. This provides the facility to carry out all the database operations such as
retrieving, persisting, and modifying the data. The persisted data of car records along
with customer information is maintained by the SQL Server database
Interface
• UI Structure(I have created all the forms under the Interface Folder and those
forms will be loaded in 2 main forms as below)
• Responsibilities:
16
Model:
• The Model component in this application is responsible for representing the core data
entities/data structure.
• Classes in the Model Folder:
• Responsibilities:
Service Folder
• The Service, in the application, was in charge of the actions by the users, interacted with
the Model, and refreshed the View. Inside the folder Service, there are classes that work
as Controllers, taking in charge the interaction with the SQL Server database through
ADO.NET.
• Database Management System: The application uses SQL Server, managed through
SQL Server Management Studio (SSMS).
17
• Data Models: The database schema includes tables for users, customers, cars, car parts,
and orders. These tables are designed to maintain relationships between entities, such as
linking orders to customers and cars.
• Service Layer: The Service classes in the application are responsible for executing SQL
queries and interacting with the database.
18
3.3. Original Classes
This presents the class diagrams for the key entities in the application, such as Users, Customers,
Orders, Cars and CarParts. Each diagram outlines the attributes and methods associated with
these classes, as well as the relationships between them.
19
3.4. Database Design
3.4.1. ER Diagrams
High-level ER Diagram
20
3.4.2. Relationships Between Tables
Database Diagram
21
Database Design
1. User Table
• Fields:
o id: Primary Key (PK). A unique identifier for each user.
o username: A unique string used for user login.
o password: The user’s password.
o role: The role of the user (e.g., Admin, Customer).
2. Customers Table
• Fields:
o customerId: Primary Key (PK). A unique identifier for each customer.
o userId: Foreign Key (FK) that links to the User table, associating each customer
with a user.
o firstName, lastName: The customer's name.
o phone: The customer’s phone number.
o email: The customer’s email address.
o One-to-Many: The Orders table has a foreign key (customerId) that references
the customerId field in the Customers table. This relationship indicates that one
customer can place multiple orders.
22
3. Orders Table
• Fields:
o orderId: Primary Key (PK). A unique identifier for each order.
o customerId: Foreign Key (FK) that links to the Customers table, associating each
order with a specific customer.
o orderDate: The date and time when the order was placed.
o orderStatus: The current status of the order (e.g., pending, completed).
o total: The total cost of the order.
o orderNote: Any additional notes related to the order.
o itemId: The ID of the item being ordered, which could be a car or a car part.
o itemType: Specifies whether the item is a car or a car part.
o unitPrice: The price per unit of the ordered item.
o phone: The contact number associated with the order.
o orderQuantity: The quantity of the item ordered.
o shippingAddress: The address where the order will be delivered.
4. Car Table
• Fields:
o carId: Primary Key (PK). A unique identifier for each car.
o make: The manufacturer of the car.
o model: The car model.
o year: The year the car was manufactured.
o price: The price of the car.
o carDescription: A textual description of the car.
o stockQuantity: The quantity of this car model available in the inventory.
23
orders can include the same car, but each order can only reference one car or car
part per entry.
5. CarParts Table
• Fields:
o partId: Primary Key (PK). A unique identifier for each car part.
o partName: The name of the car part.
o partDescription: A description of the car part.
o price: The price of the car part.
o stockQuantity: The quantity of this car part available in the inventory.
o partNumber: A unique identifier for the car part.
o carMake, carModel: References to the car make and model that the part is
compatible with.
• Relationship with Orders Table:
o One-to-Many: If an order references a car part (itemType = 'CarPart'), the
itemId in the Orders table corresponds to the partId in the CarParts table.
Multiple orders can include the same car part.
The following wireframes are the introductory design of the ABC Car Traders Windows Forms
application. These wireframes visually communicate the layout and structure of the user
interface, providing an early illustration of how the system will look and function. Each of these
wireframes is interconnected to another part of the application, such as the login screen, admin
dashboard, and customer order form.
Login Screen
Below is a very basic layout of the login screen, where the user will actually type information
in. The screen shall contain fields for the username and password, a button to log in, and a link
24
to register in case users access it for the first time. This wireframe represents the very first
interaction that a user will have with an application regarding secure access.
Admin Home
Below is a simple layout viewed by Admins once they log in. This screen has on it a box that
shows the count of pending orders and links to view them, the number of customers, and a link
to view those.
25
Car Management
This is the design for a screen that will show how Admins can manage car details. The screen
will contain a data grid view for displaying car details and forms for Add, Edit, and Delete.
Even the Stock Report for the cars will be accessed through this screen.
Adding/Editing a Car
This screen wireframe shows the basic layout where Admins can add a car stock. The screen
includes input fields, buttons and browse button to upload an image.
26
Car Parts Management
Admins can overview the details of car parts through this basic wireframe layout. The screen
contains a data grid view to show the details of car parts, forms for adding, editing, and
deletion, and a Stock Report for the car parts can be opened from this screen.
Customer Mgmt.
Following is the wire frame, which shows a basic layout through which an admin can manage
customer details. It includes a data grid view to show the customer information and forms to
edit or delete. The report for car parts can also be accessed through this screen.
27
Order screen
This wireframe depicts the basic layout where the admin manages the order details. This screen
will be enabled with a data grid view to show order details based on the order status.
28
Car Screen- Customer Interface
This screen wireframe shows the basic layout where customer can view the car details. The
screen includes data grid view to show cars ,search and a button to view car details.
29
04. CHAPTER 04 – IMPLEMENTATION
4.1. Introduction
This chapter discusses the programming style adopted in developing the ABC Car Traders
application, including structure and writing of code. It shall be in regard to OOP concepts and
best practices for achieving readability, maintainability, and efficiency of the code. It
emphasizes clear naming conventions, commenting of codes, handling exceptions, and
validation of data for robustness and friendliness of the application toward the end user.4.2.
Programming Style
• Form Names:
o Used PascalCase.
o Example: FormAddCar, FormAdminDashboard, FormLogin.
• Method Names:
o Used PascalCase..
o Example: GetCustomerDetailsByUserId (), AddCustomer (), ValidateUser ().
30
o Example: carParts, unitPrice, totalPrice.
• Property Names:
o Used PascalCase.
o Example: PartId, PartName, CarId.
• Event Names:
o Used PascalCase.
o Example: OrderPlaced, LoginFailed, DataLoaded.
• Control Names:
o Used camelCase.
o Labels- lblAddCarMake
31
o Buttons – btnAddCar , btnCancelAddCar,
32
o Picturebox- pbAddCarImage, pbLogo
• Namespace Names:
o Used PascalCase.
o Example: ABCCarshop2.Model;, ABCCarshop2.Interfaces;
ABCCarshop2.Services;,
Commenting in Code
Within this project, comments are extensively used to enhance readability within the code and
make code maintenance easier.
Single-Line Comments:
o Used to explain specific lines of code or provide quick notes about the logic
being implemented.
33
Class level comments multi lined
In this project, exception handling is implemented using try-catch blocks. This approach allows
the application to gracefully handle errors and continue operating or fail safely. Key practices
include:
• The code also uses try-catch blocks for handling database work-related problems. This
will ensure that upon the occurrence of an error, smooth handling will take place, which
means the application will not crash; instead, it displays explicit messages in case of an
error.
• SqlException Handling:
It specifically catches SqlException instances: these are errors thrown when SQL Server
has a problem-such as a connection problem, or a mistake in the syntax of the query.
When a SqlException is caught, a new instance of ApplicationException is thrown. This
provides a custom error message, which includes information about the SQL error.
• Exception Handling:
It also catches the general Exception to handle unexpected errors. In this way, catching
ensures the handling of any exception other than SqlException so that the code can log
or react to the error correctly.
34
• FileNotFoundException
• OutOfMemoryException
• ApplicationException:
o The code then wraps these exceptions inside a new ApplicationException. This
custom exception class can carry extra context or even information that could be
helpful to distinguish between different types of errors, which can also be useful
for error logging or further processing by the application.
Data validation is the process of ensuring that data input to any system is correct, clean, and
useful. Checks and rules performed on data assert compliance to pre-defined standards for such
data, even before processing or storage in a database. Validation of data can be made at the time
of input, while being processed, or at output.
Input Validation:
Required Field Validation & Format checks: Ensuring that necessary fields are not left
empty and data is in the correct format (e.g., a car model or the year of the car, email format).
35
36
Processing Validation:
Cross-field Validation: Checking that related fields have compatible values (e.g., password and
confirm password match validation).
Uniqueness Checks: Ensuring that data that must be unique, like the username is already exist,
is not duplicated.
1. LoginForm.cs
37
o Handles the register button click event, which redirects the user to the
registration form.
2. RegisterForm.cs
3. UserService.cs
This method checks if the given username and password match an existing user in the
database. It returns the role of the user if the credentials are valid. The method includes
error handling to manage potential SQL and general exceptions.
o
• GetUserRole(string username)
The GetUserRole method retrieves the role of a user from the database based on the
provided username. It establishes a connection to the SQL Server, executes a query to
fetch the user's role, and returns it as a string. The method includes error handling to
manage potential SQL and general exceptions.
Registers a new user by inserting their details (username, password, role) into the
database. It returns the user ID of the newly created user.
The method includes error handling to manage potential SQL and general exceptions.
• CheckUsernameExists(string username)
38
This method checks if a username already exists in the database to prevent
duplicate registrations.
1. CustomerService.cs
• AddCustomer(Customer customer)
o Adds a new customer to the database by inserting details like userId, firstName,
lastName, email, and phone. Returns true if the operation is successful.
• GetCustomerByUserId(int userId)
o Retrieves customer details based on the provided userId. Returns a Customer
object with the retrieved details.
• UpdateCustomer(Customer customer)
o Updates an existing customer's information in the database. Returns true if the
update is successful.
• DeleteCustomer(int userId)
o Deletes a customer from the database based on the userId. Returns true if the
deletion is successful.
• GetAllCustomers()
o Retrieves a list of all customers from the database. Returns a DataTable
containing the customer records.
2. CustomerListing.cs
39
4.3.4 Car Related Methods
1. AddCar.cs
2. CarListCustomer.cs
3. CarListing.cs
Loads and displays all car data in the DataGridView for administrative listing. It
configures the columns, particularly hiding the "Car ID" and adjusting the "Year"
column.
40
This method resizes a given image (Bitmap) to a specified thumbnail size.
This method generates a stock level report for cars based on the data displayed in a
DataGridView.
4. EditCar.cs
ViewCarDetails.cs
5. CarService.cs
• AddCar(Cars car)
o Adds a new car to the database by inserting car details such as model, price, and
stock quantity.
• GetCarById(int carId)
o Retrieves car details from the database based on the provided car ID. Returns a
Cars object with the car's details.
• UpdateCar(Cars car)
41
o Updates the details of an existing car in the database. Returns true if the update is
successful.
• DeleteCar(Cars car)
o Deletes a car from the database based on the provided car ID.
• GetAllCars()
o Retrieves a list of all cars from the database and returns it as a DataTable.
• SearchCars(string model)
o Searches for cars in the database based on the provided model name and returns
the matching records as a DataTable.
• SearchCars(string make)
o Searches for cars in the database based on the provided make name and returns
the matching records as a DataTable.
1. AddCarParts.cs
2. CarPartsListCustomer.cs
3. CarPartsListing.cs
42
• CarPartsListing_Load(object sender, EventArgs e)
o This method is triggered when the CarPartsListing form is loaded. It loads the
car parts list into a DataGridView for admin viewing and management.
• btnAddCarPartsStock_Click(object sender, EventArgs e)
o Handles the add car parts stock button click event, opening the
FormAddCarParts form to add new parts to the inventory.
• dgvCarPartsList_CellContentClick(object sender, DataGridViewCellEventArgs e)
o Handles the cell content click event in the DataGridView, such as editing car part
details when the edit button is clicked.
4. EditCarPart.cs
5. CarPartService.cs
• AddCarPart(CarParts carPart)
o Adds a new car part to the database by inserting details such as part name,
number, description, price, make, model, and stock.
• GetCarPartById(int partId)
o Retrieves car part details from the database based on the provided part ID.
Returns a CarParts object with the part's details.
• UpdateCarPart(CarParts carPart)
o Updates the details of an existing car part in the database. Returns true if the
update is successful.
• DeleteCarPart(CarParts carPart)
o Deletes a car part from the database based on the provided part ID.
• GetAllCarParts()
o Retrieves a list of all car parts from the database and returns it as a DataTable.
43
4.2.4 Car Parts Related Methods
OrderService.cs
• AddOrder(Order order)
o Adds a new order to the database by inserting details such as order date,
customer ID, total amount, and order status.
• GetOrderById(int orderId)
o Retrieves order details from the database based on the provided order ID.
Returns an Order object with the order's details.
• UpdateOrder(Order order)
o Updates the details of an existing order in the database. Returns true if the update
is successful.
• DeleteOrder(int orderId)
o Deletes an order from the database based on the provided order ID.
• GetAllOrders()
o Retrieves a list of all orders from the database and returns it as a DataTable.
• GetOrdersByCustomerId(int customerId)
o Retrieves all orders associated with a specific customer ID.
• GetOrdersByStatus(string status)
o Retrieves all orders with a specific status, such as "Pending" or "Completed".
myOrders.cs
OrderCarParts.cs
OrderCars.cs
44
• OrderCars_Load(object sender, EventArgs e)
o This method is triggered when the OrderCars form is loaded. It initializes the
form with car details and allows the user to place an order.
• btnOrderCar_Click(object sender, EventArgs e)
o Handles the order car button click event. It collects the order details and calls the
OrderService to place the order in the database.
• btnClose_Click(object sender, EventArgs e)
o Handles the close button click event, closing the form and returning the user to
the previous screen.
ShowOrders.cs
ViewOrderAdmin.cs
ViewOrdersCustomer.cs
45
o Handles the view order details button click event. It opens a detailed view of the
selected order.
• btnCancelOrder_Click(object sender, EventArgs e)
o Handles the cancel order button click event, allowing the customer to cancel an
order and update its status in the database.
The GlobalUser class is a static utility class designed to hold global user information, such as
the user ID and username, which can be accessed throughout the application.
This is visible in your classes where properties and methods related to cars are
encapsulated within the Model and Service classes.
{
public int CarId { get; set; }
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public decimal Price { get; set; }
public string CarDescription { get; set; }
public int CarStock { get; set; }
public byte[] Image { get; set; }
}
The properties like CarId, Make, Model, etc., are encapsulated within the Cars
class, and they can only be accessed or modified through the public accessors
(get and set).
The same applies in the CarService class, where database interaction methods are
encapsulated within the class and can only be used via public methods like
GetAllCars, AddCar, etc.
46
4.4.2. Abstraction
By separating user data and customer information into distinct classes or tables, abstraction is
employed to simplify the design. User data is concerned with authentication and authorization
(username, password, roles), while customer information contains personal details (name,
email, etc.). This abstraction ensures that each class or table only focuses on its specific
responsibilities.
• Exception handling is not strictly an OOP concept, but it's closely related to
encapsulation and abstraction. By using try-catch blocks within your CarService
methods, you're encapsulating the error-handling logic inside the service layer,
preventing the UI or other parts of the application from dealing with database-related
exceptions.
• Example:
• I have separated the data (Models), business logic (Services), and user interface
(Interfaces) into different layers. This separation allows each layer to focus on its
specific role.
• In the MVC pattern, your Cars class represents the Model, the Service class represents
the Controller (business logic), and the Interfaces class represents the View (UI). This
is a good example of how OOP helps structure a clean, maintainable application.
47
4.5. User Interface and Usability
In the manual, I have added clear pictures of all the important screens in the ABC Car Traders
app. Here in this document, I will only point to the main ones with an emphasis on how easy
they are to use and how they look.
The user interface was developed for the end user, so it's easy either for customers or
administrators to use the application. Some of these key principles in guiding this design
include:
o It's neat and clean, without over-decoration of UI elements. This means the user
will find what they need in less than a few clicks and won't be puzzled by
excessive amounts of on-screen information.
2. Consistency:
o These design elements included consistent application of button styles, fonts, and
colors throughout. It has been proven that having consistency allows users to get
accustomed to the interface more quickly; this reduces learning curves, hence
improving user experience.
Button Colors -
3. Navigation:
48
4. Responsive Feedback:
o The UI gives back responsive feedback to the users through visual cues and
messages. If some action like placing an order or deleting an item has been
performed, the system confirms that as soon as possible to avoid uncertainty and
increase user satisfaction.
5. Auto-Populating Data:
o Order screens, will, for example, be pre-populated with essential customer data
such as name, contact details, and address from the user profile. This feature
further reduces the quantity of data that must be keyed in manually by the user,
6. Visual Appeal:
o High-quality images, aligned text, and good color schemes provide attractiveness
to the look of the interface and make it professional, not boring.
7. Accessibility:
o These designs are targeted for accessibility to a wide array of users, This
application would not be complex to navigate; it allows for various routes, clarity
in labeling, and icons most people understand.
Generally, the integration of these design principles makes the application ABC Car Traders
useful and easy to use. An attractive UI, with features like auto-populating of data and with a
high level of usability, facilitates the end-user in using the application easily and hassle-free,
thereby increasing user satisfaction as well as operational efficiency.
49
Linear Search Explanation:
o When a user inputs a search term, the algorithm performs an SQL query that
effectively checks each row in the Cars table to see if the make or model
contains the search term.
o The SQL LIKE operator is used in conjunction with wildcards (%) to match any
part of the text, but the underlying concept remains linear—each row is
examined until all matches are found.
The search algorithm used in this code is based on a simple SQL query execution to retrieve
car data from the database based on the user’s input for either the make or model of the car.
This algorithm operates in two main steps:
SELECT carId AS 'Car ID', carImage AS 'Image', make AS 'Make', price AS 'Car Price',
model AS 'Car Model', year AS 'Year', carDescription AS 'About the Car', stockQuantity
AS 'Stock'
FROM Cars
WHERE make LIKE @Make
The @Make parameter is substituted with the search term entered by the user,
surrounded by % to allow for partial matching.
50
05. CHAPTER 05 – USER GUIDE & INTERFACE
OVERVIEW
5.1. Introduction
This user guide is designed to guide you through the various features and functionalities of the
system along with the user interfaces. Whether you're an Admin or a Customer, this manual will
help you navigate the system with ease.
Admin
The Administrator role has comprehensive access to the system, including the ability to manage
customers, cars, car parts, and orders. The Administrator can also generate reports and log out
from the system.
Customer
The Customer role allows users to browse and search for cars and car parts, place orders, and
manage their personal profiles. Customers can also register and edit their profiles at any time.
51
5.4. Getting Started
5.4.1. Overview
In this section, we will guide you through the steps of logging in, registering a new customer
account, and navigating the key features of the application.
52
5.4.3. Creating a Customer Account
If you are a new customer and do not have an account, follow these steps:
53
5.4.4 Navigating the Application
Admins can access the Admin Dashboard, where they can manage cars, car parts, orders, and
customer information.
54
• Customers will be directed to the Customer Home, where they can browse cars, car
parts view, order cars and car parts, and view their orders, Also they can edit their
profiles
Navigation Tips:
• Admins can perform administrative tasks, while customers can explore and purchase
available items.
• When a menu option is selected, the menu option will be highlighted in White as the
below picture (Home menu option is highlighted in white since user is now in Home)
55
5.5. ADMIN USER GUIDE
5.5.1 Overview
This section will guide you through all the Admin Tasks
As an admin of the ABC Car Traders application, you have full control over the car inventory.
This guide will walk you through the essential features for adding, editing, and listing cars
within the system.
56
Listing and Managing Cars
The "Car Listing" interface allows you to Add,view, search, and manage all cars currently in the
inventory.
Steps:
57
Adding a New Car
The "Add Car" screen allows you to enter details about a new car that you want to add to the
inventory.
Steps:
58
o Description: Provide a brief description of the car, including key features or
selling points.
o Upload Image: Click on the "Upload Image" button to add a photo of the car.
3. Save the Car:
o Once all fields are filled, review the details to ensure accuracy.
o Click on the "Save" button to add the car to the inventory.
o A confirmation message will appear, indicating that the car has been successfully
added.
If you need to make changes to an existing car in the inventory, you can use the "Edit Car"
interface.
Steps:
59
o Modify any of the fields such as Car Make, Model, Year, Price, Description,
or Image as necessary.
o Use the "Upload Image" button to replace the current car image if needed.
3. Save Changes:
o After updating the required information, click on the "Update" button.
o The system will confirm that the car details have been successfully updated.
Deleting a Car
To remove a car from the inventory, click the "Delete" button. Confirm the deletion
when prompted.
60
View Car Details
To view a car from the inventory, click the "view" button. You will be able to see more
details about the car
• Regular Updates: Frequently update car details to ensure that all information is
accurate and up-to-date, especially the stock when the stock is physically updated.
61
5.5.3 Managing Car Parts
Overview
As an admin of the ABC Car Traders application, you are responsible for managing the car
parts inventory. This guide will provide step-by-step instructions for adding, editing, and listing
car parts within the system.
The "Car Parts Listing" interface allows you to view, search, and manage all car parts currently
in the inventory.
Steps:
62
Adding a New Car Part
The "Add Car Part" interface allows you to enter details about a new car part that you want to
add to the inventory.
63
Steps:
If you need to make changes to an existing car part in the inventory, you can use the "Edit Car
Part" interface.
64
Steps:
• Regular Updates: Keep the car parts inventory updated regularly to ensure that all
information is accurate and current.
• Clear Descriptions: Provide detailed descriptions for each car part to assist customers
in making informed decisions.
As an admin of the ABC Car Traders application, you have the ability to manage customer
information through the customer management interface. This guide will provide instructions on
how to view, edit, and delete customer records within the system. Note that while you cannot
directly add a customer from this interface, you can create a customer on their behalf using the
signup page available on the login screen.
65
Viewing and Managing Customer Records
The "Customer Listing" interface allows you to view all registered customers, edit their
information, and delete customer records if necessary.
Steps:
66
Editing Customer Information
The "Edit Customer" interface allows you to modify the customer's personal information, but
not their user account details. This section will become available once the "Edit" button is
implemented.
Steps:
67
oModify fields such as Name, Address, Phone Number, and other relevant
details.
o Note: You cannot edit the user's account details (e.g., username, password).
3. Save Changes:
o After updating the required information, click on the "Save Changes" button.
o The system will confirm that the customer details have been successfully
updated.
Deleting a customer
If a customer needs to be removed from the system, you can delete their record using the
"Customer Listing" interface. Note that deleting a customer will also remove their
corresponding user account.
Steps:
As an admin of the ABC Car Traders application, you are responsible for managing customer
orders. This guide will walk you through the process of viewing, processing, and rejecting
orders. Additionally, it outlines how to update inventory levels for cars and car parts when an
order is processed or completed.
68
Viewing and Managing Orders
The "Show Orders" interface allows you to view all customer orders, including their current
status (pending, processed, rejected, completed or All).Default will be Pending Orders.
Steps:
69
Processing or Rejecting Pending Orders
The "View Order Admin" interface allows you to process or reject pending orders. Processing
an order confirms it, while rejecting an order cancels it.
Steps:
70
▪Notify the customer through their account that the order has been
rejected.
4. Complete the Order:
o Once the order has been fully processed and delivered, mark it as completed by
clicking on the "Complete Order" button.
o This will finalize the order, updating the customer’s account to show that the
order is complete.
When processing or completing an order, it’s important to ensure that the inventory levels for
the cars or car parts ordered are updated.
Steps:
71
Customer Order Status
After an order has been processed or rejected, the customer will be able to see the updated status
in their account.
• Processed Orders: The customer can track the progress of their order and see when it
has been processed.
• Rejected Orders: The customer will be notified that their order has been rejected and
can view the reason if provided.
• Completed Orders: Once the order is marked as completed, the customer will see that
their order has been successfully delivered and finalized.
• Timely Processing: Ensure that orders are processed or rejected in a timely manner to
maintain customer satisfaction.
• Inventory Accuracy: Regularly check and update inventory levels to avoid overselling
items.
• Clear Communication: Provide clear reasons for order rejections to maintain
transparency with customers.
As an admin of the ABC Car Traders application, you have access to essential reports that help
manage the business effectively. This guide will walk you through generating and downloading
Car Stock Reports, Customer Reports, and Order Reports. Additionally, it explains how the
system automatically generates and downloads an Order Confirmation Report when an order is
confirmed.
72
Car Stock Report
The Car Stock Report provides an overview of the current inventory levels for all cars in the
system. This report helps in tracking stock levels and making informed decisions on restocking
or sales promotions.
Steps:
Customer Report
The Customer Report provides detailed information about all registered customers, including
their contact details and purchase history. This report is essential for understanding customer
demographics and behavior.
73
Steps:
Order Report
The Order Report provides a comprehensive overview of all orders, including their status, items
ordered, and total amounts. This report is crucial for tracking order processing and fulfillment.
74
Steps:
The Car Listing Screen provides a comprehensive overview of all available cars, including their
details such as make, model, price, and availability. This screen is crucial for browsing and
selecting cars for potential purchase or further inquiry.
75
Steps:
The Order Cars Screen allows customers to finalize their car purchase. The screen is designed
for ease of use, with certain information automatically populated from the customer's profile,
providing a streamlined user experience.
Steps:
76
o The Car Details screen will open, displaying comprehensive information about
the selected car.
2. Review Car Information:
o The screen will show detailed specifications such as engine type, mileage, year
of manufacture, color, and price.
o Additional images of the car will be displayed, allowing you to view the car from
multiple angles.
o
3. Place an Order:
o Click the "Order" button to initiate the car purchase process.
o This action will open the Order Cars screen.
77
4. Review Pre-Populated Information:
• Upon entering the Order Cars screen, details such as your name, contact information,
and selected car details are automatically populated.
• Ensure that all information is correct. If needed, you can update your contact details.
• Review the order summary, including the car's information price and the total amount.
• After reviewing the information, click the "Confirm Order" button to complete your
purchase.
• Once confirmed, the system will automatically generate an order report.
78
• The order report, containing details such as Order ID, Customer Name, Car Details,
Order Date, and Total Amount, will be generated and displayed on the screen.
The Car Parts Listing Screen provides a comprehensive overview of all available car parts,
including their details such as part type, compatibility, price, and availability. This screen is
crucial for browsing and selecting car parts for potential purchase or further inquiry.
79
Steps:
The Order Cars Screen allows customers to finalize their car purchase. The screen is designed
for ease of use, with certain information automatically populated from the customer's profile,
providing a streamlined user experience.
Steps:
80
o From the Car Parts Listing screen, click on the “Order “of the selected car you
are interested in to order
o The “Order Car Parts” screen will open, displaying comprehensive information
about the selected car Part.
• Place an Order:
• Click the "Order" button to initiate the car part purchase process.
• This action will open the Order Car Parts screen.
o Upon entering the Order Car Parts screen, details such as your name, contact
information, and selected car details are automatically populated.
o Ensure that all information is correct. you can update your contact details,
shipping address and the quantity
o Review the order summary, including the car's information price and the total
amount.
81
• Once confirmed, the system will automatically generate an order report.
The order report, containing details such as Order ID, Customer Name, Car Part Details,
Order Date, and Total Amount, will be generated and displayed on the screen.
The My Orders Screen allows customers to view the history and status of their orders. This
screen is essential for tracking the progress of your purchases and managing any pending
orders.
Steps:
82
o Navigate to the "My Orders" section from the Customer Dashboard.
o The My Orders screen will display a list of all your orders, including details such
as Order ID, Order Date, Status, and Total Amount.
This allows users to update their personal information and reset their password. This form is
divided into two main sections:
Customer Information
In this section, users can view and edit their personal details. The following fields are available:
• First Name: This field allows the user to update their first name.
• E-mail: The user's email address can be modified here.
• Last Name: This field is for the user's last name.
• Phone: The user can update their contact number.
After making changes, the user can click the Save button to apply the updates.
This section allows the user to change their password securely. The following fields are
available:
• Current Password: The user must enter their current password for verification.
• New Password: The user can specify a new password.
• Confirm Password: The user must re-enter the new password to confirm it.
Once all fields are filled in correctly, the user can click the Change Password button to update
their password.
83
6. CHAPTER 06 – REFLECTION OF EXPERIENCE
Working on this project, I had mixed feelings regarding my experience with C# and Visual
Studio. The rich object-oriented programming features in C# let me implement complex
logics efficiently. On the other hand, Visual Studio enhanced my productivity due to its
comprehensive debugging tools and IntelliSense features.
I had a small learning curve with how to set up and organize a Windows Forms application
properly. The more comfortable I got with the nuances of the language and IDE, the faster it
was. Showing the inclusion of different services and models into the setup of MVC really
showed how flexible and powerful C# was. The integrated environment smoothed out most of
Visual Studio's processes, so I would be able to pay more attention to logic rather than setup.
Incorrect Order in SQL Insert Statements: One of the issues I faced was incorrectly ordering
the columns in an SQL insert statement, which caused errors during data insertion. To resolve
this, I carefully reviewed the column order in the SQL statement and ensured it matched the
database schema. This experience taught me the importance of attention to detail when handling
database operations.
Error
84
Incorrect order initializing the instances and variables
In my project, I initially defined several key variables and services, including _userId,
selectedCarPart, carPartService, orderService, and customerService. However, I encountered an
issue where data wasn’t loading correctly. This was due to the _userId variable being initialized
after the customerService object, which caused a dependency issue. Since the customerService
relied on the userId being set first, the incorrect order of initialization prevented the data from
loading as expected. By reordering the initialization to set the userId first, I was able to resolve
the issue and ensure that the data loaded correctly.
Utilize Visual Studio’s debugging tools extensively, including breakpoints, the immediate
window, and watch windows. Additionally, handling exceptions gracefully in your event
handlers and understanding the stack trace helps in pinpointing issues.
As more features are added to the application, the codebase can quickly become disorganized,
making it difficult to maintain and extend. Without proper structure, the project can become
cluttered with tightly coupled classes and hard-to-follow logic.
85
Adopting design pattern like MVC (Model-View-Controller) from the beginning helps in
maintaining a clean architecture. Regular refactoring and organizing code into logical layers (UI,
business logic, data access) also contribute to a more maintainable codebase.
• MVC Architecture in C#: The MVC architecture in C# is one that allows separation
of concerns whereby the codebase becomes more maintainable and organized. I found
this structure particularly helpful when managing complex UI logic and/or data
interactions.
86
7. CHAPTER 07– CONCLUSION
87
8. CHAPTER 08– REFERENCES
iTextSharp
iTextSharp Documentation: https://itextpdf.com/en/resources/documentation
ADO.NET
ADO.NET Documentation: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/
UML DIAGRAMS
Visual Paradigm UML UML Class Diagram Tutorial (visual-paradigm.com)
88