Exemplo n.º 1
0
 /// <summary>
 /// Validate user data after clicking log in button and if succeded open home window
 /// </summary>
 public void LogInButtonClicked(object sender, RoutedEventArgs e)
 {
     if (EmployeeValidation.Validate(EmployeeName.Text, EmployeeSurname.Text))
     {
         ((App)Application.Current).CreateCurrentEmployee(EmployeeName.Text, EmployeeSurname.Text);
         HomeWindow window = new HomeWindow();
         window.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Cannot login as " + EmployeeName.Text + " " + EmployeeSurname.Text);
     }
 }
Exemplo n.º 2
0
 ///<summary>
 /// Get user data to creating new user.
 ///</summary>
 public void SingUpButtonClicked(object sender, RoutedEventArgs e)
 {
     if (EmployeeValidation.NewValidate(EmployeeName.Text, EmployeeSurname.Text, EmployeeJobTitle.Text))
     {
         MessageBox.Show("Singed Up as: " + EmployeeName.Text + " " + EmployeeSurname.Text + " " + EmployeeJobTitle.Text);
         AddNewEmployee(EmployeeName.Text, EmployeeSurname.Text, EmployeeJobTitle.Text);
         MainWindow window = new MainWindow();
         window.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Could not sing up. Invalid data");
     }
 }