Skip to content

Instantly share code, notes, and snippets.

@Dracon23
Last active February 6, 2017 09:14
Show Gist options
  • Save Dracon23/cd0e9401d094216991babf712e899885 to your computer and use it in GitHub Desktop.
Save Dracon23/cd0e9401d094216991babf712e899885 to your computer and use it in GitHub Desktop.
def ErmittleMitarbeiterImBereich(ber_id):
imBereich = () # Leeres Dict/Array anlegen
proto_satz = leseProtokollsatz() # Lese den nächsten Protokollsatz ein
while proto_satz is not None: # Es existiert ein weiterer Protokollsatz, mach weiter
if proto_satz[2] == 'B' + str(ber_id): # Der Protokollsatz betrifft meinen Bereich, also...
if proto_satz[5] == 'Z': # ... schaue ich, ob es ein Zugang ist.
schreibeInArray(imBereich,proto_satz[3]) # Ist es, also schreibe ich den MA ins Array
elif proto_satz[5] == 'A': # Ist es nicht. Ist es ein Abgang?
löscheAusArray(imBereich,proto_satz[3]) # Ja, ist es, also löschen wir den MA aus dem Array
proto_satz = leseProtokollsatz() # Nächste Zeile abholen
return imBereich
@Dracon23
Copy link
Author

Dracon23 commented Feb 6, 2017

def ErmittleMitarbeiterImBereich(ber_id):

imBereich = ()																		# Leeres Dict/Array anlegen
proto_satz = leseProtokollsatz()													# Lese den nächsten Protokollsatz ein

while proto_satz is not None:														# Es existiert ein weiterer Protokollsatz, mach weiter
	if proto_satz[2] == 'B' + str(ber_id):											# Der Protokollsatz betrifft meinen Bereich, also...
		if proto_satz[4] == 'True':													# Erlaubnis erteilt!
			if proto_satz[5] == 'Z':													# ... schaue ich, ob es ein Zugang ist.
				schreibeInArray(imBereich,proto_satz[3])								# Ist es, also schreibe ich den MA ins Array
			elif proto_satz[5] == 'A':													# Ist es nicht. Ist es ein Abgang?
				löscheAusArray(imBereich,proto_satz[3])									# Ja, ist es, also löschen wir den MA aus dem Array
	proto_satz = leseProtokollsatz()												# Nächste Zeile abholen

return imBereich

@Dracon23
Copy link
Author

Dracon23 commented Feb 6, 2017

def ErmittleMitarbeiterImBereich(ber_id):

imBereich = ()																		# Leeres Dict/Array anlegen
proto_satz = leseProtokollsatz()													# Lese den nächsten Protokollsatz ein

while proto_satz is not None:														# Es existiert ein weiterer Protokollsatz, mach weiter
	if proto_satz[2] == 'B' + str(ber_id):											# Der Protokollsatz betrifft meinen Bereich, also...
		if proto_satz[4] == 'True':													# Erlaubnis erteilt!
			if proto_satz[5] == 'Z':													# ... schaue ich, ob es ein Zugang ist.
				schreibeInArray(imBereich,proto_satz[3])								# Ist es, also schreibe ich den MA ins Array
			elif proto_satz[5] == 'A':													# Ist es nicht. Ist es ein Abgang?
				löscheAusArray(imBereich,proto_satz[3])									# Ja, ist es, also löschen wir den MA aus dem Array
	proto_satz = leseProtokollsatz()												# Nächste Zeile abholen

print('In Bereich ' + str(ber_id) + ' sind folgende Mitarbeiter:)
for m_ID in imBereich:
	print(str(m_ID + ',\n'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment