Example #1
0
        /// <summary>
        /// 移动角色分类。
        /// </summary>
        /// <param name="Id">角色分类Id。</param>
        /// <param name="newParentModuleTypeId">新的父角色分类Id。</param>
        public static void MoveRoleType(string Id, string newParentId)
        {
            Db.SessionFactory.EvictQueries("RoleType");

            RoleType rt = Db.Session.Load(typeof(RoleType), Id) as RoleType;

            RoleType newParent = null;

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

            rt.MoveTo(newParent);

            Db.TransUpdate(rt);
        }