private void StudentSkip_Click(object sender, RoutedEventArgs e) { Person log = Database.FindByID(9430); StudentView st = new StudentView(log); st.Show(); this.Close(); }
public void Login(string user, string pass) { if (UsernameTextBox.Text == "admin" && PasswordTextBox.Password == "admin") { AdminHub ad = new AdminHub(); ad.Show(); Close(); return; } var pep = Database.People(); Person log = null; foreach (Person p in pep) { if (p.FirstName.ToLower() == user.ToLower()) { string pword = p.LastName.ToLower().Substring(0, 2) + p.ID; Console.WriteLine(pword); if (pword == pass) { log = p; } } } if (log == null) { MessageBox.Show("Wrong Password or username"); } else { StudentView s = new StudentView(log); s.Show(); this.Close(); } }
private void Button_Click(object sender, RoutedEventArgs e) { var x = new StudentView(Database.FindByID(9430)); x.Show(); }