0% found this document useful (0 votes)
94 views76 pages

TaxiBookingSystem PDF

The document outlines an individual project for a taxi booking system as part of the courses CIS020-1 and CIS093-1. It includes a comprehensive project plan, requirements analysis, design specifications, and implementation details for the system, which allows customers to book trips and drivers to manage bookings. The project emphasizes the use of UML diagrams, database design, and user interface considerations to create a functional online platform for taxi services.

Uploaded by

M K Khaing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views76 pages

TaxiBookingSystem PDF

The document outlines an individual project for a taxi booking system as part of the courses CIS020-1 and CIS093-1. It includes a comprehensive project plan, requirements analysis, design specifications, and implementation details for the system, which allows customers to book trips and drivers to manage bookings. The project emphasizes the use of UML diagrams, database design, and user interface considerations to create a functional online platform for taxi services.

Uploaded by

M K Khaing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

CIS020-1 – Introduction to Software Development

CIS093-1 – Mathematics and Concepts for Computational Thinking


Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Page 1 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

CIS020-1 – Introduction to Software Development


CIS093-1 – Mathematics and Concepts for
Computational Thinking
Assignment 2 – Individual Project – Case
Study
(Taxi Booking System)

Student Name: SUDAN TANDUKAR - University ID:


2147435

Page 2 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Table of Contents

Table of Contents
Table of Contents ....................................................................................................................... 3
Introduction/Overview ............................................................................................................... 5
Task Description ........................................................................................................................ 5
Project Plan/Schedule ................................................................................................................ 5
Requirements Analysis .............................................................................................................. 6
Overview of Functional, Technical (Non-Functional Requirements) and Usability
Requirements ......................................................................................................................... 6
Functional Requirements ................................................................................................... 6
Non-functional Requirements ............................................................................................ 6
Usability Requirements ...................................................................................................... 7
Design ........................................................................................................................................ 7
UML Diagrams ...................................................................................................................... 7
Uses Case Diagrams(s) ...................................................................................................... 7
Use Case Specifications / Description ............................................................................. 11
Activity Diagram(s) ......................................................................................................... 13
Class Diagram(s) .............................................................................................................. 15
Database Design................................................................................................................... 16
Logical Database Design ................................................................................................. 16
Physical Database Design ................................................................................................ 16
User Interface Design .......................................................................................................... 22
Implementation ........................................................................................................................ 29
Testing...................................................................................................................................... 30
Discussion / Reflection / Critical Analysis .............................................................................. 40
Conclusion ............................................................................................................................... 40
References ................................................................................................................................ 40
Appendix .................................................................................................................................. 40
Main Application: ................................................................................................................ 40
Front End Layer: .................................................................................................................. 41
Login Page: ...................................................................................................................... 41
Registration Page: ............................................................................................................ 44
Customer Dashboard:....................................................................................................... 47
Driver Registration: ......................................................................................................... 54

Page 3 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Driver Home Page: .......................................................................................................... 57


Amin Home Page: ............................................................................................................ 59
Models: ................................................................................................................................ 63
Customer: ......................................................................................................................... 63
Booking:........................................................................................................................... 64
Driver: .............................................................................................................................. 66
Business Layer: .................................................................................................................... 67
BlCustomer: ..................................................................................................................... 67
Blbooking:........................................................................................................................ 69
BlDriver: .......................................................................................................................... 72
Bladmin:........................................................................................................................... 75

Page 4 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

CIS020-1 – Introduction to Software Development - 2021-2022


CIS093-1 – Mathematics and Concepts for Computational Thinking – 2021-2022
Assignment 2 – Group or Individual Project – Case Study (Taxi Booking System)

Introduction/Overview
As our classes for Introduction to Software Development was coming to an end, we were
given an assignment to do where we were supposed to implement the things we learned in
our course. In this assignment we were ask to create an online taxi booking system using the
skills and knowledge that we have gained during our classes in python. Through the process
of trial and error the assignment was complected at last and a simple taxi booking system was
created as asked.

Task Description
In this assignment we were given a task to make a online Taxi booking system where
customer can book a trip and taxi drivers can check their upcoming trips. The data of this
system was needed to be stored in an external file hence a database was asked to be created
which can store customer data (name, address, email, telephone number, payment method),
trip information (pick up and drop off address, pickup time and date) and driver information.
Where each trip can be assigned to exactly one driver. The customer who has not registered
yet needed to register by providing their details and after registration they will be able to
book a trip by providing information such as pickup address, drop off address, date and time
while they must also be able view, update and cancel their bookings. The administrator must
be able to assigned the trips to the driver and driver must be able to view those assigned trips.

Project Plan/Schedule
Week No. Tasks Priority
1 Proper analyzation of the things Task should be properly
that are required and needed to be analysis and discuss with
done to complete the given project teacher so you know exactly
what you are supposed to
do.
2 Requirement analysis and GUI Prototype and requirement
3 Database, ER diagram, data
dictionary, skeleton tables, class
diagram and activity diagram
4 All the task related to GUI

Page 5 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

5 All the Back-end task


Submit Group Report, Project
Code, and Individual Reflective
Report, Video Recording
Project Presentation

Requirements Analysis

Overview of Functional, Technical (Non-Functional Requirements) and


Usability Requirements

Functional Requirements

TBS = Taxi Booking System

Req. No Requirement Priority*


1 A customer must be able to register on the TBS MUST
2 A customer must be able to log in to the TBS MUST
3 A customer must be able to log out of the TBS MUST
4 A customer must be able to make a booking MUST
5 A customer must be able to cancel a booking MUST
6 A customer must be able to view his/her bookings MUST
7 A taxi driver must be able to log in to the TBS MUST
8 A taxi driver must be able to view his bookings MUST
9 An administrator must be able log in to the TBS SHOULD

10 An administrator must be able to view all SHOULD


bookings
11 An administrator must be able to allocate a driver SHOULD
to a booking
12 An administrator must be able to confirm a SHOULD
booking
13 An administrator must be able to log out of the SHOULD
TBS

Non-functional Requirements

Req. No Requirement Priority*


1 It should work smoothly.
2 It should be easy to use
3 The design should be sufficiently scalable and
flexible to allow for further future enhancements

Page 6 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Usability Requirements

Req. No Requirement Priority*


1 It must be reliable.

*MOSCOW Notation:
M = MUST
S = SHOULD
C = COULD
W = WON’T

Design

UML Diagrams
Uses Case Diagrams(s)

Fig 1: Taxi Booking System - Use Case Diagram (Sea Level)

Page 7 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 2: Taxi Booking System - Use Case Diagram-Registration (Fish Level)

Fig 3: Taxi Booking System - Use Case Diagram-Login (Fish Level)

Page 8 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 4: Taxi Booking System - Use Case Diagram-Make Booking (Fish Level)

Fig 5: Taxi Booking System - Use Case Diagram-View Booking (Fish Level)

Page 9 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 6: Taxi Booking System - Use Case Diagram-Cancel Booking (Fish Level)

Fig 7: Taxi Booking System - Use Case Diagram-Admin Conform Booking (Fish
Level)

Page 10 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 8: Taxi Booking System - Use Case Diagram-Assign Driver (Fish Level)

Fig 9: Taxi Booking System - Use Case Diagram-Driver View Booking


(Fish Level)

Use Case Specifications / Description

Registration:
The customers who haven’t registered yet can register by providing their details in order to
further use the system.

Page 11 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Make Booking:
The customer who has already register can book a trip by logging in into the dashboard.

View Booking:
The customer who has already register and have already booked a trip before can view their
booking and can update them as required. They will be able to update them until those
booking has been conformed and assigned to driver by admin.

Cancel Booking:
The customer who has already register and have already booked a trip before can view their
booking and can cancel them if required. They will be able to cancel them until those
booking has been conformed and assigned to driver by admin.

Conform Booking:
The admin will be able to conformed the Booking before an hour of the trip time.

Assign Driver to Booking:


The admin will be able to assign the Booking before an hour of the trip time.

Driver View Booking:


The driver will be able to view the booking that are assigned to him/her.

Page 12 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Activity Diagram(s)

Page 13 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 10 : Taxi Booking System-Activity Diagram

Page 14 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Here customer will make registration first if they have not yet then they will move towards
login. After matching all the details of login customer can request booking, update booking,
cancel booking, and view booking. Then administrator will assign driver to the trip by
checking availability of driver. Then Driver will view the trips assigns to them and goes to
pick up the customer at the given date and time.

Class Diagram(s)

(Techopedia,2022)” A class diagram is a type of diagram and part of a unified modeling


