TaxiBookingSystem PDF
TaxiBookingSystem PDF
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
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
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
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
Requirements Analysis
Functional Requirements
Non-functional Requirements
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
*MOSCOW Notation:
M = MUST
S = SHOULD
C = COULD
W = WON’T
Design
UML Diagrams
Uses Case Diagrams(s)
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
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)
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.
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
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)
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
Database Design
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
login=Login()
login.mainloop()
Login Page:
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):
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)
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)
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
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)
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)
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")
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)
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
frame5=Frame(frame2,bg="#EEB422")
frame5.place(x=20,y=200,height=250,width=400)
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
#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'
# add table
listBox = ttk.Treeview(frame3)
listBox['show'] = 'headings'
listBox["columns"] = ("ID", "PickupAddress", "DropOfAddress", 'Date', "Time",
'Booking Status')
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
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()
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:
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)
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
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
# 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')
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]))
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)
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()
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")
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
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]))
# 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')
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
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]))
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 getdid(self):
return self.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 getUsername(self):
return self.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
class BLCustomer():
def __init__(self, customer):
self.customer= customer
def registration_function(self):
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 :
finally:
del values
del sql
del conn
return val
Blbooking:
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
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
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
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
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):
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:
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