def deposit_command():  #입금
    a = ledger_bk.search(account_num.get(), name.get(),
                         password.get())  #Entry에서 받아옴
    b = int(a[0][3]) + int(money.get())  #DB에 있는 계좌 잔액과 Entry에서 받아온 금액 합산
    ledger_bk.update(name.get(), account_num.get(), b)  #합산된 금액 업데이트
    lb.delete(0, END)
    lb.insert(END, "입금이 완료되었습니다.")
def withdraw_command():  #출금
    c = ledger_bk.search(account_num.get(), name.get(),
                         password.get())  #Entry에서 받아옴
    d = int(c[0][3])
    if (d >= int(money.get())):  #DB에 있는 계좌 잔액이 Entry에서 받아온 금액보다 큰 경우
        e = int(c[0][3]) - int(money.get())  #DB에 있는 계좌 잔액에서 Entry에서 받아온 금액 차감
        ledger_bk.update(name.get(), account_num.get(), e)  #차감된 금액 업데이트
        lb.delete(0, END)
        lb.insert(END, "출금이 완료되었습니다.")
    else:  #DB에 있는 계좌 잔액이 Entry에서 받아온 금액보다 작을 경우
        lb.delete(0, END)
        msgbox.showerror("에러", "금액이 부족하여 출금할 수 없습니다.")  #에러 발생
Beispiel #3
0
def update_command():
    ledger_bk.update(selected_tuple[0],name.get(),user.get(),password.get(),category.get(),cdate.get())
    view_command()
Beispiel #4
0
def update_command():
    ledger_bk.update(selected_tuple[0], name.get(), user.get(), password.get(),
                     category.get(), url.get())
    view_command()
    print(now_date + ' ' + now_hour + now_min + ':' + ' ' +
          'User updated a record')
Beispiel #5
0
 def update_sub():
     finBal = int(index[4]) + balance.get()
     tg = finBal / 5000
     ledger_bk.update(index[0], user.get(), password.get(), finBal, tg)
     root.destroy()
     messagebox.showinfo('Message', 'Success!')