private void user_page(object sender, RoutedEventArgs e) { EmployeePage win = new EmployeePage(); win.Show(); this.Close(); }
private void button_Click(object sender, RoutedEventArgs e) { var answer = textBoxAnswer.Text; var question = comboBoxQuestion.Text; int id = Settings.Default.Id; if (string.IsNullOrWhiteSpace(answer) == true) { MessageBox.Show("Answer Field must not be empty or whitespace"); } else { employeeParam.answer = answer; employeeParam.question = question; _employeeService.UpdateQuestionAnswer(id, employeeParam); MessageBox.Show("Data Saved"); Settings.Default.Question = comboBoxQuestion.Text; Settings.Default.Answer = textBoxAnswer.Text; Settings.Default.Save(); if (Settings.Default.Position == "Admin") { MainWindow main = new MainWindow(); main.Show(); this.Close(); } else { EmployeePage emp = new EmployeePage(); emp.Show(); this.Close(); } } }
private void Button_Click(object sender, RoutedEventArgs e) { login = this.loginInput.Text; password = this.passwordInput.Password; if (_userService.ValidateLogin(login, password)) { EmployeePage employeePage = new EmployeePage(); employeePage.Show(); this.Close(); } else { MessageBox.Show(this, "Validation error", "Error", MessageBoxButton.OK); } }