private void btnGetPerson_Click(object sender, RoutedEventArgs e)
        {
            int    pID = int.Parse(txtPersonID.Text);
            Person p   = SprocDAL.GetPerson(pID);

            MessageBox.Show(p.FirstName);
        }
        public MainWindow()
        {
            InitializeComponent();

            Project p = SprocDAL.GetProject(1);

            MessageBox.Show(p.ProjectTypeID.ToString());
            MessageBox.Show(p.ProjectType.Name);
        }
        private void btnGetPeople_Click(object sender, RoutedEventArgs e)
        {
            //List<Person> lstPeople = DAL.GetPeople(); //GetPeopleFromDatabase();
            List <Person> lstPeople = SprocDAL.GetPeople();

            // GUI Code
            foreach (Person p in lstPeople)
            {
                Label lbl = new Label();
                lbl.Content = p.LastName + ", " + p.FirstName + " : " + p.Phone;
                stkPeople.Children.Add(lbl);
            }
        }
Beispiel #4
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            Person p = new Person();

            p.FirstName   = txtFirstName.Text;
            p.LastName    = txtLastName.Text;
            p.Phone       = txtPhone.Text;
            p.Prefix      = txtPreFix.Text;
            p.Postfix     = txtPostFix.Text;
            p.Homepage    = txtHomePage.Text;
            p.DateOfBirth = dpDateOfBirth.DisplayDate;
            p.Email       = txtEmail.Text;
            p.IsManager   = chkIsManager.IsChecked == true;

            SprocDAL.AddPerson(p);
        }