Example #1
0
        private void ExecuteAddNewUserCommand(object obj)
        {
            try
            {
                EditUserWindow dlg = new EditUserWindow();
                dlg.Header = "Enter name of new user:"******"New User";
                dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                dlg.Owner = Application.Current.MainWindow;
                if (dlg.ShowDialog() == true)
                {
                    EditUserWindow dlgPW = new EditUserWindow();
                    dlgPW.Header = "Enter the password of new user (press 'Cancel' to create a List-User):";
                    dlgPW.Title  = "Password";
                    dlgPW.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    dlgPW.Owner = Application.Current.MainWindow;
                    dlgPW.ShowDialog();

                    AddUser(dlg.TextItem, dlgPW.TextItem, string.IsNullOrEmpty(dlgPW.TextItem) ? UserAuthType.ListAuthentication : UserAuthType.FormsAuthentication);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            RaiseCanExecuteChanged();
        }
Example #2
0
        private void ExecuteAddNewUserCommand(object obj)
        {
            try
            {
                EditUserWindow dlg = new EditUserWindow();
                dlg.Header = "Enter name of new user:"******"New User";
                dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                dlg.Owner = Application.Current.MainWindow;
                if (dlg.ShowDialog() == true)
                {
                    EditUserWindow dlgPW = new EditUserWindow();
                    dlgPW.Header = "Enter the password of new user (press 'Cancel' to create a List-User):";
                    dlgPW.Title = "Password";
                    dlgPW.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    dlgPW.Owner = Application.Current.MainWindow;
                    dlgPW.ShowDialog();

                    AddUser(dlg.TextItem, dlgPW.TextItem, string.IsNullOrEmpty(dlgPW.TextItem) ? UserAuthType.ListAuthentication : UserAuthType.FormsAuthentication);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            RaiseCanExecuteChanged();
        }