Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# Define the Command interface
class Command:
def execute(self):
pass
# Define the ConcreteCommand
class InternationalCommand(Command):
def __init__(self, name, email, phone, address, service, joining_date, travel, db):
self.name = name
self.email = email
self.phone = phone
self.address = address
self.service = service
self.joining_date = joining_date
self.travel = travel
self.db = db
def execute(self):
self.db.execute(
'insert into sch (name, email, phone ,address ,service ,joining_date ,travel) values (?,?,?,?,?,?,?)',
[self.name, self.email, self.phone, self.address, self.service, self.joining_date, self.travel])
self.db.commit()
# Define the Invoker
class InternationalForm:
def __init__(self, command):
self.command = command
def submit(self):
self.command.execute()