/// <summary> /// Populates cmbStaff with each /// member of staff stored in the /// list /// </summary> public void updateCmbStaff() { cd = CustomerDatabase.Instance; foreach (Person p in cd.Persons) { if (p.GetType() == typeof(Staff)) { cmbStaff.Items.Add(p); } } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { cd = CustomerDatabase.Instance; foreach (Person p in cd.Persons) { if (p.GetType() == typeof(Staff)) { Staff s = (Staff)p; if (s.StaffID == txtUserName.Text) { MessageBox.Show("Login Successful"); StaffSelection select = new StaffSelection(); select.Show(); this.Close(); } else { MessageBox.Show("Wrong Username"); } } } }
public People() { InitializeComponent(); database = CustomerDatabase.Instance; database.populate(); }
public MainWindow() { InitializeComponent(); cd = CustomerDatabase.Instance; cd.populate(); }