VSCode Icon

File

Edit

View

Go

Run

Terminal

Help

Pratik Poudel - Visual Studio Code

All projects

PROJECT CASE STUDY · DESKTOP DEVELOPMENT

CarRentalApp

A C# Windows Forms application for a car-rental workflow, with customer and booking forms, rental-record browsing, search, and local SQL Server data storage.

At a glance

Type
Windows desktop application
Framework
C# · Windows Forms
Data access
Microsoft.Data.SqlClient
Database
SQL Server LocalDB
Core workflow
Login, booking, and rental records

The problem

A small rental operation needs a way to capture booking details and retrieve existing records. This project explores a desktop workflow that collects customer, vehicle, rental-duration, and optional-cover information, then stores it for later review.

Implemented workflow

Welcome and login screens

Windows Forms screens provide the application's entry and sign-in flow.

Booking form

Collects customer details, licence confirmation, rental duration, car type, fuel type, and optional cover selections.

Booking persistence

Uses a repository class to insert booking records into the local SQL Server database.

Rental records and search

Loads saved bookings into a DataGridView and supports searching by booking ID and customer name.

Data flow

The booking form validates required fields and calculates a displayed estimate. The BookingRepos class uses Microsoft.Data.SqlClient to insert records and retrieve or search rows from dbo.bookinginfo. The checked-in App.config points to SQL Server LocalDB, not MySQL.

Windows Forms · C#→BookingRepos→SQL Server LocalDB
C#.NET Windows FormsSQL Server LocalDBADO.NETParameterized SQL

Current limitation and next step

The current login implementation contains hard-coded demo credentials. That is suitable only for a learning prototype, not a real rental business. A production-ready version should replace it with securely stored, hashed credentials and role-based access.

Booking workflow details

The user moves from the welcome/login screen to the booking form, enters customer and licence details, selects a vehicle and rental duration, and chooses optional cover. The application presents an estimate and saves the booking through the repository layer. The records view then loads stored rows into a grid and supports lookup by booking ID or customer name.

Data and validation approach

Database operations are grouped in BookingRepos instead of being scattered across form event handlers. Booking inserts and the repository's SearchBooking method use parameterized SQL. The current records window, however, filters the rows it has already loaded into a DataTable; it does not call SearchBooking for each search. The form also checks required inputs before attempting to save.

Known gaps

This is a desktop learning project using LocalDB on the machine where it is configured. It does not yet establish production-grade authentication, shared multi-user hosting, or a complete vehicle-availability and payment workflow. The demo credentials should not be reused in a deployed business system.

What this project demonstrates

  • Building a multi-window Windows Forms application in C#.
  • Validating user input and calculating booking estimates.
  • Separating database operations into a repository class.
  • Using parameterized SQL commands for booking inserts and searches.
  • Displaying and filtering stored records in a DataGridView.