language (UML) that defines and provides the overview and structure of a system in
terms of classes, attributes and methods, and the relationships between different classes.
It is used to illustrate and create a functional diagram of the system classes and serves as a
system development resource within the software development life cycle.”

Fig 11: Taxi Booking System-Class Diagram

o Classes (omitting methods / operations)

o Customer (CustomerID, FullName, Username, Address, Phone Num, Email,


PaymentMethod, Password)
o Booking (BookingID, PikupAddress, DropoffAddress, Date, Time)
o Driver (DriverID ,FullName, Address, Phone Num, Email,
CarLicensePlateNum, Username, Password)

Page 15 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

o Admin(AdminId ,Username, Password)

Database Design

Logical Database Design


Entity Relationship Model (ERM)
ERM Diagram

Fig 12: Taxi Booking System-ERM Diagram


List of Entities

Customer (CustomerID, FullName, Username, Address, Phone Num, Email,


PaymentMethod, Password)
Booking (BookingID, CustomerID *, DriverID *, PikupAddress, DropoffAddress,
Date, Time)
Driver (DriverID, FullName, Address, Phone Num, Email, CarLicensePlateNum,
Username, Password)
Admin (AdminId, Username, Password)

Primary Key = Bold and Underlined


Foreign Key = *

Physical Database Design

Skeleton Tables (with Primary Keys and Foreign Keys)

Customer (CustomerID, FullName, Username, Address, Phone Num, Email,


PaymentMethod, Password)
Booking (BookingID, CustomerID *, DriverID *, PikupAddress, DropoffAddress,
Date, Time)

Page 16 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Driver (DriverID, FullName, Address, Phone Num, Email, CarLicensePlateNum,


Username, Password)
Admin (AdminId, Username, Password)

Primary Key = Bold and Underlined


Foreign Key = *

Data Dictionary

Page 17 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Customer
Description: Customer details
Field Name Datatype Length Index Null Default Validation rule Description
CustomerID int (10) 10 PK No Autoincremented
(Primary) unsigned Uniquely identifies every
customer
FullName varchar (60) 60 No FullName of customer
Username varchar (60) 60 No Username of customer
Address varchar (60) 60 No Address of customer
Phone Num varchar (60) 60 No Telephone number of customer
Email varchar (60) 60 No Email of customer
PaymentMethod varchar (60) 60 No Paymentmethod of customer
Password varchar (60) 60 No Password of customer

Indexes
Keyname Type Unique Column Null
PRIMARY BTREE Yes CustomerID No

Booking
Description: Customer booking details
Field Name Datatype Length Index Null Default Validation rule Description

Page 18 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

BookingID int (10) 10 PK No Autoincremented


(Primary) unsigned Uniquely identifies every
booking
PikupAddress varchar (60) 60 No Pickup address of customer
DropoffAddress varchar (60) 60 No Dropoff address of customer
Date varchar (60) 60 No Date of trip
Time varchar (60) 60 No Time of trip
CustomerID varchar (60) 60 FK No Uniquely identifies every
Customer
DriverID varchar (60) 60 FK No Uniquely identifies every Driver

Indexes
Keyname Type Unique Column Null
PRIMARY BTREE Yes BookingID No
FOREIGN BTREE No CustomerID No
FOREIGN BTREE No DriverID No

Driver
Description: Driver details
Field Name Datatype Length Index Null Default Validation rule Description
DriverID (Primary) int (10) 10 PK No Autoincremented
unsigned Uniquely identifies every driver
FullName varchar (60) 60 No FullName of driver

Page 19 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Address varchar (60) 60 No Address of driver


Phone Num varchar (60) 60 No Telephone number of driver
Email varchar (60) 60 No Email of driver
CarLicensePlateNum varchar (60) 60 No CarLicensePlateNum of driver
Username varchar (60) 60 No Username of driver
Password varchar (60) 60 No Password of driver

Indexes
Keyname Type Unique Column Null
PRIMARY BTREE Yes DriverID No

Admin
Description: Admin details
Field Name Datatype Length Index Null Default Validation rule Description
AdminID (Primary) int (10) 10 PK No Autoincremented
unsigned Uniquely identifies every Admin
Username varchar (60) 60 No Username of Admin
Password varchar (60) 60 No Password of Admin

Indexes
Keyname Type Unique Column Null
PRIMARY BTREE Yes AdminID No

Page 20 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Page 21 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

User Interface Design

Fig 13: Login Page

The Above figure 13 is the prototype of login page made in balsamiq.

Page 22 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 14: Registration Page

The Above figure 14 is the prototype of Customer Registration page made in


balsamiq.

Page 23 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 15: Customer Home Page

The Above figure 15 is the prototype of Customer Home page made in balsamiq.

Page 24 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 16: Customer Booking Page

The Above figure 16 is the prototype of Customer Booking page made in balsamiq.

Page 25 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 17: Customer View Booking Page

The Above figure 17 is the prototype of customer view booking page made in
balsamiq.

Page 26 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 18: Driver Registration Page

The Above figure 18 is the prototype of Driver Registration page made in balsamiq.

Page 27 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 19: Driver View Booking Page

The Above figure 19 is the prototype of Driver view booking page made in
balsamiq.

Page 28 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 20: Admin View Booking Page

The Above figure 20 is the prototype of admin view booking page made in balsamiq.

Implementation

The assignment given to us was individual project where we were assigned to build desktop
application called an online taxi booking system. Here customer should be able to make
booking whereas administrator should be able to assigned the trips made by customer to
driver and driver should be able to view the trips that were assigned to him/her. While doing
this task there wasn’t a lot of problems since this was the second time doing such type of
assignment, so there weren’t as many problems as in the first time but still there were some
problem and error while doing the assignment but they were eventually solved before
deadline.

For this project PyCharm IDE was use for coding since it is beginner-friendly. For database
MySQL RDBMS was used since it is open-source and free to use. Here MySQL connector
was use for JDBC connections. The reason that
SQL was used was because it was an efficient and easy to use (fast query
processing, no need of prior coding knowledge, portability etc.) language to
communicate with the database. It was very convenient to use and XAMPP was us as the
Platform for MySqL.

Page 29 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

During coding few of problem where encounter then at the first major task but those were
also solved by the guidance of teachers and through online research. And some helps were
also taken from seniors. Due to which the assignment was completed on given time.

After completing the project successfully and looking back on it, there certainly
were easier and more efficient ways to complete it sooner but since this was the
second major task, and we were still inexperienced so we were bound to make some errors.
However, for future tasks, we will have much more experience in order to surpass ourselves.
Likewise, we did not know the vast knowledge of python, due to which there were some
difficult whiling doing assignments.

Testing

Fig 20: Customer Registration Page

Page 30 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Registration Registration
whether the data in given successful successful
customer field
registration
is successful
or not

Fig 21: Login Page

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Login Login successful
whether the data in given successful
customer field
login is

Page 31 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

successful or
not

Fig 22: Customer Home Page

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check None Successfully Successfully GUI
whether the GUI displayed
GUI is being displayed
Displayed or
not

Page 32 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 23: Customer Booking Page

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Booking Booking
whether the data in given successful successful
booking is field
successful or
not

Page 33 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 24: Customer View Booking Page-Update Quarry

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Update Update
whether the data in given successful successful
update is field
successful or
not

Page 34 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 25: Customer View Booking Page-Delete Quarry

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter cancelled cancelled
whether the booking ID successfully successfully
cancel is of the one
successful or you want to
not cancelled in
given field

Page 35 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 26: Admin Login

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Admin login Admin login
whether the data in given successful successful
admin login field
is successful
or not

Page 36 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 27: Admin Home Page

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Assigned Assigned successful
whether the data in given successful
assigned is field
successful or
not

Page 37 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 28: Driver Login

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Driver login Driver login
whether the data in given successful successful
driver login field
is successful
or not

Page 38 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Fig 29: Driver Home Page

Test No Date of test Reason for Input data or Excepted Actual Result
test action data
1 2023/01/13 To Check Should enter Driver login Driver login
whether the data in given successful, successful,
complete field, None Assigned Assigned trips are
quarry is trips are successfully
successful or successfully displayed
not, displayed
To Check
whether the
assigned
trips are
being
displayed or
not

Page 39 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Discussion / Reflection / Critical Analysis

A desktop application was created successfully where the customer have to register first if
they have not yet. Then they can login by providing the details they are asked. After logging
in they will be taken to home page where they can make booking, view booking, can make
changes to the booking and also can cancel their booking if they want. Then the administrator
is the one who assigns the driver for the trips of the customer by checking the availability of
the driver and provides the task to the driver.

