def login(self): while True: try: self.createDB() #First Step Only View.clear() uname = input("Masukkan Username: "******"Masukkan Password: "******"Login Sucsess\n") self.createDB() if tempRole[i] == "Owner": self.ownerMenu() else: self.karyawanMenu() else: tempJ += 1 if tempJ != len(tempUname): pass else: View.clear() y = input( "Login Failed. Silahkan coba lagi\nKetik 'exit' untuk exit : " ).lower() if y == "exit": self.close() else: View.clear() except KeyboardInterrupt: View.interrupt() break
def ownerMenu(self): while True: try: View.printOmenu(self.namaUser) jawab = input('Jawab : ') if jawab == '1': View.clear() print("Menambah Karyawan") self.createKaryawan() print() elif jawab == '2': View.clear() self.showKaryawan() print() elif jawab == '3': View.clear() self.deleteKaryawan() print() elif jawab == '4': View.clear() self.history() print() elif jawab == '5': View.clear() self.showBarang() print() elif jawab == '6': View.clear() self.ambilBarang() print() elif jawab == '7': View.clear() self.tambahStokBarang() print() elif jawab == '8': View.clear() self.tambahBarang() print() elif jawab == '9': return self.close() else: View.clear() View.jawabFalse() except KeyboardInterrupt: View.interrupt() break
def karyawanMenu(self): while True: try: View.printKmenu(self.namaUser) jawab = input('Jawab : ') if jawab == '1': View.clear() self.history() print() elif jawab == '2': View.clear() self.showBarang() print() elif jawab == '3': View.clear() self.ambilBarang() print() elif jawab == '4': View.clear() self.tambahStokBarang() print() elif jawab == '5': View.clear() self.tambahBarang() print() elif jawab == '6': return self.close() else: View.clear() View.jawabFalse() except KeyboardInterrupt: View.interrupt() break