/// <summary>
        /// 用户更新用户名
        /// </summary>
        /// <param name="session"></param>
        /// <param name="user"></param>
        /// <param name="newName"></param>
        /// <param name="currentAccountNo"></param>
        /// <returns></returns>
        public static bool UpdateName(Session session, User user, string newName, string currentAccountNo)
        {
            if (string.IsNullOrEmpty(newName)) throw new ArgumentNullException("newName");
            if (newName.Equals(user.Name)) return true;

            var account = session.Load<Account>(m => m.Name.Equals(user.Name));
            if(account == null) throw  new ArgumentException(string.Format("用户{0}不存在", user.Name), "user");

            account.Name = newName;
            user.Name = newName;

            return session.Update(user) &&
                   session.Update(account) &&
                   user.Deactive(session, currentAccountNo);
        }