private void ButtonDetail_Click(object sender, RoutedEventArgs e)
        {
            int selectedIndex = dataGridClients.SelectedIndex;

            if (selectedIndex < 0)
            {
                MessageBox.Show("Не выбран клиент");
                return;
            }



            var ap = new DBManager().getClientList();

            Models.ModelClient modelClient = null;
            foreach (var it in ap)
            {
                if (it.ID_Authorization == listClient[selectedIndex].ID_Authorization)
                {
                    modelClient = it;
                    break;
                }
            }

            var ce = new RegistrationWindow(modelClient, true);

            ce.ShowDialog();
        }
        private void OpenRegWind_Click(object sender, RoutedEventArgs e)
        {
            RegistrationWindow registration = new RegistrationWindow();

            registration.Owner = MainWindow.GetWindow(this);
            registration.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            registration.ShowDialog();
        }
Exemple #3
0
        private void AuthenticationViewModel_SignUpConfirmed()
        {
            _authenticationWindow.Hide();
            var registrationViewModel = new RegistrationViewModel();

            registrationViewModel.RegisterConfirmed += RegistrationViewModel_RegisterConfirmed;
            _registrationWindow         = new RegistrationWindow(registrationViewModel);
            _registrationWindow.Closed += RegistrationWindow_Closed;
            _registrationWindow.ShowDialog();
        }
Exemple #4
0
        /// <summary>
        /// Вызывает окно редактирования данных пользователя
        /// </summary>
        /// <param name="parameter"></param>
        private void ShowReaderUserWindow(object parameter)
        {
            CloseWindowCommand.Execute(null);

            var updateWindow = new RegistrationWindow(UserList, User);
            var viewUpdater  = new UpdateViewUpdater(updateWindow);

            viewUpdater.Update();

            updateWindow.ShowDialog();
        }
Exemple #5
0
        public void ExecuteUpdateLicenseCommand()
        {
            var form   = new RegistrationWindow(GlobalObjects.ProductKey.ExpireDate);
            var result = form.ShowDialog();

            if (result.HasValue && result.Value)
            {
                ApplyProductKey(GlobalObjects.ProductKey);
                ServiceLocator.Current.GetInstance <IInteractionService>().ShowMessage(
                    UiResources.Message, UiResources.RebootRequiredToLicenseChangeTakeEffect, 0);
            }
        }
        public bool resetPassword()
        {
            _errors = "";
            RegistrationWindow win = new RegistrationWindow();

            win.ResizeMode = System.Windows.ResizeMode.NoResize;
            bool?res = win.ShowDialog();

            if (res == true)
            {
                KeyStorePassword = win.tbPassword.Password;
            }

            return(res == true);
        }
Exemple #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ClientBootstrapper clientBootstrapper = new ClientBootstrapper(CancellationToken.None);

            clientBootstrapper.Run();

            ShutdownMode = ShutdownMode.OnExplicitShutdown;
            LoginWindow loginWindow = new LoginWindow();

            MainWindow = loginWindow;
            LoginViewModel loginViewModel = ServiceLocator.Current.GetInstance <LoginViewModel>();

            loginWindow.DataContext = loginViewModel;
            loginWindow.ShowDialog();

            ShutdownMode = ShutdownMode.OnLastWindowClose;

            if (loginViewModel.IsRegisterUserSelected)
            {
                RegistrationViewModel registrationViewModel = ServiceLocator.Current.GetInstance <RegistrationViewModel>();
                MainWindow = new RegistrationWindow {
                    DataContext = registrationViewModel
                };
                MainWindow.ShowDialog();
            }
            else if (loginViewModel.IsCreatePollSelected)
            {
                PollViewModel pollViewModel = ServiceLocator.Current.GetInstance <PollViewModel>();
                MainWindow = new PollWindow {
                    DataContext = pollViewModel
                };
                MainWindow.ShowDialog();
            }
            else if (loginViewModel.IsVoteSelected)
            {
                VoteViewModel voteViewModel = ServiceLocator.Current.GetInstance <VoteViewModel>();
                MainWindow = new VoteWindow {
                    DataContext = voteViewModel
                };
                MainWindow.ShowDialog();
            }
            else
            {
                Shutdown();
            }
        }
Exemple #8
0
        public bool resetPassword()
        {
            System.Windows.Forms.Cursor currentCursor = System.Windows.Forms.Cursor.Current;
            Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow;

            _errors = "";
            RegistrationWindow win = new RegistrationWindow();

            win.ResizeMode = System.Windows.ResizeMode.NoResize;
            bool?res = win.ShowDialog();

            if (res == true)
            {
                KeyStorePassword = win.tbPassword.Password;
            }

            if (currentCursor.ToString().Contains("Wait"))
            {
                Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            }

            return(res == true);
        }
Exemple #9
0
        public static void Authenticate()
        {
            while (true)
            {
                AuthenticationWindow authenticationWindow = new AuthenticationWindow();
                authenticationWindow.ShowDialog();

                if (authenticationWindow.Tag == null)
                {
                    AsynchronousClientSocket.Shutdown();
                    Process.GetCurrentProcess().CloseMainWindow();
                }
                else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.Authenticated)
                {
                    break;
                }
                else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.ShowRegWin)
                {
                    RegistrationWindow registrationWindow = new RegistrationWindow();
                    registrationWindow.ShowDialog();

                    if (registrationWindow.Tag == null)
                    {
                        AsynchronousClientSocket.Shutdown();
                        Process.GetCurrentProcess().CloseMainWindow();
                    }
                }
            }
        }
Exemple #10
0
        private void RegistrationButtonCommandExecute(object param)
        {
            RegistrationWindow registrationWindow = new RegistrationWindow(_userSqlProvider);

            registrationWindow.ShowDialog();
        }
        private void CreateNewUser_Click(object sender, RoutedEventArgs e)
        {
            RegistrationWindow registrationWindow = new RegistrationWindow();

            registrationWindow.ShowDialog();
        }
        /// <summary>
        /// Вывод окна регистрации пользователя
        /// </summary>
        /// <param name="parameter"></param>
        private void ShowRegistrationView(object parameter)
        {
            var registerView = new RegistrationWindow(UserDataProfiles);

            registerView.ShowDialog();
        }
 private void registrationEnterButton_Click(object sender, RoutedEventArgs e)
 {
     RegistrationWindow registrationWindow = new RegistrationWindow();
     registrationWindow.ShowDialog();
 }
 private void ShowRegistrationWindow()
 {
     RegistrationWindow registrationWindow = new RegistrationWindow();
     DialogResult result = registrationWindow.ShowDialog();
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         if (RegisterUser(registrationWindow.RegUsername, registrationWindow.RegPassword))
         {
             TryLogin(registrationWindow.RegUsername, registrationWindow.RegPassword);
         }
         else
         {
             ShowPopUp("Registrierung fehlgeschlagen");
         }
     }
     else
     {
         DisableSidebarOnLogout();
         DisableSidebarOnFactoryCleared();
     }
     registrationWindow.Close();
 }