Client_test 95% lauffähig. Alle Funktionen ausführbar. Problem bei Einchecken und passende Rechnung erstellen. Dienstplan wird automatisch in git Ordner erzeugt, wenn Dienstplan ertstellt oder exportiert.
This commit is contained in:
parent
864ae2768d
commit
470a1c2ae1
551
client_test.py
551
client_test.py
|
@ -2,6 +2,7 @@ import math
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import random
|
||||
|
||||
#----------------CLASS---KEY------------------------------------------
|
||||
|
||||
|
@ -11,17 +12,17 @@ class Key:
|
|||
# Initialisation of keys
|
||||
def __init__(self, keynumber):
|
||||
self.number = keynumber
|
||||
self.possessor = "Reception"
|
||||
self.possessor = "Rezeption"
|
||||
|
||||
#where are the keys
|
||||
def status_key(self, keynumber=None):
|
||||
return self.number, self.possessor
|
||||
print("Schlüssel", self.number, "im Besitz", self.possessor)
|
||||
|
||||
def hand_out_key(self, keynumber, Guest):
|
||||
self.possessor = Guest
|
||||
|
||||
def get_back_key(self, keynumber):
|
||||
self.possessor = "Reception"
|
||||
self.possessor = "Rezeption"
|
||||
|
||||
# Generates all the keys, two for each room
|
||||
# results in keynumbers: 11, 12, 21, 22, 31, 32, 41, 42
|
||||
|
@ -40,12 +41,16 @@ for i in range(11, 42, 10):
|
|||
|
||||
|
||||
#----------------CLASS---CLIENT------------------------------------------
|
||||
checked_in_list = []
|
||||
client_list = []
|
||||
all_clients = []
|
||||
|
||||
class Client():
|
||||
months = ['Januar', 'Februar','März','April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
|
||||
all_clients=[]
|
||||
|
||||
clients = 0
|
||||
def __init__(self, name: str, surname: str, client_num: str, room: str, period, key_num: int, bookings, status: bool):
|
||||
def __init__(self, name: str, surname: str, client_num: str, room: str, period, key_num: int, bookings, status: bool,\
|
||||
checked_in: bool):
|
||||
self.name = name
|
||||
self.surname = surname
|
||||
self.client_num = client_num
|
||||
|
@ -54,34 +59,16 @@ class Client():
|
|||
self.key_num = 0
|
||||
self.bookings = []
|
||||
self.status = False
|
||||
self.checked_in = checked_in
|
||||
|
||||
# Automatic status adjustment
|
||||
if len(self.bookings) >= 4:
|
||||
self.status = True
|
||||
Client.clients += 1
|
||||
|
||||
def check_in(self, room, key_num):
|
||||
def check_in(self, room, key_num, period):
|
||||
print("Check In")
|
||||
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)
|
||||
self.checked_in = True
|
||||
self.period = str(period)
|
||||
room_list[reference.index(str(room))].occupy(self.surname, self.period)
|
||||
self.room = str(room)
|
||||
|
@ -89,6 +76,11 @@ class Client():
|
|||
try:
|
||||
exec(num_)
|
||||
self.key_num = key_num
|
||||
checked_in_list.append(self.client_num)
|
||||
client_list.remove(str(self.client_num))
|
||||
if self.status == True:
|
||||
print("Der Kunde besitzt VIP Previlegien. Er erhält kostenloses \
|
||||
Frühstück sowie die kostenlose Benutzung der Mini-Bar.")
|
||||
except:
|
||||
("Schlüssel mit Daten nicht gefunden.")
|
||||
new_bill = add_bill(self.name, self.surname, self.client_num, room, self.period)
|
||||
|
@ -98,9 +90,16 @@ class Client():
|
|||
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.")
|
||||
self.checked_in = False
|
||||
self.room = None
|
||||
self.period = None
|
||||
self.key_num = None
|
||||
checked_in_list.remove(self.client_num)
|
||||
client_list.append(self.client_num)
|
||||
except:
|
||||
("Schlüssel mit Daten nicht gefunden.")
|
||||
|
||||
|
@ -114,21 +113,9 @@ class Client():
|
|||
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)
|
||||
num_ = "key_" + str(key_num) + ".hand_out_key(" + str(key_num) + "," + "'" + str(surname) + "')"
|
||||
try:
|
||||
exec(num_)
|
||||
self.key_num = key_num
|
||||
except:
|
||||
("Schlüssel mit Daten nicht gefunden.")
|
||||
|
||||
|
||||
def name_change(self, name, surname):
|
||||
self.name = name
|
||||
self.surname = surname
|
||||
|
||||
def vip_status(self):
|
||||
if len(self.bookings) > 3:
|
||||
self.status = True
|
||||
# Length of stay as print
|
||||
def period_print(self):
|
||||
stay_period = []
|
||||
|
@ -177,7 +164,8 @@ class Client():
|
|||
"Aufenthaltsdauer": self.period,
|
||||
"Schlüsselnummer" : self.key_num,
|
||||
"Buchungen" : self.bookings,
|
||||
"VIP-Status" : self.status
|
||||
"VIP-Status" : self.status,
|
||||
"Eingecheckt" : self.checked_in
|
||||
}
|
||||
if action != None:
|
||||
# If asked client information is stay period
|
||||
|
@ -225,7 +213,7 @@ class Room:
|
|||
self.resident = None
|
||||
self.period = None
|
||||
|
||||
def is_free(self, client_num, room_name):
|
||||
def is_free(self, client_num, room_name, period):
|
||||
|
||||
occupied = self.period
|
||||
if occupied == None:
|
||||
|
@ -233,12 +221,68 @@ class Room:
|
|||
for i in room_types:
|
||||
if i[0] == room_name:
|
||||
key_num = i[1]+1
|
||||
print("Der Kunde erhält den Schlüssel", key_num)
|
||||
#print("Der Kunde erhält den Schlüssel", key_num)
|
||||
|
||||
check = str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)+ ")"
|
||||
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
||||
+ "," + "'" + str(period) + "'" +"))"
|
||||
print(check)
|
||||
exec(check)
|
||||
|
||||
else:
|
||||
stay_period = []
|
||||
num_string = ""
|
||||
for i in self.period:
|
||||
if i.isnumeric():
|
||||
num_string += i
|
||||
if i == ",":
|
||||
stay_period.append(num_string)
|
||||
num_string = ""
|
||||
|
||||
stay_period.append(num_string)
|
||||
|
||||
stay_period_new = []
|
||||
num_string = ""
|
||||
for i in period:
|
||||
if i.isnumeric():
|
||||
num_string += i
|
||||
if i == ",":
|
||||
stay_period_new.append(num_string)
|
||||
num_string = ""
|
||||
|
||||
stay_period_new.append(num_string)
|
||||
#print(stay_period, stay_period_new)
|
||||
|
||||
if int(stay_period[3]) < int(stay_period_new[1]):
|
||||
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
||||
for i in room_types:
|
||||
if i[0] == room_name:
|
||||
key_num = i[1]+1
|
||||
#print("Der Kunde erhält den Schlüssel", key_num)
|
||||
|
||||
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
||||
+ "," + "'" + str(period) + "'" +"))"
|
||||
print(check)
|
||||
exec(check)
|
||||
|
||||
|
||||
if int(stay_period[3]) > int(stay_period_new[1]):
|
||||
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
||||
|
||||
if int(stay_period[3]) == int(stay_period_new[1]):
|
||||
if int(stay_period[0]) > int(stay_period_new[2]):
|
||||
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
||||
|
||||
if int(stay_period[0]) <= int(stay_period_new[2]):
|
||||
room_types = [["Single", 10], ["Double", 20], ["Suite", 30], ["Panorama_Suite", 40]]
|
||||
for i in room_types:
|
||||
if i[0] == room_name:
|
||||
key_num = i[1]+1
|
||||
#print("Der Kunde erhält den Schlüssel", key_num)
|
||||
|
||||
check = "exec(" + str(client_num) + ".check_in(" + "'" + str(room_name) + "'" + "," + str(key_num)\
|
||||
+ "," + "'" + str(period) + "'" +"))"
|
||||
print(check)
|
||||
exec(check)
|
||||
|
||||
|
||||
|
||||
|
@ -269,15 +313,20 @@ class Room:
|
|||
stay_period_new.append(num_string)
|
||||
#print(stay_period, stay_period_new)
|
||||
|
||||
if int(stay_period[3]) < int(stay_period_new[3]):
|
||||
if int(stay_period[3]) < int(stay_period_new[1]):
|
||||
print(stay_period[3], stay_period_new[1])
|
||||
print("Das Zimmer", room_name, "ist in dem gewünschten Zeitraum frei.")
|
||||
if int(stay_period[3]) > int(stay_period_new[3]):
|
||||
|
||||
if int(stay_period[3]) > int(stay_period_new[1]):
|
||||
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
||||
if int(stay_period[3]) == int(stay_period_new[3]):
|
||||
if int(stay_period[2]) > int(stay_period_new[2]):
|
||||
|
||||
if int(stay_period[3]) == int(stay_period_new[1]):
|
||||
if int(stay_period[2]) > int(stay_period_new[0]):
|
||||
print("Das Zimmer", room_name, " ist in dem gewünschten Zeitraum belegt.")
|
||||
if int(stay_period[2]) <= int(stay_period_new[2]):
|
||||
print("Das Zimmer", room_name, "ist in dem gewünschten Zeitraum belegt.")
|
||||
#print(stay_period[2], stay_period_new[0])
|
||||
if int(stay_period[2]) <= int(stay_period_new[0]):
|
||||
print("Das Zimmer", room_name, "ist in dem gewünschten Zeitraum frei.")
|
||||
#print(stay_period[2], stay_period_new[0])
|
||||
|
||||
# room information
|
||||
def info(self, action = None):
|
||||
|
@ -287,13 +336,13 @@ class Room:
|
|||
|
||||
if action != None:
|
||||
if action == "Nummer":
|
||||
print("Das Zimmer" + str(self.number) + "hat die Nummer" + dic_["Nummer"])
|
||||
print("Das Zimmer hat die Nummer", dic_["Nummer"])
|
||||
|
||||
if action == "Gast":
|
||||
if dic_["Gast"] != None:
|
||||
print("Das Zimmer" + str(self.number) + "ist gerade vom Gast" + dic_["Gast"] + "belegt")
|
||||
print("Das Zimmer", str(self.number), "ist gerade vom Gast", dic_["Gast"], "belegt")
|
||||
else:
|
||||
print("Das Zimmer" + str(self.number) + "ist im Moment nicht belegt.")
|
||||
print("Das Zimmer", str(self.number), "ist im Moment nicht belegt.")
|
||||
|
||||
else:
|
||||
for i in dic_:
|
||||
|
@ -392,15 +441,11 @@ class Accounting():
|
|||
print("Rechnung", self.bill_num, "wurde bezahlt.")
|
||||
|
||||
def delete_bill(self, bill_num):
|
||||
for i in client_list:
|
||||
for i in all_clients:
|
||||
var = str(i) + ".client_bill_delete(" + "'" + bill_num + "'" + ")"
|
||||
#print(var)
|
||||
exec(var)
|
||||
var = str(i) + ".check_out()"
|
||||
#print(var)
|
||||
exec(var)
|
||||
|
||||
|
||||
var_ = str(i) + ".check_out()"
|
||||
exec(var_)
|
||||
|
||||
|
||||
def __del__(self):
|
||||
|
@ -460,9 +505,10 @@ def delete_bill(bill_numb):
|
|||
|
||||
|
||||
|
||||
|
||||
#-------------ADDITIONAL---CLIENT---METHODS-------------------------
|
||||
|
||||
client_list = []
|
||||
|
||||
|
||||
def clear():
|
||||
if os.name == "posix":
|
||||
|
@ -489,28 +535,23 @@ def add_client():
|
|||
key_num = None
|
||||
c = str(client_num) + " = Client(" + '"' + str(name) + '"' + "," + '"' + \
|
||||
str(surname) + '"' + "," + '"' + str(client_num) + '"' + "," + '"' + str(room_num) \
|
||||
+ '"' + "," + '"' + str(period) + '"' + "," + '"'+ str(key_num) + '"' + ",[], False)"
|
||||
print(c)
|
||||
+ '"' + "," + '"' + str(period) + '"' + "," + '"'+ str(key_num) + '"' + ",[], False, False)"
|
||||
#print(c)
|
||||
client_list.append(client_num)
|
||||
all_clients.append(client_num)
|
||||
return c
|
||||
|
||||
|
||||
k = add_client()
|
||||
exec(k)
|
||||
|
||||
j = c0.check_in("Suite",31)
|
||||
j = c0.check_in("Suite",31, "2,3,4,5")
|
||||
exec(j)
|
||||
#print(c0.info())
|
||||
clear()
|
||||
|
||||
|
||||
|
||||
system_list = ["buchhaltung", "kundenverwaltung", "zimmerverfaltung", "schlüsselverwaltung", "dienstpläne", "b", "k", "z", "s", "d"]
|
||||
|
||||
|
||||
|
||||
"""-------------START-----INTERFACE--------------------"""
|
||||
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
|
@ -541,7 +582,8 @@ def ascii_print():
|
|||
time.sleep(0.1)
|
||||
|
||||
|
||||
|
||||
system_list = ["1", "2", "3", "4", "5"]
|
||||
"""-------------START-----INTERFACE--------------------"""
|
||||
input("Start?")
|
||||
clear()
|
||||
#Intro
|
||||
|
@ -551,21 +593,19 @@ play_obj = play_sound()
|
|||
ascii_print()
|
||||
|
||||
|
||||
print("WELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
||||
input("Press enter to continue")
|
||||
print("\t\tWELCOME TO THE GRAND BUDAPEST HOTEL SYSTEM")
|
||||
input("\t\t\tPress enter to continue")
|
||||
clear()
|
||||
|
||||
while True:
|
||||
print("Im System stehen Ihnen verschiedene Funktionen zur Verfügung.\n")
|
||||
|
||||
print("""
|
||||
1.Buchhaltung
|
||||
2.Kundenverwaltung
|
||||
3.Zimmerverwaltung
|
||||
4.Schlüsselverwaltung
|
||||
5.Dienstpläne\n""")
|
||||
while True:
|
||||
print("""
|
||||
Buchhaltung
|
||||
Kundenverwaltung
|
||||
Zimmerverwaltung
|
||||
Schlüsselverwaltung
|
||||
Dienstpläne\n""")
|
||||
|
||||
print("Welches der folgenden Systeme möchten Sie öffnen?")
|
||||
system = input().strip().lower()
|
||||
if system in system_list or system == "beenden":
|
||||
|
@ -574,15 +614,15 @@ Dienstpläne\n""")
|
|||
clear()
|
||||
print("Bitte wählen Sie aus einem der bestehenden Systeme aus.")
|
||||
print("""
|
||||
Buchhaltung
|
||||
Kundenverwaltung
|
||||
Zimmerverwaltung
|
||||
Schküsselverwaltung
|
||||
Dienstpläne\n""")
|
||||
1.Buchhaltung
|
||||
2.Kundenverwaltung
|
||||
3.Zimmerverwaltung
|
||||
4.Schlüsselverwaltung
|
||||
5.Dienstpläne\n""")
|
||||
|
||||
#"""-----------INTERFACE-----ACCOUNTING------------------"""
|
||||
|
||||
if system == system_list[0]: #Accounting
|
||||
if system == "1": #Accounting
|
||||
clear()
|
||||
|
||||
while True:
|
||||
|
@ -626,10 +666,14 @@ Abbrechen
|
|||
else:
|
||||
delete_bill(bill_numb) # Delete bill at client
|
||||
|
||||
bill_list.remove(bill_numb) # Delete bill at bill_list
|
||||
|
||||
delete_ = "del " + bill_numb
|
||||
exec(delete_) # Delete bill in system
|
||||
|
||||
bill_list.remove(bill_numb) # Delete bill at bill_list
|
||||
####
|
||||
#Kunde auschecken
|
||||
####
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
|
@ -640,48 +684,62 @@ Abbrechen
|
|||
|
||||
#"""-----------INTERFACE-----CLIENT------------------"""
|
||||
|
||||
if system == system_list[1]: #Client #bearbeitet ab hier
|
||||
if system == "2": #Client
|
||||
clear()
|
||||
while True:
|
||||
|
||||
print("Willkommen in der Kundenverwaltung")
|
||||
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
||||
print("""
|
||||
print("Willkommen in der Kundenverwaltung")
|
||||
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
||||
print("""
|
||||
1. Kunde hinzufügen
|
||||
2. Kunde anzeigen
|
||||
3. Kunde einchecken
|
||||
4. Zimmer wechseln
|
||||
5. Name ändern
|
||||
6. Kunde auschecken (fehlt noch!)
|
||||
4. Kunde auschecken
|
||||
5. Freie Zimmer über Zeitraum anzeigen.
|
||||
Abbrechen
|
||||
|
||||
""")
|
||||
|
||||
client = input().strip().lower()
|
||||
if client == "1":
|
||||
print("Kunde hinzufügen\n")
|
||||
c = add_client()
|
||||
exec(c)
|
||||
clear()
|
||||
continue
|
||||
client = input().strip().lower()
|
||||
if client == "1":
|
||||
print("Kunde hinzufügen\n")
|
||||
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 client_list:
|
||||
break
|
||||
else:
|
||||
print("Dieser Kunde ist leider nicht im System.")
|
||||
c = str(k) + ".info()"
|
||||
exec(c)
|
||||
clear()
|
||||
continue
|
||||
if client == "2":
|
||||
print("Kunde anzeigen\n")
|
||||
print(all_clients)
|
||||
while True:
|
||||
k = input("Über welchen Kunden wollen sie sich Information anzeigen lassen? ")
|
||||
if k in all_clients:
|
||||
break
|
||||
else:
|
||||
print("Dieser Kunde ist leider nicht im System.")
|
||||
c = str(k) + ".info()"
|
||||
exec(c)
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
|
||||
if client == "3":
|
||||
print("Kunde einchecken\n")
|
||||
while True:
|
||||
print("In welchem Zeitraum möchten Sie schauen, ob Zimmer frei sind?")
|
||||
if client == "3":
|
||||
print("Kunde einchecken\n")
|
||||
print("Welchen Kunden möchten Sie einchecken?")
|
||||
|
||||
print(client_list)
|
||||
while True:
|
||||
client = input()
|
||||
if client in client_list:
|
||||
break
|
||||
while True:
|
||||
print(reference)
|
||||
print("Zimmerauswahl")
|
||||
room_ = input()
|
||||
if room_ in reference:
|
||||
break
|
||||
else:
|
||||
print("Dieses Zimmer ist in unserem Hotel leider nicht vorhanden.")
|
||||
print("Aufenthaltszeitraum")
|
||||
while True:
|
||||
day_arrival = input("Anreisetag: ")
|
||||
|
@ -701,65 +759,225 @@ Abbrechen
|
|||
break
|
||||
|
||||
period = str(day_arrival) + "," +str(month_arrival) + "," + str(day_depature) + "," + str(month_depature)
|
||||
#print(period)
|
||||
for i in reference:
|
||||
k = str(i) + ".is_occupied(" + "'" + str(i) + "'" + "," + "'" + str(period) + "'" + ")"
|
||||
#print(k)
|
||||
exec(k)
|
||||
|
||||
print("Welchen Kunden möchten Sie einchecken?")
|
||||
print(client_list)
|
||||
while True:
|
||||
client = input()
|
||||
if client in client_list:
|
||||
break
|
||||
while True:
|
||||
print("Zimmer")
|
||||
room_ = input()
|
||||
if room_ in reference:
|
||||
break
|
||||
else:
|
||||
print("Dieses Zimmer ist in unserem Hotel leider nicht vorhanden.")
|
||||
check_ = str(room_) + ".is_free(" + "'" + str(client) + "'" + "," + "'" + str(room_) \
|
||||
+ "'" + "," + "'" + str(period) + "'" + ")"
|
||||
print(check_)
|
||||
exec(check_)
|
||||
|
||||
|
||||
clear()
|
||||
continue
|
||||
|
||||
#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)
|
||||
if client == "4":
|
||||
print("Auschecken\n")
|
||||
print("Welchen Gast möchten Sie auschecken?")
|
||||
print(checked_in_list)
|
||||
while True:
|
||||
client = input()
|
||||
if client in checked_in_list:
|
||||
checking_out = str(client) + ".check_out()"
|
||||
exec(checking_out)
|
||||
break
|
||||
if client == "abbrechen":
|
||||
break
|
||||
|
||||
#check = str(client) + ".check_in(" + "'" + str(room_) + "'" + "," + str(key_num)+ ")"
|
||||
#print(check)
|
||||
#exec(check)
|
||||
clear()
|
||||
continue
|
||||
if client == "4":
|
||||
print("Zimmer wechseln\n")
|
||||
clear()
|
||||
|
||||
if client == "5":
|
||||
print("Name ändern\n")
|
||||
clear()
|
||||
clear()
|
||||
continue
|
||||
|
||||
if client == "6":
|
||||
print("Kunde auschecken\n")
|
||||
clear()
|
||||
|
||||
else:
|
||||
clear()
|
||||
break
|
||||
if client == "5":
|
||||
print("Freie Zimmer anzeigen\n")
|
||||
while True:
|
||||
print("In welchem Zeitraum möchten Sie schauen, ob Zimmer frei sind?")
|
||||
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
|
||||
|
||||
period = str(day_arrival) + "," +str(month_arrival) + "," + str(day_depature) + "," + str(month_depature)
|
||||
#print(period)
|
||||
for i in reference:
|
||||
k = str(i) + ".is_occupied(" + "'" + str(i) + "'" + "," + "'" + str(period) + "'" + ")"
|
||||
#print(k)
|
||||
exec(k)
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
|
||||
if client == "abbrechen":
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
|
||||
#"""-----------INTERFACE-----ROOM------------------"""
|
||||
|
||||
if system == system_list[2]: #Room
|
||||
pass
|
||||
if system == "3": #Room
|
||||
clear()
|
||||
while True:
|
||||
print("\nWillkommen in der Zimmerverwaltung")
|
||||
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
||||
print("""
|
||||
1. Zimmerstatus anzeigen
|
||||
Abbrechen
|
||||
""")
|
||||
|
||||
room_input = input().strip().lower()
|
||||
if room_input == "1":
|
||||
while True:
|
||||
print("Zimmerstatus anzeigen\n")
|
||||
print(reference)
|
||||
print("Name des Zimmers:")
|
||||
dorm = input()
|
||||
if dorm in reference:
|
||||
print("""
|
||||
1. Ale Informationen
|
||||
2. Nummer
|
||||
3.Gast""")
|
||||
|
||||
dorm_info = input()
|
||||
if dorm_info == "1":
|
||||
print("Zimmer:", dorm)
|
||||
dorm_exec = str(dorm) + ".info()"
|
||||
exec(dorm_exec)
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
if dorm_info == "2":
|
||||
print("Zimmer:", dorm)
|
||||
dorm_exec = str(dorm) + ".info("+ "'Nummer'" +")"
|
||||
exec(dorm_exec)
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
if dorm_info == "3":
|
||||
print("Zimmer:", dorm)
|
||||
dorm_exec = str(dorm) + ".info("+ "'Gast'" +")"
|
||||
exec(dorm_exec)
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
if dorm_info == "abbrechen":
|
||||
clear()
|
||||
break
|
||||
|
||||
if room_input == "abbrechen":
|
||||
clear()
|
||||
break
|
||||
|
||||
|
||||
if system == "4": #Key
|
||||
clear()
|
||||
while True:
|
||||
print("Willkommen in der Schlüsselverwaltung")
|
||||
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
||||
print("""
|
||||
1. Schlüsselstatus anzeigen
|
||||
Abbrechen""")
|
||||
|
||||
key_input = input().strip().lower()
|
||||
if key_input == "1":
|
||||
while True:
|
||||
print("Schlüsselstatus anzeigen\n")
|
||||
all_key_numbers = ["11", "12", "21", "22", "31", "32", "41", "42"]
|
||||
print(all_key_numbers)
|
||||
key_num = input("Schlüsselnummer ")
|
||||
print("")
|
||||
if key_num in all_key_numbers:
|
||||
key_print = "key_" + key_num + ".status_key()"
|
||||
exec(key_print)
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
if key_num == "abbrechen":
|
||||
clear()
|
||||
break
|
||||
else:
|
||||
print("Was ist schief gelaufen")
|
||||
if key_input == "abbrechen":
|
||||
clear()
|
||||
break
|
||||
|
||||
if system == "5": #duty_roster
|
||||
clear()
|
||||
def duty_roster_write():
|
||||
with open('dienstplan.txt', 'w', encoding='utf8') as d:
|
||||
employees = ['M. Gustave', 'Zero Mustafa', 'M. Jean', 'Agatha', 'M. Chuck']
|
||||
job = ['Concierge', 'Lobby-Boy', 'Rezeptionist', 'Portier']
|
||||
i = 1
|
||||
while i < 53:
|
||||
random.shuffle(employees)
|
||||
random.shuffle(job)
|
||||
a = "KW" + str(i)
|
||||
d.write(a + "#" + employees[0] + ": " + job[0] + "#" + employees[1]\
|
||||
+ ": " + job[1] + "#" + employees[2] + ": " + job[2] + "#" + employees[3] + ": " \
|
||||
+ job[3] + "#" + "frei: " + employees[4] + "\n")
|
||||
i += 1
|
||||
|
||||
def duty_roster_read():
|
||||
with open('dienstplan.txt', 'r', encoding='utf8') as d:
|
||||
for line in d:
|
||||
print(line)
|
||||
|
||||
while True:
|
||||
print("\nWillkommen dei den Dienstplänen")
|
||||
print("Welche der folgenen Aktionen möchten Sie ausführen")
|
||||
print("""
|
||||
1. Dienstplan erstellen und anzeigen
|
||||
2. Dienstplan exportieren
|
||||
3. Dienstplan importieren
|
||||
Abbrechen""")
|
||||
|
||||
duty = input().strip().lower()
|
||||
if duty == "1":
|
||||
try:
|
||||
duty_roster_write()
|
||||
duty_roster_read()
|
||||
except:
|
||||
print("Es konnte kein Dienstplan erstellt werden.")
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
if duty == "2":
|
||||
try:
|
||||
duty_roster_write()
|
||||
print("Der Dienstplan wurde erfolgreich exportiert.")
|
||||
except:
|
||||
print("Der Diensplan konnte nicht exportiert werden.")
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
if duty == "3":
|
||||
try:
|
||||
duty_roster_read()
|
||||
except:
|
||||
print("Es konnte kein Dienstplan unter dem Namen \
|
||||
dienstplan.txt im Verzeichnis gefunden werden.")
|
||||
input()
|
||||
clear()
|
||||
continue
|
||||
if duty == "abbrechen":
|
||||
input()
|
||||
clear()
|
||||
break
|
||||
|
||||
|
||||
|
||||
if system == system_list[3]: #Key
|
||||
pass
|
||||
|
||||
if system == system_list[4]: #duty_roster
|
||||
pass
|
||||
if system == "beenden":
|
||||
clear()
|
||||
print("The Grand Budapest Hotel wünscht noch einen angenehmen Tag.")
|
||||
|
@ -778,3 +996,4 @@ Abbrechen
|
|||
|
||||
|
||||
#break
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
KW1#Zero Mustafa: Lobby-Boy#M. Jean: Rezeptionist#M. Chuck: Concierge#M. Gustave: Portier#frei: Agatha
|
||||
KW2#M. Jean: Concierge#Agatha: Rezeptionist#Zero Mustafa: Lobby-Boy#M. Gustave: Portier#frei: M. Chuck
|
||||
KW3#M. Jean: Rezeptionist#M. Gustave: Lobby-Boy#Zero Mustafa: Concierge#M. Chuck: Portier#frei: Agatha
|
||||
KW4#M. Gustave: Portier#Zero Mustafa: Concierge#Agatha: Lobby-Boy#M. Jean: Rezeptionist#frei: M. Chuck
|
||||
KW5#M. Gustave: Concierge#Agatha: Portier#M. Chuck: Rezeptionist#M. Jean: Lobby-Boy#frei: Zero Mustafa
|
||||
KW6#Zero Mustafa: Portier#Agatha: Rezeptionist#M. Chuck: Concierge#M. Jean: Lobby-Boy#frei: M. Gustave
|
||||
KW7#Agatha: Rezeptionist#M. Jean: Concierge#Zero Mustafa: Portier#M. Chuck: Lobby-Boy#frei: M. Gustave
|
||||
KW8#M. Chuck: Lobby-Boy#M. Jean: Portier#Zero Mustafa: Rezeptionist#M. Gustave: Concierge#frei: Agatha
|
||||
KW9#M. Chuck: Concierge#Zero Mustafa: Rezeptionist#M. Gustave: Lobby-Boy#Agatha: Portier#frei: M. Jean
|
||||
KW10#M. Chuck: Concierge#M. Gustave: Portier#Agatha: Lobby-Boy#M. Jean: Rezeptionist#frei: Zero Mustafa
|
||||
KW11#Zero Mustafa: Rezeptionist#M. Gustave: Concierge#Agatha: Portier#M. Chuck: Lobby-Boy#frei: M. Jean
|
||||
KW12#M. Chuck: Concierge#Agatha: Portier#M. Gustave: Rezeptionist#Zero Mustafa: Lobby-Boy#frei: M. Jean
|
||||
KW13#M. Chuck: Rezeptionist#Agatha: Lobby-Boy#Zero Mustafa: Portier#M. Jean: Concierge#frei: M. Gustave
|
||||
KW14#Agatha: Portier#M. Chuck: Lobby-Boy#M. Gustave: Concierge#Zero Mustafa: Rezeptionist#frei: M. Jean
|
||||
KW15#Zero Mustafa: Lobby-Boy#M. Gustave: Portier#Agatha: Concierge#M. Jean: Rezeptionist#frei: M. Chuck
|
||||
KW16#M. Jean: Lobby-Boy#M. Chuck: Rezeptionist#M. Gustave: Concierge#Zero Mustafa: Portier#frei: Agatha
|
||||
KW17#Agatha: Portier#M. Gustave: Lobby-Boy#M. Chuck: Rezeptionist#Zero Mustafa: Concierge#frei: M. Jean
|
||||
KW18#Zero Mustafa: Rezeptionist#M. Jean: Concierge#M. Chuck: Lobby-Boy#Agatha: Portier#frei: M. Gustave
|
||||
KW19#Agatha: Rezeptionist#M. Gustave: Portier#M. Chuck: Concierge#Zero Mustafa: Lobby-Boy#frei: M. Jean
|
||||
KW20#M. Chuck: Lobby-Boy#Agatha: Rezeptionist#M. Gustave: Concierge#M. Jean: Portier#frei: Zero Mustafa
|
||||
KW21#Zero Mustafa: Rezeptionist#Agatha: Portier#M. Gustave: Lobby-Boy#M. Chuck: Concierge#frei: M. Jean
|
||||
KW22#Zero Mustafa: Rezeptionist#M. Chuck: Concierge#M. Jean: Portier#M. Gustave: Lobby-Boy#frei: Agatha
|
||||
KW23#M. Chuck: Lobby-Boy#M. Gustave: Rezeptionist#M. Jean: Portier#Zero Mustafa: Concierge#frei: Agatha
|
||||
KW24#M. Gustave: Concierge#Zero Mustafa: Rezeptionist#Agatha: Lobby-Boy#M. Jean: Portier#frei: M. Chuck
|
||||
KW25#M. Gustave: Concierge#Agatha: Rezeptionist#M. Jean: Portier#Zero Mustafa: Lobby-Boy#frei: M. Chuck
|
||||
KW26#Zero Mustafa: Lobby-Boy#M. Chuck: Portier#M. Jean: Concierge#M. Gustave: Rezeptionist#frei: Agatha
|
||||
KW27#M. Chuck: Rezeptionist#Agatha: Portier#Zero Mustafa: Lobby-Boy#M. Jean: Concierge#frei: M. Gustave
|
||||
KW28#Agatha: Portier#M. Gustave: Lobby-Boy#Zero Mustafa: Concierge#M. Chuck: Rezeptionist#frei: M. Jean
|
||||
KW29#M. Jean: Portier#M. Gustave: Concierge#Zero Mustafa: Lobby-Boy#Agatha: Rezeptionist#frei: M. Chuck
|
||||
KW30#Agatha: Rezeptionist#M. Gustave: Concierge#M. Chuck: Lobby-Boy#M. Jean: Portier#frei: Zero Mustafa
|
||||
KW31#M. Chuck: Portier#M. Jean: Concierge#Agatha: Rezeptionist#M. Gustave: Lobby-Boy#frei: Zero Mustafa
|
||||
KW32#M. Jean: Lobby-Boy#M. Gustave: Portier#Zero Mustafa: Rezeptionist#M. Chuck: Concierge#frei: Agatha
|
||||
KW33#M. Jean: Lobby-Boy#Zero Mustafa: Portier#M. Gustave: Concierge#M. Chuck: Rezeptionist#frei: Agatha
|
||||
KW34#Zero Mustafa: Lobby-Boy#M. Gustave: Concierge#M. Chuck: Portier#Agatha: Rezeptionist#frei: M. Jean
|
||||
KW35#M. Chuck: Rezeptionist#Zero Mustafa: Concierge#M. Gustave: Portier#M. Jean: Lobby-Boy#frei: Agatha
|
||||
KW36#Zero Mustafa: Rezeptionist#M. Chuck: Portier#M. Gustave: Lobby-Boy#M. Jean: Concierge#frei: Agatha
|
||||
KW37#M. Gustave: Rezeptionist#Zero Mustafa: Lobby-Boy#M. Jean: Concierge#Agatha: Portier#frei: M. Chuck
|
||||
KW38#M. Chuck: Rezeptionist#M. Gustave: Portier#M. Jean: Concierge#Zero Mustafa: Lobby-Boy#frei: Agatha
|
||||
KW39#Agatha: Rezeptionist#M. Jean: Lobby-Boy#Zero Mustafa: Portier#M. Gustave: Concierge#frei: M. Chuck
|
||||
KW40#M. Gustave: Lobby-Boy#Zero Mustafa: Portier#Agatha: Concierge#M. Chuck: Rezeptionist#frei: M. Jean
|
||||
KW41#Zero Mustafa: Concierge#Agatha: Portier#M. Chuck: Lobby-Boy#M. Jean: Rezeptionist#frei: M. Gustave
|
||||
KW42#M. Chuck: Portier#M. Jean: Rezeptionist#Agatha: Concierge#M. Gustave: Lobby-Boy#frei: Zero Mustafa
|
||||
KW43#M. Gustave: Portier#M. Jean: Rezeptionist#Zero Mustafa: Concierge#M. Chuck: Lobby-Boy#frei: Agatha
|
||||
KW44#Agatha: Concierge#M. Chuck: Portier#M. Gustave: Lobby-Boy#M. Jean: Rezeptionist#frei: Zero Mustafa
|
||||
KW45#Zero Mustafa: Portier#M. Gustave: Lobby-Boy#M. Jean: Rezeptionist#M. Chuck: Concierge#frei: Agatha
|
||||
KW46#Zero Mustafa: Concierge#M. Jean: Lobby-Boy#M. Chuck: Portier#M. Gustave: Rezeptionist#frei: Agatha
|
||||
KW47#M. Gustave: Concierge#M. Chuck: Rezeptionist#Zero Mustafa: Portier#M. Jean: Lobby-Boy#frei: Agatha
|
||||
KW48#M. Gustave: Portier#Zero Mustafa: Rezeptionist#M. Jean: Concierge#M. Chuck: Lobby-Boy#frei: Agatha
|
||||
KW49#Agatha: Rezeptionist#M. Gustave: Lobby-Boy#M. Chuck: Concierge#Zero Mustafa: Portier#frei: M. Jean
|
||||
KW50#Agatha: Concierge#M. Jean: Lobby-Boy#M. Gustave: Portier#Zero Mustafa: Rezeptionist#frei: M. Chuck
|
||||
KW51#M. Jean: Portier#Agatha: Rezeptionist#Zero Mustafa: Lobby-Boy#M. Gustave: Concierge#frei: M. Chuck
|
||||
KW52#Zero Mustafa: Lobby-Boy#Agatha: Rezeptionist#M. Jean: Portier#M. Chuck: Concierge#frei: M. Gustave
|
Loading…
Reference in New Issue