private void BackButton_Click(object sender, RoutedEventArgs e) { ChoiceWindow choice = new ChoiceWindow(_user); Close(); choice.Show(); }
private async void EnterButton_Click(object sender, RoutedEventArgs e) { UserActions userActions = new UserActions(); if (await userActions.CheckLogin(loginBox.Text.Trim(), passwordBox.Password.Trim()) == 3) { AdminProjects adminProject = new AdminProjects(); Close(); adminProject.Show(); } else { if (await userActions.CheckLogin(loginBox.Text.Trim(), passwordBox.Password.Trim()) == 2) { User user = await userActions.SearchForUser(loginBox.Text.Trim(), passwordBox.Password.Trim()); ChoiceWindow choice = new ChoiceWindow(user); Close(); choice.Show(); } else { if (await userActions.CheckLogin(loginBox.Text.Trim(), passwordBox.Password.Trim()) == 1) { User user = await userActions.SearchForUser(loginBox.Text.Trim(), passwordBox.Password.Trim()); SelectionWindow selectWindow = new SelectionWindow(user); selectWindow.Show(); Close(); } else { MessageBox.Show("Error occured after entering login and password!"); } } } }