Пример #1
0
        //public event EventHandler<AdvanceOrRawArg> SearchDataDefined;

        //void SearchView_CommandExecuted(object sender, Arg_CommandExecuted e)
        //{
        //    (e.Command as I_Command).Execute(this);
        //}
        public void SetAreaInitializer(SearchEntityAreaInitializer newAreaInitializer)
        {
            SearchInitializer = newAreaInitializer;

            SearchView          = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateViewOfSearchEntityArea();
            RawSearchEntityArea = new RawSearchEntityArea();
            RawSearchEntityArea.SetAreaInitializer(newAreaInitializer);
            RawSearchEntityArea.SearchDataDefined += RawSearchEntityArea_SearchDataDefined;
            SearchView.AddSimpleSearchView(RawSearchEntityArea.RawSearchView);


            AdvancedSearchEntityAre = new AdvancedSearchEntityArea();
            AdvancedSearchEntityAre.SetAreaInitializer(newAreaInitializer);
            AdvancedSearchEntityAre.SearchDataDefined += AdvancedSearchEntityAre_SearchDataDefined;
            SearchView.AddAdvancedSearchView(AdvancedSearchEntityAre.AdvancedSearchView);

            if (newAreaInitializer.EditSearchRepository != null)
            {
                if (newAreaInitializer.EditSearchRepository.Phrases.Any(x => !(x is SearchProperty)))
                {
                    SearchView.ActivateAdvancedView();
                }
                else
                {
                    SearchView.ActivateRawView();
                }
            }
        }
        //List<UIControlPackageTree> uiControlPackageTree { set; get; }


        //AssignedPermissionDTO _Permission;
        //public AssignedPermissionDTO Permission
        //{
        //    get
        //    {
        //        if (_Permission == null)
        //            _Permission = AgentUICoreMediator.GetAgentUICoreMediator.SecurityHelper.GetAssignedPermissions(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(), SearchInitializer.EntityID, true);
        //        return _Permission;
        //    }
        //}
        public void SetAreaInitializer(SearchEntityAreaInitializer newAreaInitializer)
        {
            SearchInitializer = newAreaInitializer;
            //if (SearchInitializer.TempEntity != null)
            //    _FullEntity = SearchInitializer.TempEntity;
            GenerateSearchView();
        }
        public void SetAreaInitializer(SearchEntityAreaInitializer newAreaInitializer)
        {
            SearchInitializer = newAreaInitializer;

            SearchView                        = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateViewOfSearchEntityArea();
            SimpleSearchEntityArea            = new SimpleSearchEntityArea();
            newAreaInitializer.SearchEntityID = newAreaInitializer.SearchEntityID;
            SimpleSearchEntityArea.SetAreaInitializer(newAreaInitializer);
            SimpleSearchEntityArea.SearchDataDefined += SimpleSearchEntityArea_SearchDataDefined;
            SearchView.AddSimpleSearchView(SimpleSearchEntityArea.SimpleSearchView);

            AdvancedSearchEntityAre = new AdvancedSearchEntityArea();
            AdvancedSearchEntityAre.SetAreaInitializer(newAreaInitializer);
            AdvancedSearchEntityAre.SearchDataDefined += SimpleSearchEntityArea_SearchDataDefined;
            SearchView.AddAdvancedSearchView(AdvancedSearchEntityAre.AdvancedSearchView);
            //if (newAreaInitializer.PreDefinedSearch != null && newAreaInitializer.EditSearchRepository != null)
            //    throw new Exception("sdfsbvxzcv");

            //بررسی شود دوتاشون میتونن باشن یا خطا باید بده
            //if (newAreaInitializer.PreDefinedSearch != null)
            //{
            //    newAreaInitializer.EditSearchRepository = newAreaInitializer.PreDefinedSearch;
            //}
            if (newAreaInitializer.PreDefinedSearch != null)
            {
                ShowSearchRepository(newAreaInitializer.PreDefinedSearch);
            }
        }
        private SearchEntityArea GenereateSearchArea()
        {
            var searchEntityArea      = new SearchEntityArea();
            var searchViewInitializer = new SearchEntityAreaInitializer();

            searchViewInitializer.EntityID   = AreaInitializer.EntityID;
            searchViewInitializer.TempEntity = AreaInitializer.TempEntity;
            searchEntityArea.SetAreaInitializer(searchViewInitializer);
            //searchEntityArea.GenerateSearchView();
            return(searchEntityArea);
        }
        private void Relationship_ClickedNew(object sender1, EventArgs e1, AdvanceSearchNode node, RelationshipDTO relationship)
        {
            SearchEntityArea advancedAndRaw = new EntityArea.SearchEntityArea();
            var searchViewInitializer       = new SearchEntityAreaInitializer();

            searchViewInitializer.EntityID           = relationship.EntityID2;
            searchViewInitializer.Title              = relationship.Alias;
            searchViewInitializer.SourceRelationship = relationship;
            advancedAndRaw.SearchDataDefined        += (sender, e) => AdvancedAndRaw_SearchDataDefinedNew(sender, e, relationship, node, advancedAndRaw.SearchView);
            advancedAndRaw.SetAreaInitializer(searchViewInitializer);
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(advancedAndRaw.SearchView, searchViewInitializer.Title, Enum_WindowSize.Big);
        }
        //Tuple<int,>
        //  object lastSearchView;
        private void RootAndMenu_Clicked1(object sender1, EventArgs e1, AdvanceSearchNode andOrNode)
        {
            I_RawSearchEntityArea rawSearchEntityArea = new RawSearchEntityArea();
            var searchViewInitializer = new SearchEntityAreaInitializer();

            searchViewInitializer.EntityID = SearchInitializer.EntityID;
            //if (SearchInitializer.TempEntity != null && SearchInitializer.TempEntity.ID == SearchInitializer.EntityID)
            //    searchViewInitializer.TempEntity = SearchInitializer.TempEntity;
            rawSearchEntityArea.SetAreaInitializer(searchViewInitializer);
            rawSearchEntityArea.SearchDataDefined += (sender, e) => RawSearchEntityArea_SearchDataDefined(sender, e, andOrNode, rawSearchEntityArea.RawSearchView);
            //lastSearchView = rawSearchEntityArea.RawSearchView;
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(rawSearchEntityArea.RawSearchView, "خصوصیات", Enum_WindowSize.Big);
        }
        private void Relationship_ClickedEdit(object sender1, EventArgs e1, AdvanceSearchNode node, DP_SearchRepository dP_SearchRepository)
        {
            SearchEntityArea advancedAndRaw = new EntityArea.SearchEntityArea();
            var searchViewInitializer       = new SearchEntityAreaInitializer();

            searchViewInitializer.PreDefinedSearch   = dP_SearchRepository;
            searchViewInitializer.EntityID           = dP_SearchRepository.TargetEntityID;
            searchViewInitializer.Title              = dP_SearchRepository.Title;
            searchViewInitializer.SourceRelationship = dP_SearchRepository.SourceRelationship;
            advancedAndRaw.SearchDataDefined        += (sender, e) => AdvancedAndRaw_SearchDataDefinedEdit(sender, e, node, advancedAndRaw.SearchView);
            advancedAndRaw.SetAreaInitializer(searchViewInitializer);
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(advancedAndRaw.SearchView, searchViewInitializer.Title, Enum_WindowSize.Big);
        }