示例#1
0
        public void ReorderThesaban()
        {
            foreach (var subEntity in entity)
            {
                if (subEntity != null)
                {
                    if (subEntity.type.IsLocalGovernment() | subEntity.type.IsSakha())
                    {
                        _thesaban.Add(subEntity);
                    }
                }
            }
            foreach (var thesaban in _thesaban)
            {
                entity.Remove(thesaban);
            }

            // set the population data type of the non-municipal items
            PopulationDataType nonThesabanType = PopulationDataType.total;

            if (_thesaban.Any())
            {
                nonThesabanType = PopulationDataType.nonmunicipal;
            }
            foreach (var amphoe in entity)
            {
                foreach (var entry in amphoe.FlatList())
                {
                    if (entry.population.Any())
                    {
                        var data = entry.population.First().data.FirstOrDefault();
                        if (data != null)
                        {
                            data.type = nonThesabanType;
                        }
                    }
                }
            }

            foreach (var thesaban in _thesaban)
            {
                if (thesaban.entity.Any())
                {
                    foreach (var tambon in thesaban.entity)
                    {
                        var data = tambon.population.First().data.First();
                        data.type    = PopulationDataType.municipal;
                        data.geocode = thesaban.geocode;
                        AddTambonInThesabanToAmphoe(tambon, thesaban);
                    }
                }
            }
            foreach (var subEntity in entity)
            {
                if (subEntity != null)
                {
                    subEntity.entity.Sort((x, y) => x.geocode.CompareTo(y.geocode));
                }
            }
        }
示例#2
0
 /// <summary>
 /// Creates a new instance of HouseholdDataPoint.
 /// </summary>
 public HouseholdDataPoint()
 {
     this.agetableField   = new AgeTable();
     this.dataField       = new List <HouseholdDataPoint>();
     this.typeField       = PopulationDataType.undefined;
     this.householdsField = 0;
     this.geocodeField    = ((uint)(0));
 }
示例#3
0
 /// <summary>
 /// Creates a new instance of HouseholdDataPoint.
 /// </summary>
 public HouseholdDataPoint()
 {
     this.geocodeField       = new List <uint>();
     this.movingField        = new PopulationDataPoint();
     this.houseregisterField = new PopulationDataPoint();
     this.foreignerField     = new PopulationDataPoint();
     this.agetableField      = new AgeTable();
     this.dataField          = new List <HouseholdDataPoint>();
     this.typeField          = PopulationDataType.undefined;
     this.householdsField    = 0;
 }
 /// <summary>
 /// Creates a new instance of HouseholdDataPoint.
 /// </summary>
 public HouseholdDataPoint() {
     this.agetableField = new AgeTable();
     this.dataField = new List<HouseholdDataPoint>();
     this.typeField = PopulationDataType.undefined;
     this.householdsField = 0;
     this.geocodeField = ((uint)(0));
 }