Esempio n. 1
0
        public virtual void Explore(ExploreOptions options)
        {
            AssertFindable(options.QueryName);

            if (options.NavigateIfOne)
            {
                Lite <Entity> lite = DynamicQueryServer.QueryUnique(new UniqueOptions(options.QueryName)
                {
                    FilterOptions = options.FilterOptions,
                    UniqueType    = UniqueType.Only
                });

                if (lite != null)
                {
                    Navigator.Navigate(lite, new NavigateOptions {
                        Closed = options.Closed
                    });
                    return;
                }
            }

            Navigator.OpenIndependentWindow(() => CreateSearchWindow(options),
                                            afterShown: null,
                                            closed: options.Closed);
        }
Esempio n. 2
0
        public virtual Lite <Entity> Find(FindOptions options)
        {
            AssertFindable(options.QueryName);

            if (options.ReturnIfOne)
            {
                Lite <Entity> lite = DynamicQueryServer.QueryUnique(new UniqueOptions(options.QueryName)
                {
                    FilterOptions = options.FilterOptions,
                    UniqueType    = UniqueType.SingleOrMany
                });

                if (lite != null)
                {
                    return(lite);
                }
            }

            SearchWindow sw = CreateSearchWindow(options);

            sw.MultiSelection = false;

            if (sw.ShowDialog() == true)
            {
                return(sw.SelectedItem);
            }
            return(null);
        }
Esempio n. 3
0
        public override void Execute()
        {
            EvaluateFunValues();

            Lite <T> lite = DynamicQueryServer.QueryUnique <T>(FindUniqueOptions);

            if (lite == null)
            {
                MessageBox.Show(QuickLinkMessage.No0Found.NiceToString().ForGenderAndNumber(typeof(T).GetGender()).FormatWith(typeof(T).NiceName()));
                return;
            }

            if (NavigateOptions != null)
            {
                Navigator.Navigate(lite, NavigateOptions);
            }
            else
            {
                Navigator.Navigate(lite);
            }
        }