Exemplo n.º 1
0
        protected void BindDictionaryBranch(JsonTreeNode branch, Guid parentDict)
        {
            using (DictionaryProvider provider = new DictionaryProvider())
            {
                List<DictionaryTree> dicts = provider.GetDictionaryTreeList(parentDict, this.Roles);

                foreach (DictionaryTree dict in dicts)
                {
                    JsonTreeNode tempNode = new JsonTreeNode(dict.Name);
                    branch.children.Add(tempNode);
                    BindDictionaryBranch(tempNode, dict.ID);
                }
                if (!parentDict.Equals(Guid.Empty))
                {
                    DictionaryTree entity = provider.DictionaryTrees.SingleOrDefault(d => d.ID == parentDict);
                    List<DictionaryProperty> source = provider.GetAvailableDictionaryProperties(this.Roles, entity.DictionaryID);

                    foreach (DictionaryProperty prop in source)
                    {
                        JsonTreeNode tempNode = new JsonTreeNode(prop.Name);
                        tempNode.uid = String.Format("{0}_{1}", prop.Dictionary.TableName, prop.ColumnName);
                        tempNode.leaf = true;
                        branch.children.Add(tempNode);
                    }
                }
            }
        }
Exemplo n.º 2
0
 protected void BindPropertyTree()
 {
     JsonTreeNode rootProps = new JsonTreeNode("Свойства");
     using (DictionaryProvider provider = new DictionaryProvider())
     {
         List<Property> source = provider.GetAvailableProperties(this.Roles);
         foreach (Property prop in source)
         {
             JsonTreeNode tempNode = new JsonTreeNode(prop.Name);
             tempNode.leaf = true;
             tempNode.uid = prop.Alias;
             rootProps.children.Add(tempNode);
         }
     }
     jsonReponse.children.Add(rootProps);
 }
Exemplo n.º 3
0
 protected void BindDictionaryTree()
 {
     JsonTreeNode rootDicts = new JsonTreeNode("Словари");
     BindDictionaryBranch(rootDicts, Guid.Empty);
     jsonReponse.children.Add(rootDicts);
 }