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):
|
||||
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) + "')"
|
||||
try:
|
||||
exec(num_)
|
||||
|
@ -70,10 +71,27 @@ class Client():
|
|||
("Schlüssel mit Daten nicht gefunden.")
|
||||
new_bill = add_bill(self.name, self.surname, self.client_num, room, self.period)
|
||||
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):
|
||||
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
|
||||
room_list[reference.index(self.room)].free()
|
||||
room_list[reference.index(new_room)].occupy(surname, self.period)
|
||||
|
@ -153,6 +171,7 @@ class Client():
|
|||
else:
|
||||
for i in dic_:
|
||||
print(i.ljust(16), ": ", dic_[i])
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -202,7 +221,8 @@ class Room:
|
|||
|
||||
else:
|
||||
for i in dic_:
|
||||
print(i.ljust(16), ": ", dic_[i])
|
||||
print(i.ljust(16), ": ", dic_[i])
|
||||
|
||||
|
||||
# Generates all the rooms
|
||||
# nr.10-"Single", nr.20-"Double", nr.30-"Suite", nr.40-"Panorama_Suite"
|
||||
|
@ -295,6 +315,17 @@ class Accounting():
|
|||
self.bill_status = True
|
||||
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):
|
||||
print("Rechnung wurde storniert.")
|
||||
|
@ -322,10 +353,14 @@ def show_single_bill():
|
|||
print(bill_list)
|
||||
while True:
|
||||
k = input("Rechnungsnummer? ")
|
||||
if k in bill_list:
|
||||
if k in bill_list or k == "abbrechen":
|
||||
break
|
||||
c = str(k) + ".show_bill()"
|
||||
exec(c)
|
||||
if k != "abbrechen":
|
||||
try:
|
||||
c = str(k) + ".show_bill()"
|
||||
exec(c)
|
||||
except:
|
||||
print("Rechnung wurde nicht gefunden.")
|
||||
|
||||
def pay_your_bill():
|
||||
print("Folgenden Rechnungsnummern stehen zur Auswahl:")
|
||||
|
@ -333,16 +368,19 @@ def pay_your_bill():
|
|||
print("Rechungsnummer? ")
|
||||
while True:
|
||||
bill =input().strip().lower()
|
||||
if bill in bill_list:
|
||||
if bill in bill_list or bill == "abbrechen":
|
||||
break
|
||||
c = str(bill) + ".pay_bill()"
|
||||
exec(c)
|
||||
|
||||
def delete_bill():
|
||||
input_ = input("Rechnungsnummer: ")
|
||||
delete = "del " + input_
|
||||
exec(delete)
|
||||
if bill != "abbrechen":
|
||||
try:
|
||||
c = str(bill) + ".pay_bill()"
|
||||
exec(c)
|
||||
except:
|
||||
print("Rechung wurde nicht gefunden.")
|
||||
|
||||
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)
|
||||
exec(j)
|
||||
#print(c0.info())
|
||||
clear()
|
||||
|
||||
|
||||
|
@ -399,11 +438,6 @@ except ModuleNotFoundError:
|
|||
imported = False
|
||||
|
||||
|
||||
|
||||
|
||||
import sys, time
|
||||
|
||||
|
||||
def play_sound():
|
||||
if imported:
|
||||
wave_obj = simpleaudio.WaveObject.from_wave_file\
|
||||
|
@ -417,29 +451,23 @@ def stop_sound(play_obj):
|
|||
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():
|
||||
with open('ascii_print_hotel', 'r', encoding='utf8') as ascii_:
|
||||
for line in ascii_:
|
||||
sys.stdout.write(line)
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
|
||||
input("Start?")
|
||||
clear()
|
||||
#Intro
|
||||
play_obj = play_sound()
|
||||
|
||||
#Logo Print
|
||||
ascii_print()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print("WELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
||||
input("Press enter to continue")
|
||||
clear()
|
||||
|
@ -457,7 +485,7 @@ Dienstpläne\n""")
|
|||
|
||||
print("Welches der folgenden Systeme möchten Sie öffnen?")
|
||||
system = input().strip().lower()
|
||||
if system in system_list:
|
||||
if system in system_list or system == "beenden":
|
||||
break
|
||||
else:
|
||||
clear()
|
||||
|
@ -486,12 +514,42 @@ Abbrechen
|
|||
if account == "1":
|
||||
print("Rechnung anzeigen\n")
|
||||
show_single_bill()
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
|
||||
if account == "2":
|
||||
print("Rechung bezahlen\n")
|
||||
pay_your_bill()
|
||||
input()
|
||||
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()
|
||||
break
|
||||
|
||||
|
@ -507,6 +565,11 @@ Abbrechen
|
|||
|
||||
if system == system_list[4]: #duty_roster
|
||||
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