/// <summary>
        /// 修改模块(同时修改类型为1,对应权限的名称)
        /// </summary>
        /// <returns></returns>
        public void DoUpdate()
        {
            this.DoValidate();

            SysAuth[] auths = this.GetRelatedAuth();

            using (TransactionScope trans = new TransactionScope())
            {
                try
                {
                    this.UpdateAndFlush();

                    if (auths.Length > 0)
                    {
                        foreach (SysAuth auth in auths)
                        {
                            auth.UpdateByModule(this);
                        }
                    }
                    else
                    {
                        SysAuth auth = new SysAuth();
                        auth.CreateByModule(this);
                    }

                    trans.VoteCommit();
                }
                catch (Exception ex)
                {
                    trans.VoteRollBack();

                    throw ex;
                }
            }
        }
        /// <summary>
        /// 创建模块
        /// </summary>
        public void DoCreate()
        {
            this.DoValidate();

            using (TransactionScope trans = new TransactionScope())
            {
                try
                {
                    // 事务开始
                    this.CreateAndFlush();

                    SysAuth auth = new SysAuth();
                    auth.CreateByModule(this);

                    trans.VoteCommit();
                }
                catch (Exception ex)
                {
                    trans.VoteRollBack();

                    throw ex;
                }
            }
        }