Exemple #1
0
        public void LoadTree(string caseId)
        {
            //DataSet ds = tbCaseDAO.GetDataSet("select * from TSModule", null);
            var caseTypes = new TBCaseDAO().GetCaseTypeIdHash(caseId);
            List <Tree <TBEnforcementType> > list = new List <Tree <TBEnforcementType> >();

            //List<Tree<TSModule>> list = new List<Tree<TSModule>>(1);
            //Tree<TSModule> treeNode = new Tree<TSModule>();
            //treeNode.text = "系统平台模块";//节点名称
            //TSModule tsModule = new TSModule();
            //tsModule.moduleId = "0";//模块编号
            //tsModule.moduleCode = "";//模块代码
            //tsModule.moduleName = "";//模块名称
            //tsModule.moduleURL = "";//模块URL
            //tsModule.imgClass = "";//模块图片样式
            //tsModule.parentId = "";//父模块编号("0"代表无父模块)
            //tsModule.moduleLayer = 0;//模块所属层次
            //tsModule.moduleIndex = 0;//模块索引
            //treeNode.attributes = tsModule;
            //AddNode(treeNode, ds, roleRight);//遍历子模块
            //list.Add(treeNode);
            foreach (var item in caseTypes)
            {
                var caseType = new Tree <TBEnforcementType>()
                {
                    attributes = new TBEnforcementType()
                    {
                        EnforcementTypeId = item.EnforcementTypeId
                    },
                    text = item.EnforcementTypeName
                };
                list.Add(caseType);
            }
            WebJson.ToJson(context, list);
        }
Exemple #2
0
        public void ReadOnlyTreeLoad(string caseId)
        {
            var caseTypes = new TBCaseDAO().GetCaseEnforcementTemplateHash(caseId);
            List <Tree <TBEnforcementTemplate> > list = new List <Tree <TBEnforcementTemplate> >();

            foreach (var item in caseTypes)
            {
                var template = new Tree <TBEnforcementTemplate>()
                {
                    attributes = new TBEnforcementTemplate()
                    {
                        TemplateCode = item.TemplateCode, TemplateName = item.TemplateName
                    },
                    text = item.TemplateName
                };
                list.Add(template);
            }
            WebJson.ToJson(context, list);
        }