Exemplo n.º 1
0
        public Dictionary <PopulationDataEntry, PopulationDataEntry> DifferentMubanNames(PopulationDataEntry changwat)
        {
            var RetVal = new Dictionary <PopulationDataEntry, PopulationDataEntry>();

            PopulationData      geocodes        = TambonHelper.GetGeocodeList(changwat.Geocode);
            PopulationDataEntry currentChangwat = geocodes.Data;

            foreach (PopulationDataEntry currentAmphoe in currentChangwat.SubEntities)
            {
                foreach (PopulationDataEntry currentTambon in currentAmphoe.SubEntities)
                {
                    foreach (PopulationDataEntry currentMuban in currentTambon.SubEntities)
                    {
                        if (currentMuban.Type == EntityType.Muban)
                        {
                            PopulationDataEntry mubanDopa = changwat.FindByCode(currentMuban.Geocode);
                            if (mubanDopa != null)
                            {
                                if (!TambonHelper.IsSameMubanName(mubanDopa.Name, currentMuban.Name))
                                {
                                    RetVal.Add(currentMuban, mubanDopa);
                                }
                            }
                        }
                    }
                }
            }
            return(RetVal);
        }