コード例 #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);
                }
            }
        }
コード例 #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");
                    }
                }
            }
        }
コード例 #3
0
 public People()
 {
     InitializeComponent();
     database = CustomerDatabase.Instance;
     database.populate();
 }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: Craig-97/C-Sharp
 public MainWindow()
 {
     InitializeComponent();
     cd = CustomerDatabase.Instance;
     cd.populate();
 }