Beispiel #1
0
        private void FillThisNode(Reporting.Entity entity, ref TreeNode node, bool isClassifier, string countInstance, bool isObjects = false)
        {
            var  entityID   = entity.ID.ToString();
            bool isExpanded = false;
            var  href       = string.Concat(GetLeftUrl, string.Concat("EntityListAttributeView.aspx?entity=", entityID));

            if (isClassifier)
            {
                href = string.Concat(href, "&checker=isClassifier");
            }

            if (entity.IsHierarchic && isObjects)
            {
                if (Request.Path == "/monitoring/EntityListAttributeView.aspx") // && Request["entity"].ToString() == entityID)
                {
                    Session["PathRightNavi"] = Request.Url.Query;
                }

                if (Session["PathRightNavi"] != null)
                {
                    href = string.Concat(GetLeftUrl, string.Concat("EntityListAttributeView.aspx", Session["PathRightNavi"].ToString()));
                }
            }
            var cssClass = "navigationTagA";

            if (entityID == SelectedEntity && !string.IsNullOrEmpty(entityID)) // <-- Если мы хотим знать на какой находимся Entity , если зашли 'глубже' по TreeView
            {
                isExpanded = true;
                if ((Request["entity"] == null ? "" : Request["entity"].ToString()) == entityID)
                {
                    cssClass = "item_selected";

                    //Обнуляем  пару ConstrID and InstanceID, если ненаходимся в карточке и главном ноде Мониторинга
                    if (!data.isDynamicCard && Request.Path == "/monitoring/EntityListAttributeView.aspx" && !isObjects)
                    {
                        LeftTreeNode.collection = HashCollection = new Hashtable();
                    }
                }
            }

            //Отмечаем как выбранный Node в навигации по объектам
            if (isObjects)
            {
                cssClass   = "item_selected";
                isExpanded = true;
            }

            node.Text = string.Concat("<span title='", countInstance,
                                      "'><a href='", href,
                                      "' class='", cssClass,
                                      "'>", entity.Name, "</a></span>");
            node.SelectAction = TreeNodeSelectAction.None;
            node.Expanded     = isExpanded;
        }
Beispiel #2
0
        private void FilledNavigationNode(Reporting.Entity entity, ref TreeNode node)
        {
            string parentID = entity.ID.ToString();

            foreach (DataRow row in LeftTreeNode.MainTable.Rows)
            {
                var parentID1 = row["parentID"];
                var parentID2 = parentID;
                var showAll   = ShowAllNavigation.Checked == true ? true : Convert.ToBoolean(row["isIdentified"]); //row["isIdentified"].ToString() == "1"
                var isIdent   = row["isIdentified"];

                if (row["parentID"].ToString() == parentID && (ShowAllNavigation.Checked == true ? true : Convert.ToBoolean(row["isIdentified"])))
                //Последняя проверка в if-е учитывает ChechBox(Показать все, показать в организациях подчиненные организации) т.е. не учитывать флаг  isIdentified или учитывать
                {
                    var instanceID = GetInstanceID(parentID, row["childID"].ToString());

                    var collectionNodes = LeftTreeNode.BuildChildNodes(row, instanceID);
                    LeftTreeNode.FillNode(collectionNodes, ref node);
                }
            }
            HashCollection = LeftTreeNode.collection;
        }
        private void FillThisNode(Reporting.Entity entity, ref TreeNode node, string countInstance)
        {
            var  entityID   = entity.ID.ToString();
            bool isExpanded = false;
            var  href       = string.Concat(GetLeftUrl, string.Concat("EntityListAttributeView.aspx?entity=", entityID));

            if (entity.IsHierarchic)
            {
                if (Request.Path == "/monitoring/EntityListAttributeView.aspx") // && Request["entity"].ToString() == entityID)
                {
                    Session["PathRightNavi"] = Request.Url.Query;
                }

                if (Session["PathRightNavi"] != null)
                {
                    href = string.Concat(GetLeftUrl, string.Concat("EntityListAttributeView.aspx", Session["PathRightNavi"].ToString()));
                }
            }
            var cssClass = "navigationTagA";

            if (entityID == SelectedEntity && !string.IsNullOrEmpty(entityID)) // <-- Если мы хотим знать на какой находимся Entity , если зашли 'глубже' по TreeView
            {
                isExpanded = true;
                if ((Request["entity"] == null ? "" : Request["entity"].ToString()) == entityID)
                {
                    cssClass = "object_item_selected";
                }
            }

            cssClass   = "object_item_selected";
            isExpanded = true;

            node.Text = string.Concat("<span title='", countInstance,
                                      "'><a href='", href,
                                      "' class='", cssClass,
                                      "'>", entity.Name, "</a></span>");
            node.SelectAction = TreeNodeSelectAction.None;
            node.Expanded     = isExpanded;
        }