Esempio n. 1
0
    protected void FillChangwatCombobox()
    {
        if (TambonHelper.ProvinceGeocodes == null)
        {
            TambonHelper.LoadGeocodeList();
        }

        cbx_changwat.Items.Clear();
        foreach (PopulationDataEntry lEntry in TambonHelper.ProvinceGeocodes)
        {
            cbx_changwat.Items.Add(new ListItem(lEntry.English, lEntry.Geocode.ToString()));
        }
    }
Esempio n. 2
0
    protected void cbx_changwat_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList   lSender   = sender as DropDownList;
        Int32          lGeocode  = Convert.ToInt32(lSender.SelectedValue);
        PopulationData lGeocodes = null;

        cbx_amphoe.Items.Clear();
        lGeocodes = TambonHelper.GetGeocodeList(lGeocode);
        foreach (PopulationDataEntry lEntry in lGeocodes.Data.SubEntities)
        {
            if (!lEntry.Obsolete)
            {
                cbx_amphoe.Items.Add(new ListItem(lEntry.English, lEntry.Geocode.ToString()));
            }
        }
    }
Esempio n. 3
0
        internal void SetUtmLocation(String value)
        {
            String   myValue  = TambonHelper.ReplaceThaiNumerals(value.ToUpper()).Trim();
            GeoPoint geoPoint = null;
            UtmPoint utmPoint = null;

            try
            {
                utmPoint       = UtmPoint.ParseUtmString(myValue);
                geoPoint       = new GeoPoint(utmPoint, _currentGeoDatum);
                geoPoint.Datum = GeoDatum.DatumWGS84();
                SetLocationValue(geoPoint, utmPoint);
            }
            catch (ArgumentException)
            {
            }
        }
Esempio n. 4
0
        internal void SetMgrsLocation(String value)
        {
            String   myValue  = TambonHelper.ReplaceThaiNumerals(value.ToUpper()).Trim();
            GeoPoint geoPoint = null;
            UtmPoint utmPoint = null;

            try
            {
                if (!TambonHelper.IsNumeric(value.Substring(0, 2)))
                {
                    value = ZoneForThailandMgrs(value) + value;
                }
                utmPoint       = UtmPoint.ParseMgrsString(value);
                geoPoint       = new GeoPoint(utmPoint, _currentGeoDatum);
                geoPoint.Datum = GeoDatum.DatumWGS84();
                SetLocationValue(geoPoint, utmPoint);
            }
            catch (ArgumentException)
            {
            }
        }