Пример #1
0
        /// <summary>
        /// The ddl area_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void DdlAreaSelectedIndexChanged(object sender, EventArgs e)
        {
            ClearAndShowControl(ddlCity, lblCity, "город");
            if (Mode == KladrUserControlMode.Database)
            {
                ClearAndShowControl(ddlTown, lblTown, "населенный пункт");
                ClearAndShowControl(ddlStreet, lblStreet, "улицу");
            }
            else
            {
                ClearControl(ddlTown, "населенный пункт");
                ClearControl(ddlStreet, "улицу");
            }

            if (ddlArea.SelectedIndex != 0)
            {
                LoadCityByArea();
            }
            else
            {
                ClearAndShowAllControls();

                if (ddlSubject.SelectedIndex != 0)
                {
                    LoadAreasByProvince();
                }
            }

            SetPostcode();
            UpdatePanelKLADR.Update();
        }
Пример #2
0
        /// <summary>
        /// The ddl street_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void DdlStreetSelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlStreet.SelectedIndex != 0)
            {
                if (ddlArea.SelectedIndex == 0)
                {
                    lblArea.Visible = false;
                    ddlArea.Visible = false;
                }

                if (ddlCity.SelectedIndex == 0)
                {
                    lblCity.Visible = false;
                    ddlCity.Visible = false;
                }

                if (ddlTown.SelectedIndex == 0)
                {
                    lblTown.Visible = false;
                    ddlTown.Visible = false;
                }
            }
            else
            {
                if (ddlArea.SelectedIndex != 0)
                {
                    lblArea.Visible = true;
                    ddlArea.Visible = true;
                    lblTown.Visible = true;
                    ddlTown.Visible = true;
                }
                else
                {
                    lblCity.Visible = true;
                    ddlCity.Visible = true;
                }
            }

            SetPostcode();
            UpdatePanelKLADR.Update();
        }
Пример #3
0
        /// <summary>
        /// The ddl town_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void DdlTownSelectedIndexChanged(object sender, EventArgs e)
        {
            if (Mode == KladrUserControlMode.Database)
            {
                ClearAndShowControl(ddlStreet, lblStreet, "улицу");
            }
            else
            {
                ClearControl(ddlStreet, "улицу");
            }

            if (ddlTown.SelectedIndex != 0)
            {
                LoadStreetsByTown();
            }
            else
            {
                LoadStreetsByCity();
            }

            SetPostcode();
            UpdatePanelKLADR.Update();
        }
Пример #4
0
        /// <summary>
        /// The ddl subject_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void DdlSubjectSelectedIndexChanged(object sender, EventArgs e)
        {
            ClearAndShowAllControls();

            if (ddlSubject.SelectedIndex != 0)
            {
                LoadAreasByProvince();

                // Спец. Случай для Москвы и Питера
                // загружаем их же в поле "Населенный пункт"
                var obj = addressService.GetAddress(new Guid(ddlSubject.SelectedValue));
                if (obj != null && !string.IsNullOrEmpty(obj.Okato))
                {
                    if (obj.Okato == MoscowOkato || obj.Okato == StPetersburgOkato)
                    {
                        ddlTown.Items.Add(new ListItem(obj.Name + " " + obj.Socr, obj.Id.ToString()));
                        ddlTown.SelectedValue = obj.Id.ToString();
                    }
                }
            }

            SetPostcode();
            UpdatePanelKLADR.Update();
        }
Пример #5
0
        /// <summary>
        /// The ddl city_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void DdlCitySelectedIndexChanged(object sender, EventArgs e)
        {
            if (Mode == KladrUserControlMode.Database)
            {
                ClearAndShowControl(ddlTown, lblTown, "населенный пункт");
                ClearAndShowControl(ddlStreet, lblStreet, "улицу");
            }
            else
            {
                ClearControl(ddlTown, "населенный пункт");
                ClearControl(ddlStreet, "улицу");
            }

            if (ddlCity.SelectedIndex != 0)
            {
                // lblArea.Visible = false;
                // ddlArea.Visible = false;
                LoadTownsByCity();
            }
            else
            {
                // lblArea.Visible = true;
                // ddlArea.Visible = true;
                if (ddlArea.SelectedIndex != 0)
                {
                    LoadTownsByArea();
                }
                else
                {
                    LoadStreetsByProvince();
                }
            }

            SetPostcode();
            UpdatePanelKLADR.Update();
        }