Beispiel #1
0
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from Navigation");
            strSql.Append(" where id=@id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            return(SqlHelperBook.Exists(strSql.ToString(), parameters));
        }
Beispiel #2
0
        /// <summary>
        /// 是否存在某分类记录
        /// </summary>
        public bool ExistsNode(int nid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from ShuMu");
            strSql.Append(" where nid=@nid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@nid", SqlDbType.Int, 4)
            };
            parameters[0].Value = nid;

            return(SqlHelperBook.Exists(strSql.ToString(), parameters));
        }
Beispiel #3
0
        /// <summary>
        /// 是否存在书架记录
        /// </summary>
        public bool Exists2(int usid, int nid, int sid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from Favorites");
            strSql.Append(" where usid=@usid");
            strSql.Append(" and nid=@nid");
            strSql.Append(" and sid=@sid and types=0");
            SqlParameter[] parameters =
            {
                new SqlParameter("@usid", SqlDbType.Int, 4),
                new SqlParameter("@nid",  SqlDbType.Int, 4),
                new SqlParameter("@sid",  SqlDbType.Int, 4)
            };
            parameters[0].Value = usid;
            parameters[1].Value = nid;
            parameters[2].Value = sid;

            return(SqlHelperBook.Exists(strSql.ToString(), parameters));
        }