Exemplo n.º 1
0
        /// <summary>
        /// Locks a bikestand and updates the interface
        /// </summary>
        private void Lock()
        {
            BikeStandRegistration bikestandRegistration = null;

            if (int.TryParse(LockID, out int convertedLockID))
            {
                bikestandRegistration = serverClient.Lock(convertedLockID);
            }
            else
            {
                IsLockErrorVisible = true;
            }
            if (bikestandRegistration != null)
            {
                BikeStation bikeStation = serverClient.GetBikeStation("" + bikestandRegistration.BikeStandID);
                IsAddFriendEnabled   = true;
                IsLockIDEnabled      = false;
                LockVisible          = false;
                UnlockVisible        = true;
                IsLockErrorVisible   = false;
                IsAddFriendVisible   = true;
                BikeStationText      = String.Format("Your bike was locked at {0} on the {1}", bikeStation.title, bikestandRegistration.RegistrationTime);
                IsBikeStationVisible = true;
            }
            else
            {
                IsLockErrorVisible = true;
            }
        }