예제 #1
0
        private static int ResolveFormTypeCollection(List<FormType> dbFormTypes, FormType parentFormType, int level)
        {
            int count = 0;
            foreach (var formtype in dbFormTypes.Where(f => f.Parent == parentFormType))
            {
                count++;

                _formtypes.Add(formtype);
                formtype.TreeLevel = level;
                formtype.IsTreeLeaf = true;
                formtype.Enabled = true;

                level++;
                // 如果这个节点下没有子节点,则这是个终结节点
                int childCount = ResolveFormTypeCollection(dbFormTypes, formtype, level);
                if (childCount != 0)
                {
                    formtype.IsTreeLeaf = false;
                }
                level--;

            }

            return count;
        }
예제 #2
0
 public object Clone()
 {
     FormType formtype = new FormType
     {
         ID = ID,
         Name = Name,
         SortIndex = SortIndex,
         TreeLevel = TreeLevel,
         Enabled = Enabled,
         IsTreeLeaf = IsTreeLeaf
     };
     return formtype;
 }