The time given to accomplish this work was sufficient to be completed prior to the
submission date. It was little hard since this was the second assignment that we were given.
There were some problems which were solved after consoling the teachers, thinking for a
little long time and through online research. By tackling this assignment the capacity to tackle
problems while coding and the knowledge of coding where enhanced .

Through work on this assignment enhancement of the knowledge in python, Gui design and
implementation coding were achieved by trying and failing continuously. In the near future,
if ever a similar type of project is given
It will be done with more creative way so the project can be made more informative, creative
and effective.

Conclusion
In this assignment we were asked to create an online taxi booking system where customers
can book a trip and drivers can be assigned those trips by the administrator. After a lot of
work and errors the required objectives were achieved.

References
Works Cited
Techopedia, 2022.Class Diagram
Available at
https://www.techopedia.com/definition/16466/class-diagram
[Accessed 8 September 2022].

Appendix

Main Application:

Page 40 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

from FrontendLayer.Loginpage import Login

login=Login()
login.mainloop()

Front End Layer:

Login Page:

from tkinter import *


from PIL import ImageTk
from tkinter import messagebox

from Models.Customer import Customer


from BussinessLayer.BLCustomer import BLCustomer
from Models.Driver import Driver
from BussinessLayer.BLDriver import BLDriver

class Login(Tk):
def __init__(self):
super(Login,self).__init__()
self.title("Login Page ")
self.geometry("600x500+300+100")
self.resizable(False,False)
self.configure(bd=10)
self.bg=ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/login.jpg")
self.bg_image=Label(self,image=self.bg).place(x=0,y=0,relwidth=1,relheight=1)
self.createwidght()

def createwidght(self):

Label1=Label(self, text="Taxi Booking System", font=("arial", 30,


"bold"),fg="#6AA84F",bg="light gray")
Label1.place(x=120, y=20)

Label2=Label(self, text="Login Page", font=("arial", 25,


"bold"),fg="#6AA84F",bg="light gray")
Label2.place(x=230, y=80)

Username =Label(self, text="Username",font="arial 15 bold ",bg="light gray")

Page 41 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Username.place(x=80,y=200)

Password=Label(self, text="Password",font="arial 15 bold ",bg="light gray")


Password.place(x=80,y=270)

self.usernameEntry=Entry(self,font="arial 15 ",bd=2,bg="light gray")


self.usernameEntry.place(x=230,y=200)

self.passwordEntry=Entry(self,show="*",font="arial 15 ",bd=2,bg="light gray")


self.passwordEntry.place(x=230,y=270)

def show_password():
if checkbox_value.get() == 1:
# show password
self.passwordEntry.config(show="")
else:
# hide password
self.passwordEntry.config(show="*")

# create a checkbox
checkbox_value = IntVar()
checkbox = Checkbutton(self, text="Show", background='light gray',
font=('Times New Roman', 8),
variable=checkbox_value, command=show_password)
checkbox.place(x=460, y=272)

