Example #1
0
        private async void signUpButton_Click(object sender, RoutedEventArgs e)
        {
            ContentDialog       dialog = new SignUpDialog();
            ContentDialogResult result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                TextBox     dialogUsername = ((TextBox)dialog.FindName("userName"));
                PasswordBox dialogPassword = ((PasswordBox)dialog.FindName("password"));
                ComboBox    dialogUserType = ((ComboBox)dialog.FindName("userType"));

                if (dialogUserType.SelectedIndex == 0)
                {
                    await DatabaseHelper.Client.CreateUserAsync(dialogUsername.Text, dialogPassword.Password, "", "", 1);
                }
                else
                {
                    await DatabaseHelper.Client.CreateUserAsync(dialogUsername.Text, dialogPassword.Password, "", "", 2);
                }

                var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
                var check         = localSettings.Values["Autologin"] = "******";
                // Navigate to set up page
                Frame frame = Window.Current.Content as Frame;
                frame.Navigate(typeof(AccountSetUpPage), dialogUsername.Text);
            }
        }
Example #2
0
        private async void signUpButton_Click(object sender, RoutedEventArgs e)
        {
            ContentDialog dialog = new SignUpDialog();
            ContentDialogResult result = await dialog.ShowAsync();
            if (result == ContentDialogResult.Primary)
            {
                TextBox dialogUsername = ((TextBox)dialog.FindName("userName"));
                PasswordBox dialogPassword = ((PasswordBox)dialog.FindName("password"));
                ComboBox dialogUserType = ((ComboBox)dialog.FindName("userType"));

                if (dialogUserType.SelectedIndex == 0)
                    await DatabaseHelper.Client.CreateUserAsync(dialogUsername.Text, dialogPassword.Password, "", "", 1);
                else
                    await DatabaseHelper.Client.CreateUserAsync(dialogUsername.Text, dialogPassword.Password, "", "", 2);

                var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
                var check = localSettings.Values["Autologin"] = "******";
                // Navigate to set up page
                Frame frame = Window.Current.Content as Frame;
                frame.Navigate(typeof(AccountSetUpPage), dialogUsername.Text);
            }
        }