Example #1
0
 public void RequestEntry(string id)
 {
     if (_userValidation.ValidateEntryRequest(id))
     {
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         _entryNotification.NotifyEntryDenied();
     }
 }
Example #2
0
 public void RequestEntry(int ID)
 {
     if (_userValidation.ValidateEntryRequest(ID) == true)
     {
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         _entryNotification.NotifyEntryDenied();
     }
 }
 public void RequestEntry(int id)
 {
     if (_userValidation.ValidateEntryRequest(id) && _currentState == DoorState.Closed)
     {
         _currentState = DoorState.Opening;
         _door.Open();
         _entryNotification.NotifyEntryGranted();
     }
     else
     {
         _entryNotification.NotifyEntryDenied();
     }
 }
Example #4
0
 public void RequestEntry(int id)
 {
     _valid = _user.ValidateEntryRequest(id);
     if (_valid)
     {
         _door.Open();
         _noti.NotifyEntryGranted();
     }
     else
     {
         _noti.NotifyEntryDenied();
     }
 }
Example #5
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();
     }
 }
 public void RequestEntry(int id)
 {
     //User validation
     if (_validation.ValidateEntryRequest(id))
     {
         _state = States.DoorOpening;
         _entryNotification.NotifyEntryGranted(id);
         _door.Open();
     }
     else
     {
         _entryNotification.NotifyEntryDenied(id);
     }
 }
Example #7
0
        public void RequestEntry(string id)
        {
            var idStatus = _userValidation.ValidateEntryRequest(id);

            if (idStatus) //svarer til idStatus==true
            {
                _door.Open();
                _entryNotification.NotifyEntryGranted();
            }
            else
            {
                _entryNotification.NotifyEntryDenied();
            }
        }
Example #8
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;
     }
 }
Example #9
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();
            }
        }
        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();
            }
        }
Example #12
0
        public void RequestEntry(string id)
        {
            if (_currentState != DoorStates.DoorClosed)
            {
                return;
            }

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

                _entryNotification.NotifyEntryGranted();

                _currentState = DoorStates.DoorOpening;
            }
            else
            {
                _entryNotification.NotifyEntryDenied();
            }
        }
Example #13
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);
        }
Example #15
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;
            }
        }
Example #16
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;
            }
        }