public bool OpenDialog(CPerson p, CGeneaManager GeneaManager)
        {
            this.BirthDate.Text    = p.BirthDate;
            this.BirthCountry.Text = p.BirthCountry;
            this.BirthCity.Text    = p.BirthCity;
            this.DeathDate.Text    = p.DeathDate;
            this.DeathCountry.Text = p.DeathCountry;
            this.DeathCity.Text    = p.DeathCity;
            this.Comment.Text      = p.Comment;
            this.Text = p.FolderName;

            GeneaManager.Persons.FillComboBox(this.cboFather, p.FatherGuid, "M");
            GeneaManager.Persons.FillComboBox(this.cboMother, p.MotherGuid, "F");

            GeneaManager.FillComboBoxSexe(this.cboSexe, p.Sexe);

            if (this.ShowDialog() == DialogResult.OK)
            {
                p.BirthDate    = this.BirthDate.Text;
                p.BirthCountry = this.BirthCountry.Text;
                p.BirthCity    = this.BirthCity.Text;
                p.DeathDate    = this.DeathDate.Text;
                p.DeathCountry = this.DeathCountry.Text;
                p.DeathCity    = this.DeathCity.Text;
                p.Comment      = this.Comment.Text;
                p.Sexe         = ((CSLib.CObjectBoxItem)cboSexe.SelectedItem).Value == "M" ? "M" : "F";

                if (cboFather.SelectedItem != null)
                {
                    CPerson Father = (CPerson)((CSLib.CObjectBoxItem)cboFather.SelectedItem).Value;
                    p.FatherGuid = Father.Guid;
                }

                if (cboMother.SelectedItem != null)
                {
                    CPerson Mother = (CPerson)((CSLib.CObjectBoxItem)cboMother.SelectedItem).Value;
                    p.MotherGuid = Mother.Guid;
                }



                p.Save();

                return(true);
            }
            else
            {
                return(false);
            }
        }
        public CPerson OpenDialog(CGeneaManager GeneaManager)
        {
            GeneaManager.Persons.FillComboBox(cboMAN, "");

            if (this.ShowDialog() == DialogResult.OK)
            {
                CPerson Man = (CPerson)((CSLib.CObjectBoxItem)cboMAN.SelectedItem).Value;
                return(Man);
            }
            else
            {
                return(null);
            }
        }
        public bool CreateUnion(CPerson UnionMember1, CGeneaManager GeneaManager)
        {
            GeneaManager.Persons.FillComboBox(cboMAN, UnionMember1.IsMan() ? UnionMember1.Guid : null);
            GeneaManager.Persons.FillComboBox(cboWoman, UnionMember1.IsMan() ? null : UnionMember1.Guid);

            if (this.ShowDialog() == DialogResult.OK)
            {
                CPerson Man   = (CPerson)((CSLib.CObjectBoxItem)cboMAN.SelectedItem).Value;
                CPerson Woman = (CPerson)((CSLib.CObjectBoxItem)cboWoman.SelectedItem).Value;

                CUnion u = new CUnion();
                u.Create(Man.Guid, Woman.Guid, this.StartDate.Text, this.EndDate.Text);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool OpenDialog(CPerson P1, CGeneaManager GeneaManager)
        {
            GeneaManager.Persons.FillComboBox(this.cboPerson1, P1.Guid);
            GeneaManager.Persons.FillComboBox(this.cboPerson2, null);
            GeneaManager.FillComboBoxWithRelation(this.cboRelation);

            if (this.ShowDialog() == DialogResult.OK)
            {
                CPerson   p1       = (CPerson)((CSLib.CObjectBoxItem)cboPerson1.SelectedItem).Value;
                CPerson   p2       = (CPerson)((CSLib.CObjectBoxItem)cboPerson2.SelectedItem).Value;
                ERelation Relation = (ERelation)((CSLib.CObjectBoxItem) this.cboRelation.SelectedItem).Value;

                p1.SetRelation(p2, Relation);

                return(true);
            }
            else
            {
                return(false);
            }
        }