private void ShowSearchArea()
        {
            int entitySearchID = lokEntitySearch.SelectedItem == null ? 0 : (int)lokEntitySearch.SelectedValue;

            //if (SearchEntityArea == null || SearchEntityArea.SearchInitializer.SearchEntityID != entitySearchID)
            //{
            SearchEntityArea = new SearchEntityArea();
            var searchViewInitializer = new SearchEntityAreaInitializer();

            searchViewInitializer.EntityID       = EntityID;
            searchViewInitializer.SearchEntityID = entitySearchID;
            SearchEntityArea.SetAreaInitializer(searchViewInitializer);
            grdSearch.Children.Clear();
            grdSearch.Children.Add(SearchEntityArea.SearchView as UIElement);
            //}

            SearchEntityArea.ShowSearchRepository(Message);
        }
        private void View_SearchCommandRequested(object sender, EventArgs e)
        {
            if (SearchEntityArea == null)
            {
                SearchEntityArea = new SearchEntityArea();
                var searchViewInitializer = new SearchEntityAreaInitializer();

                searchViewInitializer.EntityID = AreaInitializer.EntitiyID;
                //if (AreaInitializer.Entitiy==null)
                //{
                //    AreaInitializer.Entitiy = AgentUICoreMediator.GetAgentUICoreMediator.GetEntity(AreaInitializer.EntitiyID, EntityColumnInfoType.WithFullColumns, EntityRelationshipInfoType.WithRelationships, false, false);
                //}

                SearchEntityArea.SetAreaInitializer(searchViewInitializer);
                //SearchEntityArea.GenerateSearchView();
                SearchEntityArea.SearchDataDefined += SearchEntityArea_SearchDataDefined;
            }
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(SearchEntityArea.SearchView, "جستجو");
        }
Esempio n. 3
0
        private void EntitySearchLookup_SelectionChanged(object sender, SelectionChangedArg e)
        {
            if (e.SelectedItem != null)
            {
                var entity = e.SelectedItem as TableDrivedEntityDTO;
                SearchArea = new SearchEntityArea();
                var searchViewInitializer = new SearchEntityAreaInitializer();
                searchViewInitializer.EntityID = entity.ID;
                //searchViewInitializer.TempEntity = FullEntity;
                searchViewInitializer.PreDefinedSearch = AreaInitializer.PreDefinedSearch;
                if (AreaInitializer.PreDefinedSearch != null)
                {
                    searchViewInitializer.SearchEntityID = AreaInitializer.PreDefinedSearch.EntitySearchID;
                }

                SearchArea.SetAreaInitializer(searchViewInitializer);
                SearchArea.SearchDataDefined += SearchArea_SearchDataDefined;

                if (EntitySelected != null)
                {
                    EntitySelected(this, entity.ID);
                }
            }
            else
            {
                SearchArea = null;
                //if (SearchDataDefined != null)
                //    SearchDataDefined(this, null);

                if (EntitySelected != null)
                {
                    EntitySelected(this, null);
                }
                //View.RemoveDataSelector();
                //if (DataItemSelected != null)
                //    DataItemSelected(this, new EditAreaDataItemArg() { DataItem = null });
            }
        }