public GraphRelation(GraphItem item1, GraphItem item2) { Item1 = item1; Item2 = item2; }
private GraphItemGroups GetIncludedGraphItems(EntityRelationshipTailDTO relationshipTail, GraphDTO selectedGraph, DP_DataView relationshipFirstData, int level , EntityRelationshipTailDataMenuDTO relationshipTailDataMenuDTO, GraphItem parentGraphItem = null, GraphItemGroups result = null, List <GraphItem> allItems = null) { if (result == null) { result = new GraphItemGroups(); } if (relationshipTail != null) { RelationshipTailDataManager relationshipTailDataManager = new RelationshipTailDataManager(); //var firstData = new DP_DataRepository(); //firstData.TargetEntityID = FirstData.TargetEntityID; //firstData.DataView = FirstData; //foreach (var key in FirstData.KeyProperties) //{ // firstData.AddProperty(new ColumnDTO() { ID = key.ColumnID }, key.Value); //} var searchDataTuple = AgentUICoreMediator.GetAgentUICoreMediator.RelationshipDataManager.GetSecondSideSearchDataItemByRelationship(relationshipFirstData, relationshipTail.Relationship.ID); //var searchPhraseToOtherData = relationshipTailDataManager.GetTargetSearchItemFromRelationshipTail(targetData, relationshipTail.ChildTail.ReverseRelationshipTail); //searchDataTuple.Phrases.AddRange(searchPhraseToOtherData.Phrases); var requester = AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(); //سکوریتی داده اعمال میشود var searchRequest = new DR_SearchViewRequest(requester, searchDataTuple); //searchRequest.EntityID = parentTail.RelationshipTargetEntityID; var searchResult = AgentUICoreMediator.GetAgentUICoreMediator.requestRegistration.SendSearchViewRequest(searchRequest); if (parentGraphItem != null) { parentGraphItem.TailPath = relationshipTail.RelationshipIDPath; if (relationshipTailDataMenuDTO != null) { if (relationshipTailDataMenuDTO.Items.Any(x => x.Path == parentGraphItem.TailPath)) { parentGraphItem.DataMenuID = relationshipTailDataMenuDTO.Items.First(x => x.Path == parentGraphItem.TailPath).DataMenuSettingID; } } } if (searchResult.Result == Enum_DR_ResultType.SeccessfullyDone) { foreach (var item in searchResult.ResultDataItems) { GraphItem found = null; if (allItems == null) { allItems = new List <GraphItem>(); } else { if (selectedGraph.NotJointEntities == true) { if (allItems.Any(x => AgentHelper.DataItemsAreEqual(item, x.DataItem))) { var fItem = allItems.First(x => AgentHelper.DataItemsAreEqual(item, x.DataItem)); found = fItem; } } } if (found == null) { found = new GraphItem(); found.DataItem = item; found.Level = level; result.Items.Add(found); allItems.Add(found); } if (parentGraphItem != null) { result.Relations.Add(new GraphRelation(parentGraphItem, found)); } GetIncludedGraphItems(relationshipTail.ChildTail, selectedGraph, item, level + 1, relationshipTailDataMenuDTO, found, result); } } else { AgentUICoreMediator.GetAgentUICoreMediator.UIManager.ShowInfo(searchResult.Message, searchResult.Details, MyUILibrary.Temp.InfoColor.Red); } } return(result); }