Exemple #1
0
        public IndividualItem(ConsolidatedList consolidated, XElement xelem) : this()
        {
            if (consolidated != null)
            {
                ConsolidatedList = consolidated;
                ConsListId       = consolidated.Id;
            }
            ;
            if (xelem != null && xelem.Name.LocalName == "INDIVIDUAL")
            {
                FillCommonInfo(xelem);

                SecondName  = xelem.Element(S("SECOND_NAME"))?.Value;
                ThirdName   = xelem.Element(S("THIRD_NAME"))?.Value;
                FourthName  = xelem.Element(S("FOURTH_NAME"))?.Value;
                Gender      = xelem.Element(S("GENDER"))?.Value;
                Nationality = xelem.Element(S("NATIONALITY2"))?.Value;
                SubmittedBy = xelem.Element(S("SUBMITTED_BY"))?.Value;


                Aliases   = xelem.Elements(S("INDIVIDUAL_ALIAS")).Select(s => new IndividualAlias(this, s)).Where(w => w.IsCorrect()).ToList();
                DOBs      = xelem.Elements(S("INDIVIDUAL_DATE_OF_BIRTH")).Select(s => new IndividualDOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                POBs      = xelem.Elements(S("INDIVIDUAL_PLACE_OF_BIRTH")).Select(s => new IndividualPOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Docs      = xelem.Elements(S("INDIVIDUAL_DOCUMENT")).Select(s => new IndividualDoc(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Addresses = xelem.Elements(S("INDIVIDUAL_ADDRESS")).Select(s => new Address(this, s)).Where(w => w != null && w.IsCorrect()).ToList();


                var titles        = xelem.Element(S("TITLE"));
                var designations  = xelem.Element(S("DESIGNATION"));
                var nationalities = xelem.Element(S("NATIONALITY"));

                if (titles != null)
                {
                    Titles.AddRange(titles.Elements().Select(s => new Title(this, s)).Where(w => w != null).ToList());
                }
                if (designations != null)
                {
                    Designations.AddRange(designations.Elements().Select(s => new Designation(this, s)).Where(w => w != null).ToList());
                }
                if (nationalities != null)
                {
                    Nationalities.AddRange(nationalities.Elements().Select(s => new Nationality(this, s)).Where(w => w != null).ToList());
                }


                FillLastDayUpdates(xelem.Element(S("LAST_DAY_UPDATED")));
            }
            ;
        }
        public EntityItem(ConsolidatedList consolidated, XElement xelem) : this()
        {
            if (consolidated != null)
            {
                ConsolidatedList = consolidated;
                ConsListId       = consolidated.Id;
            }
            ;
            if (xelem != null && xelem.Name.LocalName == "ENTITY")
            {
                FillCommonInfo(xelem);

                SubmittedOn = ParseXmlDateTime(xelem.Element(S("SUBMITTED_ON")));

                EntityAliases = xelem.Elements(S("ENTITY_ALIAS")).Select(s => new EntityAlias(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Addresses     = xelem.Elements(S("ENTITY_ADDRESS")).Select(s => new Address(this, s)).Where(w => w != null && w.IsCorrect()).ToList();

                FillLastDayUpdates(xelem.Element(S("LAST_DAY_UPDATED")));
            }
            ;
        }