//Event Handlers: private void RfidReader_TagReadEvent(object sender, EventArgsClasses.RfidEventArgs e) { switch (_state) { case LadeskabState.Available: // Check for ladeforbindelse if (_chargeControl.IsConnected()) { _door.LockDoor(); _chargeControl.StartCharge(); _oldId = e.Id; _display.CabinetOccupied(); _state = LadeskabState.Locked; _logFile.DoorLocked(e.Id); } else { //Display shows connection error _display.ConnectionError(); } break; case LadeskabState.DoorOpen: // Ignore break; case LadeskabState.Locked: // Check for correct ID if (e.Id == _oldId) { _chargeControl.StopCharge(); _door.UnlockDoor(); _logFile.DoorUnlocked(e.Id); // Display shows remove phone - message _display.RemovePhone(); _state = LadeskabState.Available; } else { //Display shows RFID-Error _display.RFIDError(); } break; } }