Exemple #1
0
        private void UpdateChooseChildren(bool?selectAll = null)
        {
            ChooseChildren.Items.Clear();

            EnumerableOwnChildren = SourceFamily.GetEnumerableMembers().Where(m => m.Refs.ParentId == SourceMember.Id);
            EnumerableChildren    = SourceFamily.GetEnumerableMembers().Where(
                m => m.Id != SourceMember.Id &&
                m.BirthDate >= SourceMember.BirthDate &&
                m.Refs.Parent == null &&
                !SourceMember.Refs.Partner.Changes.Values.Any(p => p != null && p.Id == m.Id)
                );

            if (EnumerableChildren.Any() || EnumerableOwnChildren.Any())
            {
                foreach (Member child in EnumerableOwnChildren)
                {
                    ChooseChildren.Items.Add(child, selectAll ?? true);
                }

                foreach (Member child in EnumerableChildren)
                {
                    ChooseChildren.Items.Add(child, selectAll ?? false);
                }
            }
            else
            {
                ChooseChildren.Items.Add("No available members. Add children of this member at first.", CheckState.Indeterminate);
            }
        }
Exemple #2
0
        private void UpdatePartnersComboBox()
        {
            EnumerablePartners = SourceFamily.GetEnumerableMembers().Where(
                m => m.Id != SourceMember.Id &&
                m.BirthDate <= SinceDateTime &&
                (m.DeathDate == null || SinceDateTime <= m.DeathDate) &&
                !m.Refs.PartnerId.Value(SinceDateTime).HasValue
                ).OrderBy(m => m.BirthDate - SourceMember.BirthDate);

            PartnersComboBox.Items.Clear();

            if (SourceMember.HadPartner(SinceDateTime))
            {
                PartnersComboBox.Items.Add("The partner that time");
            }
            else
            {
                PartnersComboBox.Items.Add("No partner selected");
            }

            PartnersComboBox.SelectedIndex = 0;

            foreach (Member member in EnumerablePartners)
            {
                PartnersComboBox.Items.Add(member);
            }
        }
Exemple #3
0
        private void UpdateUIMembersListBox()
        {
            EnumerableMembers = SourceFamily.GetEnumerableMembers();

            MembersListBox.Items.Clear();

            if (EnumerableMembers.Any())
            {
                foreach (Member member in EnumerableMembers)
                {
                    MembersListBox.Items.Add(member);
                }
            }
            else
            {
                MembersListBox.Items.Add("No available members.");
            }

            EditSelectedBtn.Enabled   = false;
            RemoveSelectedBtn.Enabled = false;
            TotalMembersValue.Text    = EnumerableMembers.Count().ToString();
        }