/// <summary> /// метод выполняется при нажатии кнопки Back, возвращает к окну выбора проектов /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GetBack_Click(object sender, RoutedEventArgs e) { AdminProjects project = new AdminProjects(); Close(); project.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!"); } } } }