Client Test Rechungsinterface lauffähig.
This commit is contained in:
parent
3a7af8bcd9
commit
f27bb8b1cf
127
client_test.py
127
client_test.py
|
@ -62,6 +62,7 @@ class Client():
|
||||||
|
|
||||||
def check_in(self, room, key_num):
|
def check_in(self, room, key_num):
|
||||||
room_list[reference.index(room)].occupy(self.surname, self.period)
|
room_list[reference.index(room)].occupy(self.surname, self.period)
|
||||||
|
self.room = room
|
||||||
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(self.surname) + "')"
|
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(self.surname) + "')"
|
||||||
try:
|
try:
|
||||||
exec(num_)
|
exec(num_)
|
||||||
|
@ -70,10 +71,27 @@ class Client():
|
||||||
("Schlüssel mit Daten nicht gefunden.")
|
("Schlüssel mit Daten nicht gefunden.")
|
||||||
new_bill = add_bill(self.name, self.surname, self.client_num, room, self.period)
|
new_bill = add_bill(self.name, self.surname, self.client_num, room, self.period)
|
||||||
return new_bill
|
return new_bill
|
||||||
|
|
||||||
|
def check_out(self):
|
||||||
|
room_list[reference.index(self.room)].free()
|
||||||
|
key_num = self.key_num
|
||||||
|
num_ = "key_" + str(key_num) + ".get_back_key(" + str(key_num)+ ")"
|
||||||
|
try:
|
||||||
|
exec(num_)
|
||||||
|
print("Der Gast ist erfolgreich ausgecheckt worden.")
|
||||||
|
except:
|
||||||
|
("Schlüssel mit Daten nicht gefunden.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def client_bill(self, bill_num):
|
def client_bill(self, bill_num):
|
||||||
self.bookings.append(str(bill_num))
|
self.bookings.append(str(bill_num))
|
||||||
|
|
||||||
|
def client_bill_delete(self, bill_num):
|
||||||
|
if bill_num in self.bookings:
|
||||||
|
self.bookings.remove(bill_num)
|
||||||
|
print("Rechnung wurde beim Gast", self.client_num, "gelöscht.")
|
||||||
|
|
||||||
def change_room(self, surname, new_room, key_num = 0): # Room add period
|
def change_room(self, surname, new_room, key_num = 0): # Room add period
|
||||||
room_list[reference.index(self.room)].free()
|
room_list[reference.index(self.room)].free()
|
||||||
room_list[reference.index(new_room)].occupy(surname, self.period)
|
room_list[reference.index(new_room)].occupy(surname, self.period)
|
||||||
|
@ -153,6 +171,7 @@ class Client():
|
||||||
else:
|
else:
|
||||||
for i in dic_:
|
for i in dic_:
|
||||||
print(i.ljust(16), ": ", dic_[i])
|
print(i.ljust(16), ": ", dic_[i])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -202,7 +221,8 @@ class Room:
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for i in dic_:
|
for i in dic_:
|
||||||
print(i.ljust(16), ": ", dic_[i])
|
print(i.ljust(16), ": ", dic_[i])
|
||||||
|
|
||||||
|
|
||||||
# Generates all the rooms
|
# Generates all the rooms
|
||||||
# nr.10-"Single", nr.20-"Double", nr.30-"Suite", nr.40-"Panorama_Suite"
|
# nr.10-"Single", nr.20-"Double", nr.30-"Suite", nr.40-"Panorama_Suite"
|
||||||
|
@ -295,6 +315,17 @@ class Accounting():
|
||||||
self.bill_status = True
|
self.bill_status = True
|
||||||
print("Rechnung", self.bill_num, "wurde bezahlt.")
|
print("Rechnung", self.bill_num, "wurde bezahlt.")
|
||||||
|
|
||||||
|
def delete_bill(self, bill_num):
|
||||||
|
for i in client_list:
|
||||||
|
var = str(i) + ".client_bill_delete(" + "'" + bill_num + "'" + ")"
|
||||||
|
#print(var)
|
||||||
|
exec(var)
|
||||||
|
var = str(i) + ".check_out()"
|
||||||
|
#print(var)
|
||||||
|
exec(var)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
print("Rechnung wurde storniert.")
|
print("Rechnung wurde storniert.")
|
||||||
|
@ -322,10 +353,14 @@ def show_single_bill():
|
||||||
print(bill_list)
|
print(bill_list)
|
||||||
while True:
|
while True:
|
||||||
k = input("Rechnungsnummer? ")
|
k = input("Rechnungsnummer? ")
|
||||||
if k in bill_list:
|
if k in bill_list or k == "abbrechen":
|
||||||
break
|
break
|
||||||
c = str(k) + ".show_bill()"
|
if k != "abbrechen":
|
||||||
exec(c)
|
try:
|
||||||
|
c = str(k) + ".show_bill()"
|
||||||
|
exec(c)
|
||||||
|
except:
|
||||||
|
print("Rechnung wurde nicht gefunden.")
|
||||||
|
|
||||||
def pay_your_bill():
|
def pay_your_bill():
|
||||||
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
||||||
|
@ -333,16 +368,19 @@ def pay_your_bill():
|
||||||
print("Rechungsnummer? ")
|
print("Rechungsnummer? ")
|
||||||
while True:
|
while True:
|
||||||
bill =input().strip().lower()
|
bill =input().strip().lower()
|
||||||
if bill in bill_list:
|
if bill in bill_list or bill == "abbrechen":
|
||||||
break
|
break
|
||||||
c = str(bill) + ".pay_bill()"
|
if bill != "abbrechen":
|
||||||
exec(c)
|
try:
|
||||||
|
c = str(bill) + ".pay_bill()"
|
||||||
def delete_bill():
|
exec(c)
|
||||||
input_ = input("Rechnungsnummer: ")
|
except:
|
||||||
delete = "del " + input_
|
print("Rechung wurde nicht gefunden.")
|
||||||
exec(delete)
|
|
||||||
|
|
||||||
|
def delete_bill(bill_numb):
|
||||||
|
k = str(bill_numb) + ".delete_bill(bill_numb)"
|
||||||
|
exec(k)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,6 +417,7 @@ exec(k)
|
||||||
|
|
||||||
j = c0.check_in("Suite",31)
|
j = c0.check_in("Suite",31)
|
||||||
exec(j)
|
exec(j)
|
||||||
|
#print(c0.info())
|
||||||
clear()
|
clear()
|
||||||
|
|
||||||
|
|
||||||
|
@ -399,11 +438,6 @@ except ModuleNotFoundError:
|
||||||
imported = False
|
imported = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import sys, time
|
|
||||||
|
|
||||||
|
|
||||||
def play_sound():
|
def play_sound():
|
||||||
if imported:
|
if imported:
|
||||||
wave_obj = simpleaudio.WaveObject.from_wave_file\
|
wave_obj = simpleaudio.WaveObject.from_wave_file\
|
||||||
|
@ -417,29 +451,23 @@ def stop_sound(play_obj):
|
||||||
play_obj.stop()
|
play_obj.stop()
|
||||||
|
|
||||||
|
|
||||||
def print1by1(text, delay=0.1):
|
|
||||||
for c in text:
|
|
||||||
sys.stdout.write(c)
|
|
||||||
sys.stdout.flush()
|
|
||||||
time.sleep(delay)
|
|
||||||
print
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def ascii_print():
|
def ascii_print():
|
||||||
with open('ascii_print_hotel', 'r', encoding='utf8') as ascii_:
|
with open('ascii_print_hotel', 'r', encoding='utf8') as ascii_:
|
||||||
for line in ascii_:
|
for line in ascii_:
|
||||||
sys.stdout.write(line)
|
sys.stdout.write(line)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
input("Start?")
|
input("Start?")
|
||||||
clear()
|
clear()
|
||||||
|
#Intro
|
||||||
play_obj = play_sound()
|
play_obj = play_sound()
|
||||||
|
|
||||||
|
#Logo Print
|
||||||
ascii_print()
|
ascii_print()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("WELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
print("WELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
||||||
input("Press enter to continue")
|
input("Press enter to continue")
|
||||||
clear()
|
clear()
|
||||||
|
@ -457,7 +485,7 @@ Dienstpläne\n""")
|
||||||
|
|
||||||
print("Welches der folgenden Systeme möchten Sie öffnen?")
|
print("Welches der folgenden Systeme möchten Sie öffnen?")
|
||||||
system = input().strip().lower()
|
system = input().strip().lower()
|
||||||
if system in system_list:
|
if system in system_list or system == "beenden":
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
clear()
|
clear()
|
||||||
|
@ -486,12 +514,42 @@ Abbrechen
|
||||||
if account == "1":
|
if account == "1":
|
||||||
print("Rechnung anzeigen\n")
|
print("Rechnung anzeigen\n")
|
||||||
show_single_bill()
|
show_single_bill()
|
||||||
|
input()
|
||||||
clear()
|
clear()
|
||||||
|
continue
|
||||||
|
|
||||||
if account == "2":
|
if account == "2":
|
||||||
print("Rechung bezahlen\n")
|
print("Rechung bezahlen\n")
|
||||||
pay_your_bill()
|
pay_your_bill()
|
||||||
|
input()
|
||||||
clear()
|
clear()
|
||||||
else:
|
continue
|
||||||
|
|
||||||
|
if account == "3":
|
||||||
|
print("Rechnung löschen\n")
|
||||||
|
while True:
|
||||||
|
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
||||||
|
print(bill_list)
|
||||||
|
print("Rechungsnummer? ")
|
||||||
|
bill_numb =input().strip().lower()
|
||||||
|
if bill_numb in bill_list or bill_numb == "abbrechen":
|
||||||
|
break
|
||||||
|
|
||||||
|
if bill_numb == "abbrechen":
|
||||||
|
clear()
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
delete_bill(bill_numb) # Delete bill at client
|
||||||
|
|
||||||
|
delete_ = "del " + bill_numb
|
||||||
|
exec(delete_) # Delete bill in system
|
||||||
|
|
||||||
|
bill_list.remove(bill_numb) # Delete bill at bill_list
|
||||||
|
input()
|
||||||
|
clear()
|
||||||
|
continue
|
||||||
|
|
||||||
|
if account == "abbrechen":
|
||||||
clear()
|
clear()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -507,6 +565,11 @@ Abbrechen
|
||||||
|
|
||||||
if system == system_list[4]: #duty_roster
|
if system == system_list[4]: #duty_roster
|
||||||
pass
|
pass
|
||||||
|
if system == "beenden":
|
||||||
|
clear()
|
||||||
|
print("The Grand Budapest Hotel wünscht noch einen angenehmen Tag.")
|
||||||
|
print("Auf Wiedersehen!")
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue