Example #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)//Logging in
        {
            EmailUser logged;
            string    user     = this.Username.Text;
            string    password = this.Password.Password;
            bool      success  = EmailData.GetUserData(user, password, out logged);

            if (!success)
            {
                MessageBox.Show($"{this.FindResource("LoginFail") as string}");
            }
            else
            {
                if (this.Owner is MainWindow wnd)
                {
                    wnd.current = logged;
                    wnd.TabControl.Visibility = System.Windows.Visibility.Visible;
                    wnd.logged     = true;
                    wnd.Login.Text = this.FindResource("StrLogout") as string;
                    wnd.NewMailButton.IsEnabled = true;
                    wnd.SearchBox.IsEnabled     = true;
                }
                this.Close();
            }
        }
Example #2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (EmailData.GetUserData(usernameTextbox.Text, passwordTextbox.Password, out EmailUser loggedUser))
     {
         DialogResult = true;
         LoggedUser   = loggedUser;
         var messages = loggedUser.MessagesReceived;
         Close();
     }
     else
     {
         var app = (App)Application.Current;
         MessageBox.Show((string)app.ThemeDictionary["incorrectLogin"]);
     }
 }
Example #3
0
        private void btnOkClick(object sender, RoutedEventArgs e)
        {
            EmailUser loggedUser;
            bool      success = EmailData.GetUserData(loginBox.Text, passwordBox.Password, out loggedUser);

            if (!success)
            {
                MessageBox.Show((string)Application.Current.FindResource("incorrectLoginData"));
            }
            else
            {
                this.User = loggedUser;
                this.Close();
            }
        }
Example #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string login    = loginBox.Text;
            string password = passBox.Password;
            bool   success  = EmailData.GetUserData(login, password, out loggedUser);

            if (success)
            {
                this.DialogResult = true;
            }
            else
            {
                this.DialogResult = false;
                MessageBox.Show("Login Failed");
            }
            this.Close();
        }
        private bool checkCredentials()
        {
            EmailUser loggedUser;
            string    login    = loginBox.Text;
            string    password = pswdBox.Password;
            bool      success  = EmailData.GetUserData(login, password, out loggedUser);

            if (success)
            {
                usr          = loggedUser;
                messagesRcvd = loggedUser.MessagesReceived;
                messagesSnt  = loggedUser.MessagesSent;
                return(true);
            }
            else
            {
                usr          = null;
                messagesRcvd = null;
                messagesSnt  = null;
                return(false);
            }
        }