Ejemplo n.º 1
0
        public void Ok()
        {
            try
            {
                _userFactory.Create(UserName, Password);
            }
            catch (DuplikateUserException e)
            {
                MessageBox.Show("Login w użyciu");
                return;
            }


            _settings.UserName = UserName;
            _settings.Password = Password;
            _eventAggregator.PublishOnCurrentThread(new GoToNextViewEvent(_setupViewModelsFactory.CreateAddressBookViewModel(), UserName));
        }
Ejemplo n.º 2
0
        public void Login()
        {
            using (var context = new DatabaseEntities())
            {
                var user = context.Users.FirstOrDefault(u => u.UserName == UserName);
                if (user == null || _cryptographicAlgorithm.IsPasswordCorrect(Password, user) == false)
                {
                    MessageBox.Show("Błąd");
                    return;
                }
            }


            _settings.Password = Password;
            _settings.UserName = UserName;



            _eventAggregator.PublishOnCurrentThread(new GoToNextViewEvent(_setupViewModelsFactory.CreateAddressBookViewModel(), UserName));
        }