コード例 #1
0
        protected void CountryChanged(object sender, EventArgs e)
        {
            //LOAD PROVINCES FOR SELECTED COUNTRY
            int provincesCount = ProvinceDataSource.CountForCountry(CountryFilter.SelectedValue);

            //WE WANT TO SHOW THE DROP DOWN IF THE COUNTRY HAS BEEN CHANGED BY THE CLIENT
            //AND ALSO IF PROVINCES ARE AVAILABLE FOR THIS COUNTRY
            if (provincesCount > 0)
            {
                Province.Visible  = false;
                Province2.Visible = true;
                Country county = CountryDataSource.Load(CountryFilter.SelectedValue);
                if (county != null)
                {
                    Province2.Items.Clear();
                    Province2.Items.Add(new ListItem("All Provinces", ""));
                    Province2.DataSource = county.Provinces;
                    Province2.DataBind();
                }
            }
            else
            {
                //WE ONLY WANT A TEXTBOX TO SHOW
                //REQUIRE THE TEXTBOX IF THERE ARE PROVINCES
                Province.Visible  = true;
                Province2.Visible = false;
            }
        }
コード例 #2
0
        protected void OnCountryDataBound(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string   warehouseCountry = AbleContext.Current.Store.DefaultWarehouse.CountryCode;
                ListItem defaultCountry   = CountryFilter.Items.FindByValue(warehouseCountry);
                if (defaultCountry != null)
                {
                    CountryFilter.SelectedIndex = CountryFilter.Items.IndexOf(defaultCountry);
                }
            }

            Country county = CountryDataSource.Load(CountryFilter.SelectedValue);

            if (county != null)
            {
                Province2.Visible = county.Provinces.Count > 0;
                if (Province2.Visible)
                {
                    Province2.Items.Clear();
                    Province2.Items.Add(new ListItem("All Provinces", ""));
                    Province2.DataSource = county.Provinces;
                    Province2.DataBind();
                }

                Province.Visible = !Province2.Visible;
            }

            if (!Page.IsPostBack)
            {
                string warehouseProvince = AbleContext.Current.Store.DefaultWarehouse.Province;
                if (county.Provinces.Count > 0)
                {
                    ListItem defaultProvince = Province2.Items.FindByValue(warehouseProvince);
                    if (defaultProvince != null)
                    {
                        Province2.SelectedIndex = Province2.Items.IndexOf(defaultProvince);
                    }
                }
                else
                {
                    Province.Text = warehouseProvince;
                }
            }
        }
コード例 #3
0
ファイル: Class2.cs プロジェクト: mallechilie/EU0.0
 public Tile2(Province2 province2)
 {
     TileGroup = province2;
 }
コード例 #4
0
ファイル: Class2.cs プロジェクト: mallechilie/EU0.0
 public Nation2(Province2 province, Map2 map)
 {
     Tiles     = new[] { province };
     tileGroup = map;
 }