Example #1
0
        /// <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);
                }
            }
        }
Example #2
0
        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");
                    }
                }
            }
        }
Example #3
0
 public People()
 {
     InitializeComponent();
     database = CustomerDatabase.Instance;
     database.populate();
 }
Example #4
0
 public MainWindow()
 {
     InitializeComponent();
     cd = CustomerDatabase.Instance;
     cd.populate();
 }