Login=Button(self,command=self.login,text= "Login",font="arial 10
bold",bd=3,activebackground="sky blue",bg="light blue")
Login.place(x=500,y=350)

Registration=Button(self,command=lambda :[self.destroy(),self.openwindow()],text=
"Registration",font="arial 10 bold",bd=3,activebackground="sky blue",bg="light blue")
Registration.place(x=380,y=350)

Label3=Label(self, text="click here to register --->", font=("arial", 10,


"bold"),fg="#6AA84F",bg="light gray")
Label3.place(x=215, y=355)

DriverLogin=Button(self,command= self.Dlogin,text= "Driver Login",font="arial 10


bold",bd=3,activebackground="sky blue",bg="light blue")
DriverLogin.place(x=480,y=390)

DriverRegistration=Button(self, command=lambda
:[self.destroy(),self.openwindowD()],text= " Driver Registration",font="arial 10
bold",bd=3,activebackground="sky blue",bg="light blue")
DriverRegistration.place(x=340,y=390)

Page 42 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Label4 = Label(self, text="click here to register as a Driver --->", font=("arial", 10,


"bold"), fg="#6AA84F",
bg="light gray")
Label4.place(x=100, y=395)

def openwindow(self):
from FrontendLayer.RegistrationPage import Registration
register=Registration()
register.mainloop()

def openwindowD(self):
from FrontendLayer.DriverRegistration import Driver_Registration
Dregister = Driver_Registration()

def login(self):
username = self.usernameEntry.get()
password = self.passwordEntry.get()
if username == "" or password == "":
messagebox.showerror("Error", "All fields are required")
elif username=="Admin" and password=="Admin" :
messagebox.showinfo("Information","Welcome Admin ")
self.destroy()
self.openwindowA()
else:
reg = Customer()
reg.setUsername(username)
reg.setPassword(password)
blreg = BLCustomer(reg)
b = blreg.login_function()
if b['status']:
self.destroy()
from FrontendLayer.CustomerDashboard import Dashboard
log = b['content']
customer = Customer()
customer.setCid(log[0][0])
customer.setUsername(log[0][1])
Dashboard(customer)

def Dlogin(self):
username = self.usernameEntry.get()
password = self.passwordEntry.get()
if username == "" or password == "":
messagebox.showerror("Error", "All fields are required")
else:

Page 43 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Dreg =Driver()
Dreg.setUsername(username)
Dreg.setPassword(password)
blDreg = BLDriver(Dreg)
b = blDreg.Dlogin_function()
if b['status']:
self.destroy()
from FrontendLayer.DriverHomePage import Dhomepage
log = b['content']
driver = Driver()
driver.setDid(log[0][0])
driver.setUsername(log[0][1])
Dhomepage(driver)

def openwindowA(self):
from FrontendLayer.Adminhomepage import Admin
a=Admin()

Registration Page:
from tkinter import *
from tkinter import messagebox
from PIL import ImageTk
from Models.Customer import Customer
from BussinessLayer.BLCustomer import BLCustomer

class Registration(Tk):

def __init__(self):
super(Registration,self).__init__()
self.title("Registration page")
self.geometry("700x580+300+100")
self.resizable(False, False)
self.bg = ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/pexels-vlad-alexandru-
popa-1402787.jpg")
self.bg_image = Label(self, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
self.configure(bd=10)

Page 44 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

self.createwidght()

def createwidght(self):
Label1=Label(self, text="Taxi Booking System", font=("arial", 30,
"bold"),fg="#6AA84F",bg="light gray")
Label1.place(x=100, y=20)

Label2=Label(self, text="Registration Page", font=("arial", 25,


"bold"),fg="#6AA84F",bg="light gray")
Label2.place(x=200, y=80)

FullName = Label(self, text="FullName", font="arial 15 bold ", bg="light gray")


FullName.place(x=50, y=180)

self.FullNameEntry = Entry(self, font="arial 15 ", bd=2, bg="light gray")


self.FullNameEntry.place(x=230, y=180)

Username =Label(self, text="Username",font="arial 15 bold ",bg="light gray")


Username.place(x=50,y=220)

self.usernameEntry=Entry(self,font="arial 15 ",bd=2,bg="light gray")


self.usernameEntry.place(x=230,y=220)

Address =Label(self, text="Address",font="arial 15 bold ",bg="light gray")


Address.place(x=50,y=260)

self.AddressEntry=Entry(self,font="arial 15 ",bd=2,bg="light gray")


self. AddressEntry.place(x=230,y=260)

Email=Label(self, text="Email",font="arial 15 bold ",bg="light gray")


Email.place(x=50,y=300)

self.EmailEntry=Entry(self,font="arial 15 ",bd=2,bg="light gray")


self.EmailEntry.place(x=230,y=300)

PhoneNum=Label(self, text="PhoneNum",font="arial 15 bold ",bg="light gray")


PhoneNum.place(x=50,y=340)

self.PhoneNumEntry=Entry(self,font="arial 15 ",bd=2,bg="light gray")


self.PhoneNumEntry.place(x=230,y=340)

PaymentMethod = Label(self, text="PaymentMethod", font="arial 15 bold ", bg="light

Page 45 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

gray")
PaymentMethod.place(x=50, y=380)

self.PaymentMethodEntry = Entry(self, font="arial 15 ", bd=2, bg="light gray")


self.PaymentMethodEntry.place(x=230, y=380)

Password=Label(self, text="Password",font="arial 15 bold ",bg="light gray")


Password.place(x=50,y=420)

self.passwordEntry=Entry(self,show="*",font="arial 15 ",bd=2,bg="light gray")


self.passwordEntry.place(x=230,y=420)

def show_password():
if checkbox_value.get() == 1:
# show password
self.passwordEntry.config(show="")
else:
# hide password
self.passwordEntry.config(show="*")

# create a checkbox
checkbox_value = IntVar()
checkbox = Checkbutton(self, text="Show", background='light gray',
font=('Times New Roman', 8),
variable=checkbox_value, command=show_password)
checkbox.place(x=460, y=420)

Register=Button(self,command=self.register,text= "Register",font="arial 12
bold",bd=2,activebackground="sky blue")
Register.place(x=580,y=480)

Back=Button(self,command=lambda:[self.destroy(),self.openwindow()],text=
"Back",font="arial 12 bold",bd=2,activebackground="sky blue")
Back.place(x=500,y=480)

def register(self):
FullName = self.FullNameEntry.get()
username=self.usernameEntry.get()
address=self.AddressEntry.get()
phoneNum=self.PhoneNumEntry.get()
email=self.EmailEntry.get()
paymentmethod=self.PaymentMethodEntry.get()
password=self.passwordEntry.get()
reg=Customer()
reg.setFullName(FullName)
reg.setUsername(username)
reg.setAddress(address)

Page 46 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

reg.setPhoneNum(phoneNum)
reg.setEmail(email)
reg.setPaymentMethod(paymentmethod)
reg.setPassword(password)
blreg=BLCustomer(reg)
a=blreg.registration_function()
if a:
self.destroy()
self.openwindow()
def openwindow(self):
from FrontendLayer.Loginpage import Login
login=Login()

Customer Dashboard:
from tkinter import *
from tkinter import ttk
import tkinter as tk
from PIL import ImageTk,Image
from tkcalendar import DateEntry
from datetime import datetime,timedelta,date
from Models.Booking import Booking
from Models.Customer import Customer
from BussinessLayer.Blbooking import Blbooking

customerID=0
Username=None
class Dashboard():
def __init__(self,customer):
self.dashboard=tk.Tk()
self.dashboard.title("Dashboard ")
self.dashboard.geometry("700x550+300+100")
self.dashboard.resizable(False, False)
global customerID,Username
customerID=customer.getCid()
Username=customer.getUsername()
global PaddressEntry2, DaddressEntry2, date_entry2, time_entry2,
BookingIDEntry2,listBox

Page 47 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

#def createwidght(self):
tabControl = ttk.Notebook(self.dashboard) # widget that manages a collection of displays

logout=Button(self.dashboard,command=lambda:[self.dashboard.destroy(),self.openwindow(
)],text= "LogOut",font="arial 10 bold",bd=0,activebackground="sky blue",bg="light blue")
logout.place(x=640,y=0)
self.dashboard.tab1=Frame(tabControl)#new frame for tab1
tabControl.add(self.dashboard.tab1, text="Home")
self.dashboard.tab2=Frame(tabControl)#new frame for tab2
tabControl.add(self.dashboard.tab2, text="Book")
self.dashboard.tab3=Frame(tabControl)#new frame for tab3
tabControl.add(self.dashboard.tab3, text="ViewBooking")

tabControl.pack(expand=True,fill="both")#expand = expand to fill any space not


otherwise used
#fill = to fill space in x and y
#def widght_for_tab1(self):
lableframe=Frame(self.dashboard.tab1)
lableframe.pack(fill="both",expand=True)
self.bg = ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/pexels-alexgtacar-
1592384.jpg")

canvas = Canvas(lableframe)
canvas.create_image(0,0,image=self.bg,anchor=NW)
canvas.create_text(350,35, text="Taxi Booking System", font=("Monotype Corsiva", 50,
"bold"), fill="#6AA84F")
canvas.create_text(300,220,text="Book a taxi ,", font=("Monotype Corsiva", 30,
"italic"),fill="#FFA500")
canvas.create_text(380,280, text="Save Your Time ", font=("Monotype Corsiva", 30,
"italic"), fill="#FFA500")
canvas.create_text(250,500,text="Now only for Rs100 per kilometer", font=("Monotype
Corsiva", 20, "underline"), fill="#FFA500")
canvas.place(x=0, y=0, relwidth=1, relheight=1)

#def widght_for_tab2Book(self):
frame2=Frame(self.dashboard.tab2,bd=5,highlightthickness=5)
frame2.pack(fill="both",expand=True)
self.bg2 = ImageTk.PhotoImage(Image.open("C:/Users/Acer/Downloads/road.jpg"))
self.bg_image2 = tk.Label(frame2, image=self.bg2)
self.bg_image2.place(x=0, y=0, relwidth=1, relheight=1)

Label1 = Label(self.dashboard.tab2, text="Taxi Booking System", font=("Monotype


Corsiva", 50, "bold"), fg="#6AA84F", bg="white")
Label1.place(x=100, y=10)

Page 48 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Label2 = Label(self.dashboard.tab2, text="Booking Page", font=("Monotype Corsiva", 40,


"bold"),
fg="#6AA84F", bg="white")
Label2.place(x=30, y=120)

frame5=Frame(frame2,bg="#EEB422")
frame5.place(x=20,y=200,height=250,width=400)

Paddress = Label(frame5, text="Pickup address: ", font=("Monotype Corsiva", 15,


"bold"), bg="white",
fg="black", bd=2)
Paddress.place(x=10, y=10)
self.PaddressEntry = Entry(frame5, font=("Monotype Corsiva", 15, "bold"), bd=2,
bg="white")
self.PaddressEntry.place(x=180, y=10)

Daddress = Label(frame5, text="Drop off address: ", font=("Monotype Corsiva", 15,


"bold"), bg="white",
fg="black", bd=2)
Daddress.place(x=10, y=60)
self.DaddressEntry = Entry(frame5, font=("Monotype Corsiva", 15, "bold"), bd=2,
bg="white")
self.DaddressEntry.place(x=180, y=60)

Date = Label(frame5, text="Pickup Date: ", font=("Monotype Corsiva", 15, "bold"),


bg="white",
fg="black", bd=2)
Date.place(x=10, y=110)
date_today = datetime.now() # today's date
max_date = date.today() + timedelta(days=10)
self.date_entry = DateEntry(frame5, selectmode='day',
mindate=date_today,maxdate=max_date,bd=2)
self.date_entry.place(x=180,y=110,width=205,height=30)

Time = Label(frame5, text="Pickup Time: ", font=("Monotype Corsiva", 15, "bold"),


bg="white",
fg="black", bd=2)
Time.place(x=10, y=160)
self.time_entry=ttk.Combobox(frame5)
self.time_entry.place(x=180,y=160,width=205,height=30)
self.time_entry['values']= ("8:00 Am","9:00 Am","10:00 Am","11:00 Am","12:00
Am","1:00 Pm","2:00 Pm","3:00 Pm","4:00 Pm","5:00 Pm","6:00 Pm",)
self.time_entry['state'] = 'readonly'

Page 49 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Book = Button(frame5, command=lambda:[self.book()],text="Book", font="arial 12


bold", bd=3, activebackground="sky blue", bg="light blue")
Book.place(x=330, y=200)

#def widght_for_tab3viewBook(self):
frame3 = Frame(self.dashboard.tab3,bg="#6AA84F",bd=20,highlightthickness=5)
frame3.pack(fill="both", expand=True)

self.bg3= ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/pexels-pixabay-
219692.jpg")
self.bg_image3 = tk.Label(frame3, image=self.bg3)
self.bg_image3.place(x=0, y=0, relwidth=1, relheight=1)

frame4=Frame(frame3,bg="white")
frame4.place(x=5,y=5,width=620,height=100)

Paddress = Label(frame4, text="Pickup address: ", font=("Times new roman", 12, "bold"),
bg="white",
fg="black", bd=2)
Paddress.place(x=2, y=2)
PaddressEntry2 = Entry(frame4, font=("Times new roman", 12, "bold"), bd=2, bg="light
gray")
PaddressEntry2.place(x=130, y=3)

Daddress = Label(frame4, text="Drop off address: ", font=("Times new roman", 12,
"bold"), bg="white",
fg="black", bd=2)
Daddress.place(x=2, y=35)
DaddressEntry2 = Entry(frame4, font=("Times new roman", 12, "bold"), bd=2, bg="light
gray")
DaddressEntry2.place(x=130, y=36)

Date = Label(frame4, text="Pickup Date: ", font=("Times new roman", 12, "bold"),
bg="white",
fg="black", bd=2)
Date.place(x=2, y=68)
date_today = datetime.now() # today's date
max_date = date.today() + timedelta(days=10)
date_entry2 = DateEntry(frame4, selectmode='day', mindate=date_today,
maxdate=max_date,bg="light gray",bd=2)
date_entry2.place(x=130, y=68, width=160, height=25)

Time = Label(frame4, text="Pickup Time: ", font=("Times new roman", 12, "bold"),
bg="white",
fg="black", bd=2)
Time.place(x=300, y=2)

Page 50 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

time_entry2 = ttk.Combobox(frame4)
time_entry2.place(x=400, y=2,width=160,height=25)
time_entry2['values'] = (
"8:00 Am", "9:00 Am", "10:00 Am", "11:00 Am", "12:00 Am", "1:00 Pm", "2:00 Pm",
"3:00 Pm", "4:00 Pm", "5:00 Pm",
"6:00 Pm",)
time_entry2['state'] = 'readonly'

BookingID = Label(frame4, text="BookingID : ", font=("Times new roman", 12, "bold"),


bg="white",
fg="black", bd=2)
BookingID.place(x=300, y=34)
BookingIDEntry2 = Entry(frame4, font=("Times new roman", 12, "bold"), bd=2,
bg="light gray")
BookingIDEntry2.place(x=400, y=34)

Update=Button(frame4, text="Update",command=lambda:[self.update()], font="arial 10


bold", bd=3, activebackground="sky blue", bg="light blue")
Update.place(x=320,y=65)
Delete = Button(frame4,command=lambda:[self.delete()], text="Cancel", font="arial 10
bold", bd=3, activebackground="sky blue", bg="light blue")
Delete.place(x=400, y=65)

# add table

listBox = ttk.Treeview(frame3)
listBox['show'] = 'headings'
listBox["columns"] = ("ID", "PickupAddress", "DropOfAddress", 'Date', "Time",
'Booking Status')

# Assign the width, minwidth and anchor to the respective columns

listBox.column("ID", width=20, minwidth=50, anchor=CENTER)

listBox.column("PickupAddress", width=100, minwidth=100, anchor=CENTER)


listBox.column("DropOfAddress", width=150, minwidth=150, anchor=CENTER)
listBox.column("Date", width=90, minwidth=90, anchor=CENTER)
listBox.column("Time", width=90, minwidth=90, anchor=CENTER)
listBox.column("Booking Status", width=90, minwidth=90, anchor=CENTER)

# Assign the heading names to the respective columns

listBox.heading("ID", text="ID", anchor=CENTER)

listBox.heading("PickupAddress", text="PickupAddress", anchor=CENTER)


listBox.heading("DropOfAddress", text="DropOfAddress", anchor=CENTER)

Page 51 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

listBox.heading("Date", text="Date", anchor=CENTER)


listBox.heading("Time", text="Time", anchor=CENTER)
listBox.heading("Booking Status", text="Booking Status", anchor=CENTER)

book = Booking()
book.setcid(int(customerID))
b = Blbooking(book)
a = b.viewbooking()

for i in range(len(a)):
listBox.insert(parent='', index='end', iid=i, values=(a[i][0], a[i][1], a[i][2], a[i][3],
a[i][4], a[i][5]))

listBox.place(x=1,y=120,width=620,height=320)
'''listBox.bind('<Double-Button-1>',self.GetValue())'''

def book(self):
Paddress=self.PaddressEntry.get()
Daddress=self.DaddressEntry.get()
Date=self.date_entry.get_date()
date = Date.strftime("%Y-%m-%d") # format to change

time=self.time_entry.get()
reg=Booking()
reg.setcid(customerID)
reg.setPickOffAddress(Paddress)
reg.setDropOffAddress(Daddress)
reg.setdate(date)
reg.settime(time)
blbook=Blbooking(reg)
b=blbook.book_function()

def openwindow(self):
from FrontendLayer.Loginpage import Login
login = Login()

def update(self):
paddress2=PaddressEntry2.get()
daddress2=DaddressEntry2.get()

Page 52 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

date2=date_entry2.get_date()
date = date2.strftime("%Y-%m-%d") # format to change
ptime2=time_entry2.get()
bid=BookingIDEntry2.get()
reg2=Booking()
reg2.setPickOffAddress(paddress2)
reg2.setDropOffAddress(daddress2)
reg2.setdate(date)
reg2.settime(ptime2)
reg2.setbid(bid)
blbook = Blbooking(reg2)
b = blbook.update()

def delete(self):

bid=BookingIDEntry2.get()
reg3=Booking()
reg3.setbid(bid)
blbook = Blbooking(reg3)
b = blbook.delete()

'''' def GetValue(event):


#clear entry boxes
PaddressEntry2.delete(0, END)
DaddressEntry2.delete(0, END)
date_entry2.delete(0, END)
time_entry2.delete(0, END)
BookingIDEntry2.delete(0, END)

#grab record number


selceted = listBox.focus()
select = listBox.item(selceted,'values')
print(select)
#output to entry boxes
BookingIDEntry2.insert(0, select[0])
PaddressEntry2.insert(0, select[1])
DaddressEntry2.insert(0, select[2])
date_entry2.insert(0, select[3])
time_entry2.insert(0, select[4])'''

Page 53 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Driver Registration:

from tkinter import *


from tkinter import messagebox
from PIL import ImageTk
from Models.Driver import Driver
from BussinessLayer.BLDriver import BLDriver

class Driver_Registration():

def __init__(self):
self.Drigistration=Tk()
self.Drigistration.title("Driver Registration page")
self.Drigistration.geometry("700x580+300+100")
self.Drigistration.resizable(False, False)
self.bg = ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/pexels-vlad-alexandru-
popa-1402787.jpg")
self.bg_image = Label(self.Drigistration, image=self.bg).place(x=0, y=0, relwidth=1,
relheight=1)
self.Drigistration.configure(bd=10)

# widght
Label1=Label(self.Drigistration, text="Taxi Booking System", font=("arial", 30,
"bold"),fg="#6AA84F",bg="light gray")
Label1.place(x=100, y=20)

Label2=Label(self.Drigistration, text="Driver Registration Page", font=("arial", 25,


"bold"),fg="#6AA84F",bg="light gray")
Label2.place(x=200, y=80)

FullName =Label(self.Drigistration, text="FullName",font="arial 15 bold ",bg="light


gray")
FullName.place(x=50,y=180)

self.FullNameEntry=Entry(self.Drigistration,font="arial 15 ",bd=2,bg="light gray")


self.FullNameEntry.place(x=260,y=180)

Page 54 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Address =Label(self.Drigistration, text="Address",font="arial 15 bold ",bg="light gray")


Address.place(x=50,y=230)

self.AddressEntry=Entry(self.Drigistration,font="arial 15 ",bd=2,bg="light gray")


self. AddressEntry.place(x=260,y=230)

Email=Label(self.Drigistration, text="Email",font="arial 15 bold ",bg="light gray")


Email.place(x=50,y=280)

self.EmailEntry=Entry(self.Drigistration,font="arial 15 ",bd=2,bg="light gray")


self.EmailEntry.place(x=260,y=280)

PhoneNum=Label(self.Drigistration, text="PhoneNum",font="arial 15 bold ",bg="light


gray")
PhoneNum.place(x=50,y=330)

self.PhoneNumEntry=Entry(self.Drigistration,font="arial 15 ",bd=2,bg="light gray")


self.PhoneNumEntry.place(x=260,y=330)

CarLicensePlateNum = Label(self.Drigistration, text="CarLicensePlateNum", font="arial


15 bold ", bg="light gray")
CarLicensePlateNum.place(x=50, y=380)

self.CarLicensePlateNumEntry = Entry(self.Drigistration, font="arial 15 ", bd=2,


bg="light gray")
self.CarLicensePlateNumEntry.place(x=260, y=380)

userName = Label(self.Drigistration, text="Username", font="arial 15 bold ", bg="light


gray")
userName.place(x=50, y=430)

self.userNameEntry = Entry(self.Drigistration, font="arial 15 ", bd=2, bg="light gray")


self.userNameEntry.place(x=260, y=430)

Password=Label(self.Drigistration, text="Password",font="arial 15 bold ",bg="light


gray")
Password.place(x=50,y=480)

self.passwordEntry=Entry(self.Drigistration,show="*",font="arial 15 ",bd=2,bg="light
gray")
self.passwordEntry.place(x=260,y=480)

def show_password():
if checkbox_value.get() == 1:
# show password
self.passwordEntry.config(show="")
else:

Page 55 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

# hide password
self.passwordEntry.config(show="*")

# create a checkbox
checkbox_value = IntVar()
checkbox = Checkbutton(self.Drigistration, text="Show", background='light gray',
font=('Times New Roman', 8),
variable=checkbox_value, command=show_password)
checkbox.place(x=500, y=480)

Register=Button(self.Drigistration,command=lambda:[self.Dregister()],text=
"Register",font="arial 12 bold",bd=2,activebackground="sky blue")
Register.place(x=580,y=520)

Back=Button(self.Drigistration,command=lambda:[self.Drigistration.destroy(),self.Dlogin()],
text= "Back",font="arial 12 bold",bd=2,activebackground="sky blue")
Back.place(x=500,y=520)

def Dregister(self):
fullname = self.FullNameEntry.get()
address = self.AddressEntry.get()
phoneNum = self.PhoneNumEntry.get()
email = self.EmailEntry.get()
carLicensePlateNum = self.CarLicensePlateNumEntry.get()
username=self.userNameEntry.get()
password = self.passwordEntry.get()
Dreg = Driver()
Dreg.setFullName(fullname)
Dreg.setAddress(address)
Dreg.setPhoneNum(phoneNum)
Dreg.setEmail(email)
Dreg.setCarLicensePlateNum(carLicensePlateNum)
Dreg.setUsername(username)
Dreg.setPassword(password)
blDreg = BLDriver(Dreg)
a = blDreg.Dregistration_function()
if a:
self.Drigistration.destroy()
self.Dlogin()

def Dlogin(self):
from FrontendLayer.Loginpage import Login
Dlogin = Login()

Page 56 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Driver Home Page:

from tkinter import *


from tkinter import ttk
from BussinessLayer.BLDriver import BLDriver
from Models.Driver import Driver
from Models.Booking import Booking
from BussinessLayer.Blbooking import Blbooking
from PIL import ImageTk
driverID=0
Username=None
class Dhomepage():
def __init__(self,driver):
self.Dhomepage=Tk()
self.Dhomepage.title("Driver Home Page")
self.Dhomepage.geometry("700x550+300+100")
self.Dhomepage.resizable(False, False)
self.bg = ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/road.jpg")
self.bg_image = Label(self.Dhomepage, image=self.bg).place(x=0, y=0, relwidth=1,
relheight=1)
global driverID, Username
driverID = driver.getDid()
Username = driver.getUsername()
self.Dhomepage.configure(bg="#B4EEB4",highlightthickness=10)

# title
title=Label(self.Dhomepage,text="Taxi Booking System", font=("Monotype Corsiva",
30, "bold"), fg="#6AA84F", bg="light gray")
title.place(x=180, y=10)
title2 = Label(self.Dhomepage, text="Driver Home Page", font=("Monotype Corsiva",
20, "bold"), fg="#6AA84F",
bg="light gray")
title2.place(x=30, y=75)
# logout
logout = Button(self.Dhomepage, command=lambda: [self.Dhomepage.destroy(),
self.openwindow()], text="LogOut",
font="arial 10 bold", bd=0, activebackground="sky blue", bg="light blue")
logout.place(x=625, y=0)
# add table

listBox = ttk.Treeview(self.Dhomepage,)
listBox['show'] = 'headings'
listBox["columns"] = ("ID", "PickupAddress", "DropOfAddress", 'Date', "Time",

Page 57 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

'Booking Status')

# Assign the width, minwidth and anchor to the respective columns

listBox.column("ID", width=20, minwidth=50, anchor=CENTER)

listBox.column("PickupAddress", width=100, minwidth=100, anchor=CENTER)


listBox.column("DropOfAddress", width=150, minwidth=150, anchor=CENTER)
listBox.column("Date", width=90, minwidth=90, anchor=CENTER)
listBox.column("Time", width=90, minwidth=90, anchor=CENTER)
listBox.column("Booking Status", width=90, minwidth=90, anchor=CENTER)

# Assign the heading names to the respective columns

listBox.heading("ID", text="ID", anchor=CENTER)

listBox.heading("PickupAddress", text="PickupAddress", anchor=CENTER)


listBox.heading("DropOfAddress", text="DropOfAddress", anchor=CENTER)
listBox.heading("Date", text="Date", anchor=CENTER)
listBox.heading("Time", text="Time", anchor=CENTER)
listBox.heading("Booking Status", text="Booking Status", anchor=CENTER)

bookDriver = Driver()
bookDriver.setDid(int(driverID))
b = BLDriver(bookDriver)
a = b.viewdriverbooking()

for i in range(len(a)):
listBox.insert(parent='', index='end', iid=i, values=(a[i][0], a[i][1], a[i][2], a[i][3],
a[i][4], a[i][5]))

listBox.place(x=30, y=150, width=620, height=220)

frame=Frame(self.Dhomepage,bg="#D2691E")
frame.place(x=30,y=380,width=420,height=100)
BookingID = Label(frame, text="BookingID : ", font=("Times new roman", 12, "bold"),
bg="white",
fg="black", bd=2)
BookingID.place(x=10, y=20)
self.BookingIDEntry = Entry(frame, font=("Times new roman", 12, "bold"), bd=2,
bg="light gray")
self.BookingIDEntry.place(x=140, y=20)

BookingStatus = Label(frame, text="Booking Status : ", font=("Times new roman", 12,


"bold"), bg="white",
fg="black", bd=2)

Page 58 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

BookingStatus.place(x=10, y=54)
self.BookingStatusEntry = ttk.Combobox(frame)
self.BookingStatusEntry.place(x=140, y=54, width=170, height=25)
self.BookingStatusEntry['values'] = (" Completed ")
self.BookingStatusEntry['state'] = 'readonly'
completed = Button(frame,command=lambda :[self.completed()], text="Completed",
font="arial 10 bold", bd=1, activebackground="sky blue", bg="light blue")
completed.place(x=330, y=70)

def openwindow(self):
from FrontendLayer.Loginpage import Login
login = Login()

def completed(self):
bookingID=self.BookingIDEntry.get()
bookingstatus=self.BookingStatusEntry.get()
comp=Booking()
comp.setbid(bookingID)
comp.setBookingStatus(bookingstatus)
a=Blbooking(comp)
b=a.complete()

Amin Home Page:


from tkinter import *
from tkinter import ttk
import tkinter as tk
from PIL import ImageTk
from Models.Booking import Booking
from Models.Driver import Driver
from BussinessLayer.Bladmin import BLAdmin
from BussinessLayer.Blbooking import Blbooking

class Admin():
def __init__(self):
self.admin=Tk()
self.admin.title("Admin")
self.admin.geometry("1000x750+300+20")
self.admin.resizable(False, False)

Page 59 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

self.bg = ImageTk.PhotoImage(file="C:/Users/Acer/Downloads/pexels-pixabay-
219692.jpg")
self.bg_image = Label(self.admin, image=self.bg).place(x=0, y=0, relwidth=1,
relheight=1)
self.admin.configure(bg="#B4EEB4", highlightthickness=5)

# title
title = Label(self.admin, text="Taxi Booking System", font=("Monotype Corsiva", 40,
"bold"),
fg="#6AA84F", bg="light gray")
title.place(x=350, y=10)
title2 = Label(self.admin, text="Admin Home Page", font=("Monotype Corsiva", 30,
"bold"),
fg="#6AA84F",
bg="light gray")
title2.place(x=20, y=85)
# logout
logout = Button(self.admin, command=lambda: [self.admin.destroy(), self.openwindow()],
text="LogOut",
font="arial 10 bold", bd=0, activebackground="sky blue", bg="light blue")
logout.place(x=930, y=0)
# add table
title3 = Label(self.admin, text="Booking Details", font=("Monotype Corsiva", 20,
"underline"),
fg="#6AA84F",
bg="light gray")
title3.place(x=20, y=160)

self.listBox = ttk.Treeview(self.admin, )
self.listBox['show'] = 'headings'
self.listBox["columns"] = ("ID", "PickupAddress", "DropOfAddress", 'Date', "Time",
'Booking Status',"DriverID")

# Assign the width, minwidth and anchor to the respective columns

self.listBox.column("ID", width=20, minwidth=50, anchor=CENTER)

self.listBox.column("PickupAddress", width=80, minwidth=80, anchor=CENTER)


self.listBox.column("DropOfAddress", width=80, minwidth=80, anchor=CENTER)
self.listBox.column("Date", width=50, minwidth=50, anchor=CENTER)
self.listBox.column("Time", width=50, minwidth=50, anchor=CENTER)
self.listBox.column("Booking Status", width=80, minwidth=80, anchor=CENTER)
self.listBox.column("DriverID", width=20, minwidth=20, anchor=CENTER)

# Assign the heading names to the respective columns

self.listBox.heading("ID", text="ID", anchor=CENTER)

Page 60 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

self.listBox.heading("PickupAddress", text="PickupAddress", anchor=CENTER)


self.listBox.heading("DropOfAddress", text="DropOfAddress", anchor=CENTER)
self.listBox.heading("Date", text="Date", anchor=CENTER)
self.listBox.heading("Time", text="Time", anchor=CENTER)
self.listBox.heading("Booking Status", text="Booking Status", anchor=CENTER)
self.listBox.heading("DriverID", text="DriverID", anchor=CENTER)

book = Booking()
b = BLAdmin(book)
a = b.viewcustomerbooking()

for i in range(len(a)):
self.listBox.insert(parent='', index='end', iid=i,
values=(a[i][0], a[i][1], a[i][2], a[i][3], a[i][4], a[i][5], a[i][6]))

self.listBox.place(x=20, y=220, width=600, height=220)

# add table2
title4 = Label(self.admin, text="Driver Details", font=("Monotype Corsiva", 20,
"underline"),
fg="#6AA84F",
bg="light gray")
title4.place(x=350, y=450)

listBox2 = ttk.Treeview(self.admin, )
listBox2['show'] = 'headings'
listBox2["columns"] = ("ID", "FullName", "Address", 'PhoneNum', "Email",
'CarLicensePlateNum')

# Assign the width, minwidth and anchor to the respective columns

listBox2.column("ID", width=10, minwidth=10, anchor=CENTER)

listBox2.column("FullName", width=80, minwidth=80, anchor=CENTER)


listBox2.column("Address", width=80, minwidth=80, anchor=CENTER)
listBox2.column("PhoneNum", width=80, minwidth=80, anchor=CENTER)
listBox2.column("Email", width=80, minwidth=80, anchor=CENTER)
listBox2.column("CarLicensePlateNum", width=80, minwidth=80, anchor=CENTER)

# Assign the heading names to the respective columns

listBox2.heading("ID", text="ID", anchor=CENTER)

listBox2.heading("FullName", text="FullName", anchor=CENTER)


listBox2.heading("Address", text="Address", anchor=CENTER)

Page 61 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

listBox2.heading("PhoneNum", text="PhoneNum", anchor=CENTER)


listBox2.heading("Email", text="Email", anchor=CENTER)
listBox2.heading("CarLicensePlateNum", text="CarLicensePlateNum",
anchor=CENTER)

driver = Driver()
b2 = BLAdmin(driver)
a2 = b2.viewdriverdata()

for j in range(len(a2)):
listBox2.insert(parent='', index='end', iid=j,
values=(a2[j][0], a2[j][1], a2[j][2], a2[j][3], a2[j][4], a2[j][5]))

listBox2.place(x=350, y=500, width=630, height=220)

frame = Frame(self.admin, bg="#D2691E")


frame.place(x=20, y=480, width=320, height=200)
BookingID = Label(frame, text="BookingID : ", font=("Times new roman", 12, "bold"),
bg="white",
fg="black", bd=2)
BookingID.place(x=10, y=20)
self.BookingIDEntry = Entry(frame, font=("Times new roman", 12, "bold"), bd=2,
bg="light gray")
self.BookingIDEntry.place(x=140, y=20)

DriverID = Label(frame, text="DriverID : ", font=("Times new roman", 12, "bold"),


bg="white",
fg="black", bd=2)
DriverID.place(x=10, y=54)
self. DriverIDEntry = Entry(frame, font=("Times new roman", 12, "bold"), bd=2,
bg="light gray")
self. DriverIDEntry.place(x=140, y=54)

BookingStatus = Label(frame, text="Booking Status : ", font=("Times new roman", 12,


"bold"), bg="white",
fg="black", bd=2)
BookingStatus.place(x=10, y=88)
self.BookingStatusEntry = ttk.Combobox(frame)
self.BookingStatusEntry.place(x=140, y=88, width=170, height=25)
self.BookingStatusEntry['values'] = (" assigned ")
self.BookingStatusEntry['state'] = 'readonly'

completed = Button(frame, command=lambda :[self.assigned()], text="assigned",


font="arial 10 bold", bd=1, activebackground="sky blue", bg="light blue")
completed.place(x=140, y=120)

Page 62 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

def openwindow(self):
from FrontendLayer.Loginpage import Login
login = Login()

def assigned(self):
bookingID = self.BookingIDEntry.get()
bookingstatus = self.BookingStatusEntry.get()
driverID = self.DriverIDEntry.get()
comp = Booking()
comp.setbid(bookingID)
comp.setBookingStatus(bookingstatus)
comp.setdid(driverID)
a = Blbooking(comp)
b = a.assigned()

Models:

Customer:

class Customer(object):
cid=FullName=username=Address=PhoneNum=Email=PaymentMethod=Password=None
def init(self,FullName=None, username=None, Address=
None,PhoneNum=None,Email=None,PaymentMethod=None, Password=None ):
self.cid=0
self.FullName = FullName
self.username = username
self.Address=Address
self.PhoneNum= PhoneNum
self.Email= Email
self.PaymentMethod= PaymentMethod
self.Password= Password

def getFullName(self):
return self.FullName
def setFullName(self,FullName):
self.FullName= FullName

def getUsername(self):
return self.username

Page 63 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

def setUsername(self,username):
self.username= username

def getAddress(self):
return self.Address
def setAddress(self,Address):
self.Address= Address

def getPhoneNum(self):
return self.PhoneNum
def setPhoneNum(self, PhoneNum):
self.PhoneNum = PhoneNum

def getEmail(self):
return self.Email
def setEmail(self, Email):
self.Email = Email

def getPaymentMethod(self):
return self.PaymentMethod
def setPaymentMethod(self, PaymentMethod):
self.PaymentMethod = PaymentMethod

def getPassword(self):
return self.Password
def setPassword(self, Password):
self.Password = Password

def getCid(self):
return self.cid
def setCid(self,cid):
self.cid=cid

Booking:

class Booking(object):
bid=cid=PickOffAddress=DropOffAddress=date=time=BookingStatus=did=None
def init(self, PickOffAddress=None, DropOffAddress=
None,date=None,time=None,BookingStatus=None):
self.bid=0
self.cid=0
self.PickOffAddress = PickOffAddress
self.DropOffAddress=DropOffAddress
self.date= date
self.time=time
self.BookingStatus=BookingStatus

Page 64 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

self.did =0

def getcid(self):
return self.cid
def setcid(self, cid):
self.cid = cid

def getPickOffAddress(self):
return self.PickOffAddress
def setPickOffAddress(self,PickOffAddress):
self.PickOffAddress= PickOffAddress

def getDropOffAddress(self):
return self.DropOffAddress
def setDropOffAddress(self,DropOffAddress):
self.DropOffAddress= DropOffAddress

def getdate(self):
return self.Address
def setdate(self, Address):
self.Address = Address

def gettime(self):
return self.time
def settime(self, time):
self.time = time

def getbid(self):
return self.bid
def setbid(self,bid):
self.bid=bid

def getBookingStatus(self):
return self.BookingStatus

def setBookingStatus(self, BookingStatus):


self.BookingStatus = BookingStatus

def getdid(self):
return self.did

def setdid(self, did):


self.did = did

Page 65 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

Driver:

class Driver(object):

did=FullName=Password=Address=PhoneNum=Email=CarLicensePlateNum=Username=N
one
def init(self, FullName=None, Password=None , Address=
None,PhoneNum=None,Email=None,CarLicensePlateNum=None,Username=None):
self.did=0
self.FullName = FullName
self.Password = Password
self.Address=Address
self.PhoneNum= PhoneNum
self.Email= Email
self.CarLicensePlateNum= CarLicensePlateNum
self.Username=Username

def getFullName(self):
return self.FullName
def setFullName(self,FullName):
self.FullName= FullName

def getPassword(self):
return self.Password
def setPassword(self, Password):
self.Password = Password

def getAddress(self):
return self.Address
def setAddress(self,Address):
self.Address= Address

def getPhoneNum(self):
return self.PhoneNum
def setPhoneNum(self, PhoneNum):
self.PhoneNum = PhoneNum

def getEmail(self):
return self.Email
def setEmail(self, Email):
self.Email = Email

def getCarLicensePlateNum(self):
return self.CarLicensePlateNum

Page 66 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

def setCarLicensePlateNum(self, CarLicensePlateNum):


self.CarLicensePlateNum = CarLicensePlateNum

def getUsername(self):
return self.Username

def setUsername(self, Username):


self.Username = Username

def getDid(self):
return self.did
def setDid(self,did):
self.did=did

Business Layer:

BlCustomer:
import sys
from tkinter import *
from tkinter import messagebox

from DatabaseLayer .DatabaseConnection import databseconnection

class BLCustomer():
def __init__(self, customer):
self.customer= customer

def registration_function(self):

if self.customer.getUsername() == "" or self.customer.getPassword() == "" or


self.customer.getAddress()== "" or self.customer.getEmail() == "" or
self.customer.getPhoneNum() == ""or self.customer.getPaymentMethod() == "":
messagebox.showerror("Error", "All fields are required")
else:
conn=None
sql = " INSERT INTO customer

Page 67 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

(FullName,Username,Address,PhoneNum,Email,PaymentMethod,Password)
VAlUES(%s,%s,%s,%s,%s,%s,%s" \
")"
values = (self.customer.getFullName(),self.customer.getUsername(),
self.customer.getAddress(), self.customer.getEmail(),
self.customer.getPhoneNum(), self.customer.getPaymentMethod(),
self.customer.getPassword())
result = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
result = True
messagebox.showinfo('Information', 'Registred successfully')

except:
print("Error : ", sys.exc_info())
messagebox.showerror('Error!', 'Unable to Register or Username already Exist.')
finally:
del values
del sql
return result

def login_function(self):

conn = None
sql = """SELECT * FROM customer WHERE Username = %s and Password=
%s"""
values = (self.customer.getUsername(), self.customer.getPassword())
val = {'status': False, 'content': None}
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
content = cursor.fetchall()
if len(content) == 0 or content is None:
val['status'] = False
messagebox.showerror("Error","Username or Password is incorrect")
else:
val['status'] = True
val['content'] = content
messagebox.showinfo('Welcome','Welcome'+"

Page 68 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

"+self.customer.getUsername())

except :

print("Error : ", sys.exc_info())

finally:
del values
del sql
del conn
return val

Blbooking:

from tkinter import messagebox


from DatabaseLayer.DatabaseConnection import databseconnection
import sys

class Blbooking():
def __init__(self, booking):
self.booking= booking
def book_function(self):
if self.booking.getPickOffAddress()==""or self.booking.getDropOffAddress()==""or
self.booking.getdate()=="" or self.booking.gettime()=="":
messagebox.showinfo("Error","All flieds are required")
else:
conn = None
sql = " INSERT INTO booking
(CustomerID,PickupAddress,DropoffAddress,Date,Time) VAlUES(%s,%s,%s,%s,%s)"
values =
(self.booking.getcid(),self.booking.getPickOffAddress(),self.booking.getDropOffAddress(),s
elf.booking.getdate(),self.booking.gettime())
stat = False
try:
conn = databseconnection()
cursor=conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
stat = True
messagebox.showinfo('Information', 'Your Booking has been successful')

except:

Page 69 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

print("Error : ", sys.exc_info())


messagebox.showerror('Error!', 'Unable to make a booking.')
finally:
del values
del sql
return stat

def viewbooking(self):
conn = None
sql = """SELECT
BookingID,PickupAddress,DropoffAddress,Date,Time,Booking_Status FROM booking
WHERE CustomerID=%s"""
values = (self.booking.getcid(),)
val = None
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
content = cursor.fetchall()

val = content

except:
print("Error : ", sys.exc_info())
messagebox.showerror("Error")
finally:
del values
del sql
del conn
return val

def update(self):
conn = None
sql = " Update booking set PickupAddress= %s,DropoffAddress= %s,Date= %s,Time=
%s where BookingID= %s"
values = ( self.booking.getPickOffAddress(), self.booking.getDropOffAddress(),
self.booking.getdate(), self.booking.gettime(),self.booking.getbid())
stat = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
stat = True

Page 70 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

messagebox.showinfo('Information', 'Your Booking has been Update')

except:
print("Error : ", sys.exc_info())
messagebox.showerror('Error!', 'Unable to Update since your booking has already
been conformed.')
finally:
del values
del sql
return stat
def delete(self):
conn = None
a="NONE"
sql = " delete from booking where BookingID = %s and Booking_Status = %s "
values = ( self.booking.getbid(),a)
stat = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
stat = True
messagebox.showinfo('Information', 'Your Booking has been successfully Cancelled')
except:
print("Error : ", sys.exc_info())
messagebox.showerror('Error!', 'Unable to canceled .')
finally:
del values
del sql
return stat

def complete(self):
conn = None
sql = " Update booking set Booking_Status= %s where BookingID= %s"
values = (self.booking.getBookingStatus(), self.booking.getbid())
stat = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
stat = True

Page 71 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

messagebox.showinfo('Information', 'Your task has been completed')


except:
print("Error : ", sys.exc_info())

finally:
del values
del sql
return stat

def assigned(self):
if self.booking.getdid=="":
messagebox.showerror("Error")
conn = None
sql = " Update booking set Booking_Status= %s,DriverID= %s where BookingID= %s"
values = (self.booking.getBookingStatus(),self.booking.getdid(), self.booking.getbid())
stat = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
stat = True
messagebox.showinfo('Information', 'Driver has been assigned ')
except:
print("Error : ", sys.exc_info())
messagebox.showerror('Error!', '')
finally:
del values
del sql
return stat

BlDriver:
import sys
from tkinter import *
from tkinter import messagebox

from DatabaseLayer .DatabaseConnection import databseconnection

class BLDriver():
def __init__(self, driver):
self.driver= driver

Page 72 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

def Dregistration_function(self):

if self.driver.getFullName()== "" or self.driver.getPassword() == "" or


self.driver.getAddress()== "" or self.driver.getEmail() == "" or self.driver.getPhoneNum() ==
""or self.driver.getCarLicensePlateNum() == ""or self.driver.getUsername()=="":
messagebox.showerror("Error", "All fields are required")
else:
conn=None
sql = " INSERT INTO driver
(FullName,Address,PhoneNum,Email,CarLicensePlateNum,Username,Password)
VAlUES(%s,%s,%s,%s,%s,%s,%s" \
")"
values = (self.driver.getFullName(),
self.driver.getAddress(),self.driver.getPhoneNum(), self.driver.getEmail(),
self.driver.getCarLicensePlateNum(),self.driver.getUsername(),
self.driver.getPassword())
result = False
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
conn.commit()
conn.close()
cursor.close()
result = True
messagebox.showinfo('Information', 'Registred successfully')

except:
print("Error : ", sys.exc_info())
messagebox.showerror('Error!', 'Unable to Register or Username already Exist.')
finally:
del values
del sql
return result

def Dlogin_function(self):
if self.driver.getUsername()=="" or self.driver.getPassword()=="":
messagebox.showerror("Error", "All fields are required")
val = {'status': False, 'content': None}
else:
conn = None
sql = """SELECT * FROM driver WHERE Username = %s and Password= %s"""
values = (self.driver.getUsername(), self.driver.getPassword())
val = {'status': False, 'content': None}

Page 73 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
content = cursor.fetchall()
if len(content) == 0 or content is None:
val['status'] = False
messagebox.showerror("Error", "Username or Password is incorrect")

else:
val['status'] = True
val['content'] = content
messagebox.showinfo('Welcome', 'Welcome' + ' ' +
self.driver.getUsername())

except:
print("Error : ", sys.exc_info())

finally:
del values
del sql
del conn
return val

def viewdriverbooking(self):
conn = None
sql = """SELECT
BookingID,PickupAddress,DropoffAddress,Date,Time,Booking_Status FROM booking
WHERE DriverID=%s"""
values = (self.driver.getDid(),)
val = None
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql, values)
content = cursor.fetchall()

val = content

except:
print("Error : ", sys.exc_info())
messagebox.showerror("Error")
finally:
del values

Page 74 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

del sql
del conn
return val

Bladmin:

from tkinter import messagebox


import sys

from DatabaseLayer .DatabaseConnection import databseconnection

class BLAdmin():
def __init__(self, admin):
self.admin= admin

def viewcustomerbooking(self):
conn = None
sql = """SELECT
BookingID,PickupAddress,DropoffAddress,Date,Time,Booking_Status,DriverID FROM
booking ORDER BY Date"""
val = None
try:
conn = databseconnection()
cursor = conn.cursor()
cursor.execute(sql)
content = cursor.fetchall()

val = content

except:
print("Error : ", sys.exc_info())
messagebox.showerror("Error")
finally:

del sql
del conn
return val

def viewdriverdata(self):
conn = None
sql = """SELECT DriverID,FullName,Address,PhoneNum,Email,CarLicensePlateNum
FROM driver"""
val = None
try:
conn = databseconnection()
cursor = conn.cursor()

Page 75 of 76
CIS020-1 – Introduction to Software Development
CIS093-1 – Mathematics and Concepts for Computational Thinking
Assignment 2 – Individual Project – Case Study (Taxi Booking System)
University ID: 2147435 and Student Name: Sudan Tandukar

cursor.execute(sql)
content = cursor.fetchall()
val = content

except:
print("Error : ", sys.exc_info())
messagebox.showerror("Error")
finally:

del sql
del conn
return val

Page 76 of 76

You might also like