Esempio n. 1
0
        public void AddChild(S_T_EngineeringSpaceRes child)
        {
            var entities = this.GetDbContext <BaseConfigEntities>();

            if (String.IsNullOrEmpty(child.ID))
            {
                child.ID = Formula.FormulaHelper.CreateGuid();
            }
            child.ParentID = this.ID;
            child.FullID   = this.FullID + "." + child.ID;
            entities.Set <S_T_EngineeringSpaceRes>().Add(child);
        }
Esempio n. 2
0
        public void Save()
        {
            var root = this.S_T_EngineeringSpaceRes.FirstOrDefault(d => d.Type == SpaceNodeType.Root.ToString());

            if (root == null)
            {
                root          = new S_T_EngineeringSpaceRes();
                root.ID       = Formula.FormulaHelper.CreateGuid();
                root.FullID   = root.ID;
                root.ParentID = "";
                this.S_T_EngineeringSpaceRes.Add(root);
            }
            root.Name      = this.Name;
            root.SortIndex = 0;
            root.Code      = this.Code;
            root.Type      = SpaceNodeType.Root.ToString();
        }