def __init__(self): super().__init__() self.setWindowTitle("EMPLOYEE FORM.") self.setModal(True) self.resize(550, 350) # >>>FONT CONFIGURE<<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("white") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Data Employee", "rgb(125, 15, 15)") lblauthority = QLabelRC("\nJabatan\n", "black") lblauthority.setFont(self.font) self.cmbauthority = QComboBoxRC() self.cmbauthority.addItems( ['Employee', 'Receptonist', 'Marketing Crew', 'Cashier']) self.pilAuthority = [ Emptype.Employee, Emptype.Receptionist, Emptype.Marketing_crew, Emptype.Cashier ] lbljeniskelamin = QLabelRC("\nJenis Kelamin\n", "black") lbljeniskelamin.setFont(self.font) self.cmbjeniskelamin = QComboBoxRC() self.cmbjeniskelamin.addItems(['Laki-laki', 'Perempuan']) self.pilJenisKelamin = [JenKel.Lakilaki, JenKel.Perempuan] lblnama = QLabelRC("\nNama\n", "black") lblnama.setFont(self.font) self.txtnama = EditLineRC("Input Nama") lblTL = QLabelRC("\n\nTanggal Lahir\n", "black") lblTL.setFont(self.font) self.txtTL = EditLineRC("") lblalamat = QLabelRC("\n\nAlamat\n", "black") lblalamat.setFont(self.font) self.txtalamat = EditLineRC("Input Alamat") # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Tambah Data", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) self.btnMainMenu = QPushButtonRC2("Main Menu", "Assets/img/back.png") self.btnMainMenu.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnMainMenu.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnMainMenu.clicked.connect(lambda: self.switchMainMenu()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnMainMenu, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblnama, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtnama, 2, 0, 2, 3) layout1.addWidget(lblTL, 4, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtTL, 5, 0, 2, 3) layout1.addWidget(lblalamat, 7, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtalamat, 8, 0, 2, 3) layout1.addWidget(lblauthority, 1, 5, 1, 3) layout1.addWidget(self.cmbauthority, 2, 5, 2, 3) layout1.addWidget(lbljeniskelamin, 4, 5, 1, 3) layout1.addWidget(self.cmbjeniskelamin, 5, 5, 2, 3) self.setLayout(self.layoutUtama) self.show()
class EmployeeView(QDialog): def __init__(self): super().__init__() self.setWindowTitle("EMPLOYEE FORM.") self.setModal(True) self.resize(550, 350) # >>>FONT CONFIGURE<<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("white") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Data Employee", "rgb(125, 15, 15)") lblauthority = QLabelRC("\nJabatan\n", "black") lblauthority.setFont(self.font) self.cmbauthority = QComboBoxRC() self.cmbauthority.addItems( ['Employee', 'Receptonist', 'Marketing Crew', 'Cashier']) self.pilAuthority = [ Emptype.Employee, Emptype.Receptionist, Emptype.Marketing_crew, Emptype.Cashier ] lbljeniskelamin = QLabelRC("\nJenis Kelamin\n", "black") lbljeniskelamin.setFont(self.font) self.cmbjeniskelamin = QComboBoxRC() self.cmbjeniskelamin.addItems(['Laki-laki', 'Perempuan']) self.pilJenisKelamin = [JenKel.Lakilaki, JenKel.Perempuan] lblnama = QLabelRC("\nNama\n", "black") lblnama.setFont(self.font) self.txtnama = EditLineRC("Input Nama") lblTL = QLabelRC("\n\nTanggal Lahir\n", "black") lblTL.setFont(self.font) self.txtTL = EditLineRC("") lblalamat = QLabelRC("\n\nAlamat\n", "black") lblalamat.setFont(self.font) self.txtalamat = EditLineRC("Input Alamat") # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Tambah Data", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) self.btnMainMenu = QPushButtonRC2("Main Menu", "Assets/img/back.png") self.btnMainMenu.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnMainMenu.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnMainMenu.clicked.connect(lambda: self.switchMainMenu()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnMainMenu, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblnama, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtnama, 2, 0, 2, 3) layout1.addWidget(lblTL, 4, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtTL, 5, 0, 2, 3) layout1.addWidget(lblalamat, 7, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtalamat, 8, 0, 2, 3) layout1.addWidget(lblauthority, 1, 5, 1, 3) layout1.addWidget(self.cmbauthority, 2, 5, 2, 3) layout1.addWidget(lbljeniskelamin, 4, 5, 1, 3) layout1.addWidget(self.cmbjeniskelamin, 5, 5, 2, 3) self.setLayout(self.layoutUtama) self.show() @pyqtSlot() def insertData(self): self.id_emp = self.txtnama.text() self.nama_emp = self.txtnama.text() self.TL_emp = self.txtTL.text() self.jabatan_emp = self.pilAuthority[self.cmbauthority.currentIndex()] self.JK_emp = self.pilJenisKelamin[self.cmbjeniskelamin.currentIndex()] self.alamat_emp = self.txtalamat.text() employee = EmployeeOrm(self.id_emp, self.nama_emp, self.TL_emp, self.jabatan_emp, self.JK_emp, self.alamat_emp) try: EmployeeOrm.insertEmployee(employee) except Exception as e: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Warning) msg.setText("Something Wrong", e) msg.setWindowTitle("GAGAL") msg.exec_() else: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Information) msg.setText("Data Berhasil Di Input!") msg.setWindowTitle("BERHASIL") msg.exec_() self.clear() def switchMainMenu(self): self.close() def clear(self): self.txtnama.setText("") self.txtTL.setText("") self.txtalamat.setText("") self.cmbauthority.setCurrentIndex(0) self.cmbjeniskelamin.setCurrentIndex(0) self.txtnama.setFocus()
def __init__(self): super().__init__() self.setWindowTitle("Sign in.") self.setModal(True) self.resize(750, 400) # >>> FONT CONFIGURE <<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("azure") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Daftar Akun User", "rgb(125, 15, 15)") lblauthority = QLabelRC("\nOtoritas\n", "black") lblauthority.setFont(self.font) self.cmbauthority = QComboBoxRC() self.cmbauthority.addItems([ 'Administrator', 'Employee', 'Receptionist', 'Marketing_crew', 'Cashier', 'Visitor' ]) self.pilAuthority = [ Authority.Administrator, Authority.Employee, Authority.Receptionist, Authority.Marketing_crew, Authority.Cashier, Authority.Visitor ] lblusername = QLabelRC("\nUsername\n", "black") lblusername.setFont(self.font) self.txtusername = EditLineRC("Input Username") lblpassword = QLabelRC("\n\nPassword\n", "black") lblpassword.setFont(self.font) self.txtpassword = EditLineRC("Input Password") # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Tambah Akun", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 30px;\n" "height : 60%;\n" "color : grey;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) # >>> LOGIN BUTTON <<< self.btnLogin = QPushButtonRC2("Login Now", "Assets/img/profile.png") self.btnLogin.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 30px;\n" "height : 60%;\n" "color : grey;\n") self.btnLogin.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnLogin.clicked.connect(lambda: self.LoginView()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnLogin, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblusername, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtusername, 2, 0, 2, 3) layout1.addWidget(lblauthority, 4, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.cmbauthority, 5, 0, 2, 3) layout1.addWidget(lblpassword, 1, 5, 1, 3) layout1.addWidget(self.txtpassword, 2, 5, 2, 3) self.setLayout(self.layoutUtama) self.show()
class UserView(QDialog): def __init__(self): super().__init__() self.setWindowTitle("Sign in.") self.setModal(True) self.resize(750, 400) # >>> FONT CONFIGURE <<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("azure") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Daftar Akun User", "rgb(125, 15, 15)") lblauthority = QLabelRC("\nOtoritas\n", "black") lblauthority.setFont(self.font) self.cmbauthority = QComboBoxRC() self.cmbauthority.addItems([ 'Administrator', 'Employee', 'Receptionist', 'Marketing_crew', 'Cashier', 'Visitor' ]) self.pilAuthority = [ Authority.Administrator, Authority.Employee, Authority.Receptionist, Authority.Marketing_crew, Authority.Cashier, Authority.Visitor ] lblusername = QLabelRC("\nUsername\n", "black") lblusername.setFont(self.font) self.txtusername = EditLineRC("Input Username") lblpassword = QLabelRC("\n\nPassword\n", "black") lblpassword.setFont(self.font) self.txtpassword = EditLineRC("Input Password") # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Tambah Akun", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 30px;\n" "height : 60%;\n" "color : grey;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) # >>> LOGIN BUTTON <<< self.btnLogin = QPushButtonRC2("Login Now", "Assets/img/profile.png") self.btnLogin.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 30px;\n" "height : 60%;\n" "color : grey;\n") self.btnLogin.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnLogin.clicked.connect(lambda: self.LoginView()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnLogin, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblusername, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.txtusername, 2, 0, 2, 3) layout1.addWidget(lblauthority, 4, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.cmbauthority, 5, 0, 2, 3) layout1.addWidget(lblpassword, 1, 5, 1, 3) layout1.addWidget(self.txtpassword, 2, 5, 2, 3) self.setLayout(self.layoutUtama) self.show() @pyqtSlot() def insertData(self): self.username = self.txtusername.text() self.password = self.txtpassword.text() self.authority = self.pilAuthority[self.cmbauthority.currentIndex()] user = User(self.username, self.password, self.authority) try: UserOrm.insertUser(user) except Exception as e: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Warning) msg.setText("Ada kesalahan!", e) msg.setWindowTitle("GAGAL") msg.exec_() else: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Information) msg.setText("Akun berhasil dibuat!") msg.setWindowTitle("BERHASIL") msg.exec_() self.clear() def LoginView(self): from GUI.AuthenticationGUI import LoginView self.LoginView = LoginView() self.LoginView.show() self.hide() def clear(self): self.txtusername.setText("") self.txtpassword.setText("") self.cmbauthority.setCurrentIndex(0) self.txtusername.setFocus()
def __init__(self): super().__init__() self.setWindowTitle("BOOK A ROOM") self.setModal(True) self.resize(550, 350) # >>>FONT CONFIGURE<<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("white") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Pesan ruangan", "rgb(125, 15, 15)") lblnomorRuangan = QLabelRC("\nNomor Ruangan\n", "black") lblnomorRuangan.setFont(self.font) self.cmbnomorRuangan = QComboBoxRC() self.cmbnomorRuangan.addItems( ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10']) self.pilnomorRuangan = [RoomNumber.first, RoomNumber.second, RoomNumber.third, RoomNumber.fourth, RoomNumber.fifth, RoomNumber.sixth, RoomNumber.seventh, RoomNumber.eighth, RoomNumber.nineth, RoomNumber.tenth] lbltipeRuangan = QLabelRC("\nTipe Ruangan\n", "black") lbltipeRuangan.setFont(self.font) self.cmbtipeRuangan = QComboBoxRC() self.cmbtipeRuangan.addItems( ['Normal', 'VIP', 'VVIP']) self.piltipeRuangan = [RoomCode.Normal, RoomCode.VIP, RoomCode.VVIP] lbldesc = QLabelRC("\nNote : Tiap tipe ruangan memiliki harga yang berbeda\n", "black") lbldesc.setFont(self.font) self.txtnama = EditLineRC("Test") # >>> SECOND LAYOUT <<< framelayout2 = QFrameRC("white") framelayout2.setContentsMargins(10, 10, 10, 10) layout2 = QGridLayout(framelayout2) # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Pesan sekarang!", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) self.btnMainMenu = QPushButtonRC2("Main Menu", "Assets/img/back.png") self.btnMainMenu.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnMainMenu.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnMainMenu.clicked.connect(lambda: self.switchMainMenu()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(framelayout2, 4, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnMainMenu, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblnomorRuangan, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.cmbnomorRuangan, 2, 0, 2, 3) layout1.addWidget(lbltipeRuangan, 1, 5, 1, 3) layout1.addWidget(self.cmbtipeRuangan, 2, 5, 2, 3) layout2.addWidget(lbldesc, 0, 0, 0, 0) self.setLayout(self.layoutUtama) self.show()
class BookView(QDialog): def __init__(self): super().__init__() self.setWindowTitle("BOOK A ROOM") self.setModal(True) self.resize(550, 350) # >>>FONT CONFIGURE<<< self.font = QtGui.QFont() self.font.setFamily("Product Sans") self.font.setPointSize(12) self.font.setWeight(55) # >>> BASE SECTION <<< self.layoutUtama = QGridLayout() # >>> FIRST LAYOUT <<< framelayout1 = QFrameRC("white") framelayout1.setContentsMargins(25, 25, 25, 25) layout1 = QGridLayout(framelayout1) lbljudul = QLabelRC("Pesan ruangan", "rgb(125, 15, 15)") lblnomorRuangan = QLabelRC("\nNomor Ruangan\n", "black") lblnomorRuangan.setFont(self.font) self.cmbnomorRuangan = QComboBoxRC() self.cmbnomorRuangan.addItems( ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10']) self.pilnomorRuangan = [RoomNumber.first, RoomNumber.second, RoomNumber.third, RoomNumber.fourth, RoomNumber.fifth, RoomNumber.sixth, RoomNumber.seventh, RoomNumber.eighth, RoomNumber.nineth, RoomNumber.tenth] lbltipeRuangan = QLabelRC("\nTipe Ruangan\n", "black") lbltipeRuangan.setFont(self.font) self.cmbtipeRuangan = QComboBoxRC() self.cmbtipeRuangan.addItems( ['Normal', 'VIP', 'VVIP']) self.piltipeRuangan = [RoomCode.Normal, RoomCode.VIP, RoomCode.VVIP] lbldesc = QLabelRC("\nNote : Tiap tipe ruangan memiliki harga yang berbeda\n", "black") lbldesc.setFont(self.font) self.txtnama = EditLineRC("Test") # >>> SECOND LAYOUT <<< framelayout2 = QFrameRC("white") framelayout2.setContentsMargins(10, 10, 10, 10) layout2 = QGridLayout(framelayout2) # >>> ADD DATA <<< self.btnTambah = QPushButtonRC2("Pesan sekarang!", "Assets/img/button.png") self.btnTambah.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnTambah.setIconSize(QtCore.QSize(60, 35)) self.btnMainMenu = QPushButtonRC2("Main Menu", "Assets/img/back.png") self.btnMainMenu.setStyleSheet("background-color : rgb(125, 15, 15);\n" "border : none;\n" "border-radius : 25px;\n" "height : 50%;\n" "color : white;\n") self.btnMainMenu.setIconSize(QtCore.QSize(60, 35)) # >>> EVENT SECTION <<< self.btnTambah.clicked.connect(lambda: self.insertData()) self.btnMainMenu.clicked.connect(lambda: self.switchMainMenu()) # >>> LAYOUT SECTION <<< self.layoutUtama.addWidget(framelayout1, 0, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(framelayout2, 4, 0, 1, 9, Qt.AlignVCenter) self.layoutUtama.addWidget(self.btnTambah, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignRight) self.layoutUtama.addWidget(self.btnMainMenu, 5, 0, 1, 9, Qt.AlignBottom | Qt.AlignLeft) layout1.addWidget(lbljudul, 0, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(lblnomorRuangan, 1, 0, 1, 3, Qt.AlignLeft) layout1.addWidget(self.cmbnomorRuangan, 2, 0, 2, 3) layout1.addWidget(lbltipeRuangan, 1, 5, 1, 3) layout1.addWidget(self.cmbtipeRuangan, 2, 5, 2, 3) layout2.addWidget(lbldesc, 0, 0, 0, 0) self.setLayout(self.layoutUtama) self.show() @pyqtSlot() def insertData(self): self.id = "e" self.room_number = self.piltipeRuangan[self.cmbtipeRuangan.currentIndex()] self.room_code = self.pilnomorRuangan[self.cmbnomorRuangan.currentIndex()] self.status = "e" room = RoomOrm(self.id, self.room_number, self.room_code, self.status) try: RoomOrm.insertRoom(room) except Exception as e: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Warning) msg.setText("Something Wrong", e) msg.setWindowTitle("GAGAL") msg.exec_() else: msg = QMessageBox() msg.resize(250, 250) msg.setIcon(QMessageBox.Information) msg.setText("Data Berhasil Di Input!") msg.setWindowTitle("BERHASIL") msg.exec_() self.clear() def switchMainMenu(self): self.close() def clear(self): self.cmbtipeRuangan.setCurrentIndex(0) self.cmbnomorRuangan.setCurrentIndex(0)