Client test mit veränderter Kundenverwaltung.

This commit is contained in:
david_g 2021-02-03 17:08:52 +01:00
parent de127b18d4
commit 4abc71dd7b
1 changed files with 62 additions and 10 deletions

View File

@ -61,8 +61,8 @@ class Client():
Client.clients += 1
def check_in(self, room, key_num):
room_list[reference.index(room)].occupy(self.surname, self.period)
self.room = room
room_list[reference.index(str(room))].occupy(self.surname, self.period)
self.room = str(room)
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(self.surname) + "')"
try:
exec(num_)
@ -398,11 +398,38 @@ def clear():
def add_client():
name = input("Name : ")
surname = input("Nachname :")
while True:
name = input("Name : ")
if name.isalpha():
break
while True:
surname = input("Nachname :")
if surname.isalpha():
break
while True:
print("Aufenthaltszeitraum")
while True:
day_arrival = input("Anreisetag: ")
if day_arrival.isdigit() and 0 < int(day_arrival) and int(day_arrival) < 28:
break
while True:
month_arrival = input("Anreisemonat: ")
if month_arrival.isdigit() and 0 < int(month_arrival) and int(month_arrival) < 12:
break
while True:
day_depature = input("Abreisetag: ")
if day_depature.isdigit() and 0 < int(day_depature) and int(day_depature) < 28:
break
while True:
month_depature = input("Abreisemonat: ")
if month_depature.isdigit() and 0 < int(month_depature) and int(month_depature) < 12:
break
break
period = str(day_arrival) + "," +str(month_arrival) + "," + str(day_depature) + "," + str(month_depature)
print(period)
client_num = "c" + str(Client.clients)
room_num = None
period = input("Aufenthaltszeitraum :")
key_num = None
c = str(client_num) + " = Client(" + '"' + str(name) + '"' + "," + '"' + \
str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room_num) \
@ -497,7 +524,7 @@ Zimmerverwaltung
Schküsselverwaltung
Dienstpläne\n""")
"""-----------INTERFACE-----ACCOUNTING------------------"""
#"""-----------INTERFACE-----ACCOUNTING------------------"""
if system == system_list[0]: #Accounting
clear()
@ -555,7 +582,7 @@ Abbrechen
clear()
break
"""-----------INTERFACE-----CLIENT------------------"""
#"""-----------INTERFACE-----CLIENT------------------"""
if system == system_list[1]: #Client #bearbeitet ab hier
clear()
@ -579,24 +606,49 @@ Abbrechen
c = add_client()
exec(c)
clear()
continue
if client == "2":
print("Kunde anzeigen\n")
print(client_list)
while True:
k = input("Über welchen Kunden wollen sie sich Information anzeigen lassen? ")
if k in bill_list:
if k in client_list:
break
else:
print("Dieser Kunde ist leider nicht im System.")
c = str(k) + ".info()"
exec(c)
clear()
continue
if client == "3":
print("Kunde einchecken\n")
clear()
print("Welchen Kunden möchten Sie einchecken?")
print(client_list)
while True:
client = input()
if client in client_list:
break
while True:
print("Zimmernummer")
room_ = input()
if room_ in reference:
break
else:
print("Dieses Zimmer ist in unserem hotel leider nicht vorhanden.")
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
for i in room_types:
if i[0] == room_:
key_num = i[1]+1
print("Der Kunde erhält den Schlüssel", key_num)
check = str(client) + ".check_in(" + "'" + str(room_) + "'" + "," + str(key_num)+ ")"
print(check)
exec(check)
clear()
continue
if client == "4":
print("Zimmer wechseln\n")
clear()
@ -613,7 +665,7 @@ Abbrechen
clear()
break
"""-----------INTERFACE-----ROOM------------------"""
#"""-----------INTERFACE-----ROOM------------------"""
if system == system_list[2]: #Room
pass