Exemplo n.º 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")));
            }
            ;
        }
Exemplo n.º 2
0
        protected void lnkAddNew_Click(object sender, EventArgs e)
        {
            var designations = new Designations();

            lnkAddNew.Enabled = false;
            lnkAddNew.Style.Add("cursor", "Not-allowed");
            designations.AddRange(from GridViewRow gvRow in GridViewTable.Rows
                                  select new Designation
            {
                Id          = ((TextBox)gvRow.FindControl("txtCode")).Text,
                Description = ((TextBox)gvRow.FindControl("txtDescription")).Text,
                Level       = ((TextBox)gvRow.FindControl("txtAccess")).Text,
                Action      = Constants.UpdateAction
            });
            designations.Add(new Designation
            {
                Action = Constants.InsertAction
            });
            BindAccessLevel(designations);
        }