예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj">Password</param>
        /// <returns></returns>
        private async Task SignIn(object obj)
        {
            if (string.IsNullOrEmpty(UserName) || Password is null || Password.Length == 0)
            {
                DisplayError(l10n.Login.Errors.LoginError);
                return;
            }

            var result = await CheckCredentials();

            if (result && _identity.IsAdmin())
            {
                var viewModel = await _windowHelper.GetViewModel <MainMenuViewModel>();

                _mediator.Raise(MainViewModel.ChangeDisplayContentOperationKey, viewModel);
            }
            else if (result && !_identity.IsAdmin())
            {
                DisplayError(l10n.Login.Errors.AccessDedined);
            }
            else
            {
                DisplayError(l10n.Login.Errors.LoginError);
            }
        }