Пример #1
0
 private void btnGuest_Click(object sender, RoutedEventArgs e)
 {
     //Переход на страницу заметок
     Windows.NotesWindow notesWindow = new Windows.NotesWindow();
     this.Hide();
     notesWindow.ShowDialog();
     this.Show();
 }
Пример #2
0
 private void btnGuest_Click(object sender, RoutedEventArgs e)
 {
     // переход
     Windows.NotesWindow notesWindow = new Windows.NotesWindow();
     this.Hide();
     notesWindow.ShowDialog();
     //this.Show();
 }
Пример #3
0
        private void btnSignIn_Click(object sender, RoutedEventArgs e)
        {
            //Авторизация
            var userAuth = DB.AppData.context.UserData.ToList().Where(i => i.Login == txtLogin.Text && i.Password == txtPassword.Password).FirstOrDefault();

            if (userAuth != null)
            {
                Classes.AuthData.userData = userAuth;
                //Переход на страницу заметок
                Windows.NotesWindow notesWindow = new Windows.NotesWindow();
                this.Hide();
                notesWindow.ShowDialog();
                //this.Show();
            }
            else
            {
                MessageBox.Show("Incorrect username or password.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #4
0
        private void btnSignIn_Click(object sender, RoutedEventArgs e)
        {
            var userAuth = EF.AppData.context.UserData.ToList().
                           Where(i => i.Login == txtLogin.Text && i.Password == txtPassword.Password).
                           FirstOrDefault();

            if (userAuth != null)
            {
                ClassHelper.AuthData.userData = userAuth;
                // переход
                Windows.NotesWindow notesWindow = new Windows.NotesWindow();
                this.Hide();
                notesWindow.ShowDialog();
                //this.Show();
            }
            else
            {
                MessageBox.Show("User not found", "Error", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }