Esempio n. 1
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            NABAEntities4 db  = new NABAEntities4();
            Person        obj = new Person();

            obj.Id        = Convert.ToInt32(db.People.Count());
            obj.Firstname = FirstName.Text;
            obj.Lastname  = LastName.Text;

            db.People.Add(obj);
            db.SaveChanges();
            this.Close();
        }
Esempio n. 2
0
        private void Display_Click(object sender, RoutedEventArgs e)
        {
            NABAEntities4 db = new NABAEntities4();

            DataDisplay.ItemsSource = db.People.ToList();
        }