Ejemplo n.º 1
0
        private void OpenAddPeopleForm(object sender, RoutedEventArgs e)
        {


            AddPersonForm apf = new AddPersonForm(db,new Person());
            var pp = new Person() { Children = new List<IGeneticTreeNode>(), DateOfBirth = new DateTime() };
            apf.DataContext = pp;
            apf.ShowDialog();
            if (apf.DialogResult == true)
            {
                this.db.GetDatabaseInstance().Store(pp);
                LoadEntities();
            }
        }
Ejemplo n.º 2
0
        private void OpenAddPeopleForm(object sender, RoutedEventArgs e)
        {
            AddPersonForm apf = new AddPersonForm(db, new Person());
            var           pp  = new Person()
            {
                Children = new List <IGeneticTreeNode>(), DateOfBirth = new DateTime()
            };

            apf.DataContext = pp;
            apf.ShowDialog();
            if (apf.DialogResult == true)
            {
                this.db.GetDatabaseInstance().Store(pp);
                LoadEntities();
            }
        }
Ejemplo n.º 3
0
 private void OpenEditPeopleForm(object sender, RoutedEventArgs e)
 {
    
     var ppedit = (Person)dgrid.SelectedItem;
     var ppcopy = new Person() { Children = ppedit.Children, DateOfBirth = ppedit.DateOfBirth, DateOfDead = ppedit.DateOfDead, Name = ppedit.Name, Sex = ppedit.Sex };
     AddPersonForm apf = new AddPersonForm(db, ppedit);
     apf.DataContext = ppcopy;
     apf.Title = "Edycja osoby";
     apf.ShowDialog();
     if (apf.DialogResult == true)
     {
         ppedit.Name = ppcopy.Name;
         ppedit.Sex = ppcopy.Sex;
         ppedit.DateOfBirth = ppcopy.DateOfBirth;
         ppedit.DateOfDead = ppcopy.DateOfDead;
         db.GetDatabaseInstance().Store(ppedit);
         LoadEntities();
     }
 }
Ejemplo n.º 4
0
        private void OpenEditPeopleForm(object sender, RoutedEventArgs e)
        {
            var ppedit = (Person)dgrid.SelectedItem;
            var ppcopy = new Person()
            {
                Children = ppedit.Children, DateOfBirth = ppedit.DateOfBirth, DateOfDead = ppedit.DateOfDead, Name = ppedit.Name, Sex = ppedit.Sex
            };
            AddPersonForm apf = new AddPersonForm(db, ppedit);

            apf.DataContext = ppcopy;
            apf.Title       = "Edycja osoby";
            apf.ShowDialog();
            if (apf.DialogResult == true)
            {
                ppedit.Name        = ppcopy.Name;
                ppedit.Sex         = ppcopy.Sex;
                ppedit.DateOfBirth = ppcopy.DateOfBirth;
                ppedit.DateOfDead  = ppcopy.DateOfDead;
                db.GetDatabaseInstance().Store(ppedit);
                LoadEntities();
            }
        }