Exemple #1
0
        /// <summary>
        /// 相同二级栏目下是否存在相同的权限类别
        /// </summary>
        /// <param name="secondId">二级栏目编号</param>
        /// <param name="privsType">权限类别</param>
        /// <returns></returns>
        public bool IsExistsPrivsType(int secondId, EyouSoft.Model.EnumType.SysStructure.PrivsType privsType)
        {
            DbCommand cmd = _db.GetSqlStringCommand(SQL_SELECT_IsExistsPrivsType);

            _db.AddInParameter(cmd, "ParentId", DbType.Int32, secondId);
            _db.AddInParameter(cmd, "PrivsType", DbType.Byte, privsType);

            using (IDataReader rdr = DbHelper.ExecuteReader(cmd, _db))
            {
                if (rdr.Read())
                {
                    return(rdr.GetInt32(0) > 0);
                }
            }

            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 按指定权限类别获取权限编号
        /// </summary>
        /// <param name="privs">权限集合</param>
        /// <param name="privsType">权限类别</param>
        /// <returns></returns>
        private int GetPrivsId(IList <EyouSoft.Model.SysStructure.MSysPrivsInfo> privs, EyouSoft.Model.EnumType.SysStructure.PrivsType privsType)
        {
            if (privs != null && privs.Count > 0)
            {
                foreach (var item in privs)
                {
                    if (item.PrivsType == privsType)
                    {
                        return(item.PrivsId);
                    }
                }
            }

            return(0);
        }