Notes
Notes - notes.io |
from PyQt5 import QtWidgets
import sqlite3
class Program(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.me = QtWidgets.QPushButton("Müşteri Ekle")
self.ms = QtWidgets.QPushButton("Müşteri Sil")
self.mg = QtWidgets.QPushButton("Müşterileri Göster")
self.cks = QtWidgets.QPushButton("Çıkış")
v_box = QtWidgets.QVBoxLayout()
v_box.addStretch()
v_box.addWidget(self.me)
v_box.addWidget(self.ms)
v_box.addWidget(self.mg)
v_box.addWidget(self.cks)
self.setLayout(v_box)
self.me.clicked.connect(self.m_ek)
self.setWindowTitle("Muhasebe Ana Menü")
self.setGeometry(400,100,500,500)
self.show()
def m_ek(self):
pencere2.show()
class pencere2(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.baglan2()
self.ana()
def baglan2(self):
baglan2 = sqlite3.connect("veri.db")
self.cursor = baglan2.cursor()
self.cursor.execute("Create Table If not Exists Müşteriler (Müşteri TEXT,Ürün TEXT,Adet INT)")
baglan2.commit()
def ana(self):
self.ad_label = QtWidgets.QLabel("Ad : ")
self.kad = QtWidgets.QLineEdit()
self.iphone = QtWidgets.QRadioButton("İphone")
self.huawei = QtWidgets.QRadioButton("Huawei")
self.samsung = QtWidgets.QRadioButton("Samsung")
self.mi = QtWidgets.QRadioButton("Xiaomi")
self.adet1_label = QtWidgets.QLabel("Adet : ")
self.adet = QtWidgets.QLineEdit()
self.muserkayıt = QtWidgets.QPushButton("Kaydet")
v1_box = QtWidgets.QVBoxLayout()
v1_box.addStretch()
v1_box.addWidget(self.ad_label)
v1_box.addWidget(self.kad)
v1_box.addStretch()
v1_box.addWidget(self.iphone)
v1_box.addWidget(self.huawei)
v1_box.addWidget(self.samsung)
v1_box.addWidget(self.mi)
v1_box.addStretch()
v1_box.addWidget(self.adet1_label)
v1_box.addWidget(self.adet)
v1_box.addStretch()
v1_box.addWidget(self.muserkayıt)
self.setLayout(v1_box)
self.setWindowTitle("Müşteri Ekleme Ekranı")
self.muserkayıt.clicked.connect(lambda: self.kaydet_muster(self.iphone.isChecked(), self.huawei.isChecked(), self.samsung.isChecked(),self.mi.isChecked(),self.kad,self.adet))
def kaydet_muster(self,iphone,huawei,samsung,mi):
kadikay = self.kad.text()
a1 = "İphone"
a2 = "Huawei"
a3 = "Samsung"
a4 = "Mi"
kadur = self.adet.kad()
aaa = sqlite3.connect("veri.db")
self.cursor = aaa.cursor()
if iphone:
self.cursor.execute("INSERT INTO Müşteriler Values(?,?,?)", (kadikay,a1,kadur))
aaa.commit()
aaa.close()
if huawei:
self.cursor.execute("INSERT INTO Müşteriler Values(?,?,?)", (kadikay,a2, kadur))
aaa.commit()
aaa.close()
if samsung:
self.cursor.execute("INSERT INTO Müşteriler Values(?,?,?)", (kadikay, a3, kadur))
aaa.commit()
aaa.close()
if mi:
self.cursor.execute("INSERT INTO Müşteriler Values(?,?,?)", (kadikay, a4, kadur))
aaa.commit()
aaa.close()
class pencere3(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.mustersil()
def mustersil(self):
pass
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
pencere = Program()
pencere2 = pencere2()
pencere3 = pencere3()
sys.exit(app.exec_())
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team