Beispiel #1
0
 public void RequestEntry(int id)
 {
     if (_userValidation.ValidateEntryRequest(id))
     {
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
 }
Beispiel #2
0
 public void RequestEntry(int id)
 {
     if (_validation.ValidateEntryReuest(id))
     {
         _door.Open();
         _state = DoorState.Opening;
         _entry.NotifyEntryGranted();
     }
 }
Beispiel #3
0
 public void RequestEntry(string id)
 {
     if (_userValidation.ValidateEntryRequest(id) == true)
     {
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         _entryNotification.NofifyEntryDenied();
     }
 }
Beispiel #4
0
 public void RequestEntry(string id)
 {
     if (_userValidation.ValidateEntryRequest(id))
     {
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         // not implemented yet, part exercise 4
     }
 }
Beispiel #5
0
 public void RequestEntry(int id)
 {
     _valid = _user.ValidateEntryRequest(id);
     if (_valid)
     {
         _door.Open();
         _noti.NotifyEntryGranted();
     }
     else
     {
         _noti.NotifyEntryDenied();
     }
 }
 public void RequestEntry(int id)
 {
     if (_userValidation.ValidateEntryRequest(id) && _currentState == DoorState.Closed)
     {
         _currentState = DoorState.Opening;
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         _entryNotification.NotifyEntryDenied();
     }
 }
Beispiel #7
0
 public void RequestEntry(string id)
 {
     if (_uv.ValidateEntryRequest(id) == true)
     {
         _door.Open();
         _en.NotifyEntryGranted();
         CurrentDoorState = true;
     }
     else if (_uv.ValidateEntryRequest(id) == false)
     {
         _en.NotifyEntryDenied();
     }
 }
Beispiel #8
0
        public void RequestEntry(string id)
        {
            var idStatus = _userValidation.ValidateEntryRequest(id);

            if (idStatus) //svarer til idStatus==true
            {
                _door.Open();
                _entryNotification.NotifyEntryGranted();
            }
            else
            {
                _entryNotification.NotifyEntryDenied();
            }
        }
        public void RequestEntry(int id)
        {
            bool messagEntryRequest = _userValidation.ValidateEntryRequest(id);

            if (messagEntryRequest == true)
            {
                _door.Open();
                _entryNotification.NotifyEntryGranted(id);
            }
            else
            {
                Console.WriteLine("Access denied!!!");
            }
        }
 public void RequestEntry(int id)
 {
     //User validation
     if (_validation.ValidateEntryRequest(id))
     {
         _state = States.DoorOpening;
         _entryNotification.NotifyEntryGranted(id);
         _door.Open();
     }
     else
     {
         _entryNotification.NotifyEntryDenied(id);
     }
 }
Beispiel #11
0
        public void RequestEntry(int id)
        {
            if (_state.State != DoorControlState.DoorClosed)
            {
                throw new ArgumentException("Invalid state to call in");
            }

            if (_UserValidation.ValidateEntryRequest(id))
            {
                _door.Open();
                _entryNotify.NotifyEntryGranted();
                _state.State = DoorControlState.DoorOpening;
            }
            else
            {
                _entryNotify.NotifyEntryDenied();
            }
        }
Beispiel #12
0
 public void RequestEntry(string id)
 {
     switch (_doorState)
     {
     case State.DoorClosed:
         if (_userValidation.ValidateEntryRequest(id) == true)
         {
             _door.Open();
             _entryNotification.NotifyEntryGranted();
             _doorState = State.DoorOpening;
         }
         else
         {
             _entryNotification.NotifyEntryDenied();
         }
         break;
     }
 }
        public void RequestEntry(String id)
        {
            //Door is closed and ready for new request
            switch (_doorControlStates)
            {
            case DoorControlStates.DoorClosed:
                //Validate user
                if (!_userValidation.ValidateEntryRequest(id))
                {
                    return;
                }

                //Change state
                _doorControlStates = DoorControlStates.DoorOpening;

                //Open door
                _door.Open();

                //Notify user
                _entryNotification.NotifyEntryGranted();

                //End case
                break;

            //Alarm is currently active, userValidation disables alarm
            case DoorControlStates.DoorAlarm:
                //Validate user
                if (!_userValidation.ValidateEntryRequest(id))
                {
                    return;
                }

                //Change state
                _doorControlStates = DoorControlStates.DoorClosed;

                //Lower alarm
                _alarm.Lower();

                //End case
                break;
            }
        }
        public void RequestEntry(string id)
        {
            if (_currentState != DoorStates.DoorClosed)
            {
                return;
            }

            if (_userValidation.ValidateEntryRequest(id))
            {
                _door.Open();

                _entryNotification.NotifyEntryGranted();

                _currentState = DoorStates.DoorOpening;
            }
            else
            {
                _entryNotification.NotifyEntryDenied();
            }
        }
        public void RequestEntry(int id)
        {
            if (_state == State.DoorClosed)
            {
                if (_userValidation.ValidateEntryRequest(id) == true)
                {
                    _door.Open();
                    _entryNotification.NotifyEntryGranted();
                    _state = State.DoorOpening;
                }

                else
                {
                    _entryNotification.NotifyEntryDenied();
                }
            }
            else
            {
            }
        }
        public void RequestEntry(int id)
        {
            if (_userValidation.ValidateEntryRequest(id))
            {
                switch (_doorState)
                {
                case DState.Closed:
                    _door.Open();
                    _entryNotification.NotifyEntryGranted();
                    break;

                case DState.Open:
                    break;
                }
            }
            else
            {
                _entryNotification.NotifyEntryDenied();
            }
        }
Beispiel #17
0
 public void RequestEntry(int id)
 {
     switch (_controlState)
     {
     case DoorControlState.DoorClosed:
         _controlState = DoorControlState.Validating;
         bool isValidId = _userValidation.ValidateEntryRequest(id);
         if (isValidId)
         {
             _controlState = DoorControlState.Validated;
             _entryNotification.NotifyEntryGranted();
             _door.Open();
         }
         else
         {
             _controlState = DoorControlState.DoorClosed;
             _entryNotification.NotifyEntryDenied();
         }
         break;
     }
 }
        public bool RequestEntry(string id)
        {
            var entryState = _userValidation.ValidateEntryRequest(id);

            _entryState = entryState;

            if (_entryState)
            {
                _entryNotification.NotifyEntryGranted(id);
                _door.Open(); // Door Notifies DoorControl
                _entryState = false;
                Thread.Sleep(3000);
                _door.Close();
            }
            else
            {
                _entryNotification.NotifyEntryDenied(id);
            }

            return(entryState);
        }
Beispiel #19
0
        public void RequestEntry(int id)
        {
            switch (_state)
            {
            case DoorState.DoorClosed:
                bool idOk = _userValidation.ValidateEntryRequest(id);
                if (idOk)
                {
                    _door.Open();
                    _entryNotification.NotifyEntryGranted();
                    _state = DoorState.DoorOpening;
                }
                else
                {
                    _entryNotification.NotifyEntryDenied();
                }
                break;

            default:
                break;
            }
        }
Beispiel #20
0
        public void Hej()
        {
            var id = "";

            switch (_state)
            {
            case DoorControlState.Closed:
                if (RequestEntry(id))
                {
                    _door.Open();
                    _entry.NotifyEntryGranted();
                    _state = DoorControlState.Opening;
                }
                if (RequestEntry(id) == false)
                {
                    _entry.NotifyEntryDenied();
                    _state = DoorControlState.Closed;
                }
                else if (RequestEntry(id) == false && DoorOpen)
                {
                    _door.Close();
                    _alarm.SignalAlarm();
                }
                break;

            case DoorControlState.Opening:
                DoorOpened();
                //_door.Close();
                _state = DoorControlState.Closing;
                break;

            case DoorControlState.Closing:
                _door.Close();
                DoorClosed();
                _state = DoorControlState.Closed;
                break;
            }
        }