private void Back_Click(object sender, RoutedEventArgs e) { var newform = new Cashier(); newform.Show(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { if (Username.Text.Length == 0 || Password.Password.Length == 0) { MessageBox.Show("Fill empty boxes"); } else { try { string login = Username.Text; string password = Password.Password; name = login; int access = stc.GetLoginToClient(login, password, name); if (access == 1) { var newform = new Manager(); newform.Show(); this.Close(); } if (access == 0) { var newform = new Cashier(); newform.Show(); this.Close(); } if (access == 2) { MessageBox.Show("Login Failed"); } } catch (Exception b) { MessageBox.Show(b.Message); } } }