Пример #1
0
        private async void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            Kundenservice.AktienInfo.ServiceData x = await proxy.getLoginAsync(txtUser.Text, txtPwd.Text);

            if (x.Result)
            {
                lbxLog.Items.Add("Successfully logged in.. waiting for redirect...");
            }

            lbxLog.Items.Add("Sent credentials to server, please be pacient...");
        }
Пример #2
0
        public void loginUser(Kundenservice.AktienInfo.ServiceData status, Kundenservice.AktienInfo.ReturnedBooks rb)
        {
            Dispatcher.Invoke(delegate
            {
                if (status.Result)
                {
                    lbxLog.Items.Add(status.ErrorMessage + ":");
                    lbxLog.Items.Add(status.ErrorDetails);
                    lbxLog.Items.Add("Successfully logged in.. waiting for redirect...");
                    if (rb.hasReturned)
                    {
                        MessageBox.Show("Bücher wurden zurückgebracht, bei interesse beachten Sie ihre Wunschliste.");
                        MessageBox.Show("Bücher: " + rb.Books);
                    }
                    Task.Run(() =>
                    {
                        Thread.Sleep(2000);
                        Dispatcher.Invoke(() =>
                        {
                            var main  = new MainWindow();
                            main.user = txtUser.Text;
                            main.checkAdmin();
                            main.Show();
                            Close();
                        });
                    });
                }
                else if (!status.Result)
                {
                    lbxLog.Items.Add("login not successfull.. waiting for retry...");
                    lbxLog.Items.Add("----------------------------------");
                    Task.Run(() => { Thread.Sleep(2000); });

                    txtUser.IsEnabled  = true;
                    txtPwd.IsEnabled   = true;
                    btnLogin.IsEnabled = true;
                }
            });
        }
 public void loginUser(Kundenservice.AktienInfo.ServiceData x, Kundenservice.AktienInfo.ReturnedBooks rb)
 {
 }