Exemple #1
0
        public void ExecuteAuthotizationCommand(object parameter)
        {
            AuthorizationModel authorization = new AuthorizationModel(LoginAndPassword.Login, LoginAndPassword.Password);

            if (!authorization.CheckLogin())
            {
                _dialogManager.ShowMessage($"Пользователя с логином {LoginAndPassword.Login}не существует");
                LoginAndPassword.Login    = null;
                LoginAndPassword.Password = null;
                return;
            }

            if (!authorization.CheckAccessLevel())
            {
                _dialogManager.ShowMessage("Недостаточно прав для входа в приложение");
                LoginAndPassword.Login    = null;
                LoginAndPassword.Password = null;
                return;
            }


            if (!authorization.CheckPassword())
            {
                _dialogManager.ShowMessage("Неправильный пароль");
                LoginAndPassword.Password = null;
                return;
            }
            _user = authorization.GetUser;
            GoNext();
        }