Ejemplo n.º 1
0
        public bool Show(bool exceptHouses = false)
        {
            var card   = new FiasCard(ConnectionString);
            var splash = new FiasSplash();

            splash.Show();
            Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
            card.Model.Open(guid, kladr);

            if (exceptHouses)
            {
                card.HouseGroup.Visibility = Visibility.Collapsed;
                card.Model.SelectedHouse   = null;
            }

            splash.Close();
            card.ShowDialog();

            var dialogResult = card.DialogResult ?? false;

            if (!dialogResult)
            {
                return(dialogResult);
            }
            var result = card.Model.GetBottomSelectedItem();

            if (result == null)
            {
                return(dialogResult);
            }
            guid  = result.Id;
            kladr = result.KladrId;
            level = result.Level;

            Details.Region = card.Model.SelectedRegion;
            Details.Auto   = card.Model.SelectedAuto;
            Details.Area   = card.Model.SelectedArea;
            Details.City   = card.Model.SelectedCity;
            Details.Ctar   = card.Model.SelectedCtar;
            Details.Place  = card.Model.SelectedPlace;
            Details.Street = card.Model.SelectedStreet;
            Details.House  = card.Model.SelectedHouse;
            return(dialogResult);
        }
Ejemplo n.º 2
0
        public bool Show(bool exceptHouses = false)
        {
            var card = new FiasCard(ConnectionString);
            var splash = new FiasSplash();
            splash.Show();
            Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { }));
            card.Model.Open(guid, kladr);

            if (exceptHouses)
            {
                card.HouseGroup.Visibility = Visibility.Collapsed;
                card.Model.SelectedHouse = null;
            }

            splash.Close();
            card.ShowDialog();

            var dialogResult = card.DialogResult ?? false;
            if (!dialogResult) return dialogResult;
            var result = card.Model.GetBottomSelectedItem();
            if (result == null) return dialogResult;
            guid = result.Id;
            kladr = result.KladrId;
            level = result.Level;

            Details.Region = card.Model.SelectedRegion;
            Details.Auto = card.Model.SelectedAuto;
            Details.Area = card.Model.SelectedArea;
            Details.City = card.Model.SelectedCity;
            Details.Ctar = card.Model.SelectedCtar;
            Details.Place = card.Model.SelectedPlace;
            Details.Street = card.Model.SelectedStreet;
            Details.House = card.Model.SelectedHouse;
            return dialogResult;
        }