private void Button_Click(object sender, RoutedEventArgs e)
        {
            var account =
                AccountsController.GetInstance().GetAccount(UsernameTextBox.Text, PasswordBox.Password,
                                                            PathTextBox.Text);

            if (account == null)
            {
                MessageBox.Show("Username and password are not valid. Please try again.", "Unsuccessful login");
            }
            else
            {
                MessageBox.Show("Username and password are valid. Congratulations.", "Successful login");
                AccountsController.GetInstance().ChangeCurrentAccount(account);
                File.Delete(Directory.GetCurrentDirectory() + $"/../../ChatRequests/{AccountsController.GetInstance().CurrentAccount.Username}.sesreq");
                var mw = new ChatRoomWindow(this);
                mw.Show();
                Hide();
            }
        }
Exemplo n.º 2
0
 public PleaseWaitWindow(ChatRoomWindow chatRoomWindow) : this()
 {
     _previousWindow = chatRoomWindow;
 }