Esempio n. 1
0
        private void OnSignIn(object parameter)
        {
            var values   = (object[])parameter;
            var login    = ((TextBox)values[0]).Text;
            var password = ((PasswordBox)values[1]).Password;

            var userList = UserStorageManager.Instance.GetItemsList();

            if (login.Length == 0 || password.Length == 0)
            {
                NotificationEvent.Notify("Fields should not be empty!");
                return;
            }

            if (userList.Any(user => user.Login == login && user.Password == password))
            {
                SignInEvent.SignIn(true);
                return;
            }

            NotificationEvent.Notify("Incorrect Credentials!");
            SignInEvent.SignIn(false);
        }