-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBankAccountDTO.py
34 lines (25 loc) · 1.26 KB
/
BankAccountDTO.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import mysql.connector
class BankAccountDTO:
def __init__(self):
self.conn = mysql.connector.connect(
user='root',
password='root',
host='127.0.0.1',
database='bank_account'
)
self.cursor = self.conn.cursor()
def create_bank_account(self):
self.cursor.execute("INSERT INTO bank (account_owner, account_number, account_pin, balance) "
"VALUES ('akash', 147852, 1234, 10)")
def set_initial_balance(self):
self.cursor.execute("INSERT INTO bank (account_owner, account_number, account_pin, balance) "
"VALUES ('akash', 147852, 1234, 10)")
def deposit(self):
self.cursor.execute("INSERT INTO bank (account_owner, account_number, account_pin, balance) "
"VALUES ('akash', 147852, 1234, 10)")
def withdrawal(self):
self.cursor.execute("INSERT INTO bank (account_owner, account_number, account_pin, balance) "
"VALUES ('akash', 147852, 1234, 10)")
def get_current_balance(self):
self.cursor.execute("INSERT INTO bank (account_owner, account_number, account_pin, balance) "
"VALUES ('akash', 147852, 1234, 10)")