public static String InitializeTree(String orgid)
        {
            List <EasyUITreeNode>      TreeNodes          = new List <EasyUITreeNode>();
            List <CBOM_CATALOG_RECORD> CBOMCatalogRecords = GetCBOMCatalogTreeByRootId(orgid);
            List <CBOM_CATALOG_RECORD> RootRecord         = (from q in CBOMCatalogRecords where q.LEVEL == 1 select q).ToList();

            if (RootRecord.Count == 1)
            {
                EasyUITreeNode RootTreeNode = new EasyUITreeNode(RootRecord.First().ID, RootRecord.First().ID, RootRecord.First().CATALOG_NAME, "", RootRecord.First().HIE_ID, "", 0, 0, 1, 0, 0, 0, 0);
                RootTreeNode.csstype = NodeCssType.Tree_Node_Root;
                CBOMCatalogRecordsToEasyUITreeNode(CBOMCatalogRecords, RootTreeNode);
                TreeNodes.Add(RootTreeNode);
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(TreeNodes));
        }
        public static void CBOMCatalogRecordsToEasyUITreeNode(List <CBOM_CATALOG_RECORD> CBOMCatalogRecords, EasyUITreeNode CurrentNode)
        {
            String CurrentNodeHieId = CurrentNode.hieid;
            List <CBOM_CATALOG_RECORD> SubRecord = (from q in CBOMCatalogRecords where q.PAR_HIE_ID == CurrentNodeHieId orderby q.SEQ_NO select q).ToList();

            if (SubRecord.Count == 0)
            {
                return;
            }

            foreach (CBOM_CATALOG_RECORD SubRecord_loopVariable in SubRecord)
            {
                EasyUITreeNode SubTreeNode = new EasyUITreeNode(SubRecord_loopVariable.ID, SubRecord_loopVariable.VIRTUAL_ID, SubRecord_loopVariable.CATALOG_NAME, CurrentNode.id, SubRecord_loopVariable.HIE_ID, SubRecord_loopVariable.CATALOG_DESC, (int)SubRecord_loopVariable.CATALOG_TYPE, SubRecord_loopVariable.SEQ_NO, SubRecord_loopVariable.QTY, 0, 0, 0, 0);

                switch (SubRecord_loopVariable.CATALOG_TYPE)
                {
                case CategoryTypes.Category:
                    SubTreeNode.csstype = NodeCssType.Tree_Node_Category;
                    break;

                case CategoryTypes.Component:
                    SubTreeNode.csstype = NodeCssType.Tree_Node_Component;
                    break;

                case CategoryTypes.Root:
                    SubTreeNode.csstype = NodeCssType.Tree_Node_Root;
                    break;

                default:
                    break;
                }

                CurrentNode.children.Add(SubTreeNode);
                CBOMCatalogRecordsToEasyUITreeNode(CBOMCatalogRecords, SubTreeNode);
            }
        }
Exemple #3
0
 public UpdateDBResult()
 {
     IsUpdated     = true;
     ServerMessage = "";
     Node          = new EasyUITreeNode();
 }