Пример #1
0
        /// <summary>
        /// 移动模块分类。
        /// </summary>
        /// <param name="Id">模块分类Id。</param>
        /// <param name="newParentModuleTypeId">新的父模块分类Id。</param>
        public static void MoveModuleType(string Id, string newParentId)
        {
            Db.SessionFactory.EvictQueries("ModuleType");

            ModuleType mt = Db.Session.Load(typeof(ModuleType), Id) as ModuleType;

            ModuleType newParent = null;

            if (newParentId != null && newParentId.Length > 0)
            {
                newParent = Db.Session.Load(typeof(ModuleType), newParentId) as ModuleType;
            }

            mt.MoveTo(newParent);

            Db.TransUpdate(mt);
        }