Ejemplo n.º 1
0
        private async void editPasswordMenu_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new LoginWindow(ViewModel.User.Username, false);

            dialog.Message = I18NStringUtil.GetString("uv_reset_password");
            if (dialog.ShowDialog() == true)
            {
                var res = MessageBox.Show(I18NStringUtil.GetString("uv_reset_password_pin"),
                                          I18NStringUtil.GetString("warning"), MessageBoxButton.YesNo, MessageBoxImage.Question);
                var pin = "";
                if (res == MessageBoxResult.Yes)
                {
                    var pinD = new PinSimpleDialog(I18NStringUtil.GetString("uv_set_new_pin"));
                    if (pinD.ShowDialog() == true)
                    {
                        pin = pinD.Result;
                    }
                }

                await ViewModel.ChangePassword.Execute((dialog.Result.Password, pin));
            }
        }
Ejemplo n.º 2
0
        private void newUserButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new LoginWindow();

            dialog.ShowDialog();

            if (dialog.DialogResult == true)
            {
                string pin = "";

                var isPinNeeded = MessageBox.Show(I18NStringUtil.GetString("um_pin_hint"), I18NStringUtil.GetString("warning"), MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (isPinNeeded == MessageBoxResult.Yes)
                {
                    var dialogPin = new PinSimpleDialog();
                    if (dialogPin.ShowDialog() == true)
                    {
                        pin = dialogPin.Result;
                    }
                }

                ViewModel.AddUser.Execute((dialog.Result, pin)).Subscribe();
            }
        }