Exemple #1
0
        private async void b_registrieren_Click(object sender, RoutedEventArgs e)
        {
            string email  = tbx_email.Text;
            string pw     = pb_pw.Password;
            string result = string.Empty;

            try
            {
                result = await MyWebRequests.requestRegister(email, pw);
            }
            catch (Exception ex)
            {
                tblk_error.Text = ex.Message;
                return;
            }

            switch (result)
            {
            case "You are now registered!":
                App._VerificationKey = await UserRequests.loginUser(email, pw);

                App._Email = email;
                Frame.Navigate(typeof(P_MainPage));
                break;

            default:
                tblk_error.Text = result;
                break;
            }
        }
Exemple #2
0
        private async void abb_delete_Click(object sender, RoutedEventArgs e)
        {
            if (lbx_boards.SelectedIndex != -1)
            {
                bool result = false;

                try
                {
                    result = await MyWebRequests.requestIsBoardAdmin("blub", "blub");
                }
                catch (Exception ex)
                {
                    await new MessageDialog(ex.Message).ShowAsync();
                }

                if (result)
                {
                    var dialog = new MessageDialog("Möchten Sie \"" + (lbx_boards.SelectedItem as JObject).GetValue("ID") + "\" wirklich löschen?", "Sind Sie sicher?");

                    dialog.Commands.Add(new UICommand("Ja", new UICommandInvokedHandler(CommandInvokeHandler))
                    {
                        Id = 0
                    });
                    dialog.Commands.Add(new UICommand("Nein")
                    {
                        Id = 1
                    });

                    dialog.DefaultCommandIndex = 1;
                    dialog.CancelCommandIndex  = 1;

                    var diaResult = dialog.ShowAsync();
                }
                else
                {
                    await new MessageDialog("User is not Board-Admin.").ShowAsync();
                }
            }
        }