public int getCount() { string sql = "select count(1) from NsyNews "; int counts = (int)DbHelper.ExecuteScalarBySql(sql); return(counts); }
/// <summary> /// /// </summary> /// <returns></returns> public int getCount(int d) { string sql = "select count(1) from BoutiqueCase "; int counts = (int)DbHelper.ExecuteScalarBySql(sql); return(counts); }
/// <summary> /// 获取总页数 /// </summary> /// <returns></returns> public int getCount() { int counts = 0; string sql = "select count(1) from FriendShip"; object num = DbHelper.ExecuteScalarBySql(sql); if (num != null) { counts = (int)num; } return(counts); }
/// <summary> /// 根据标题获取内容 /// </summary> /// <param name="til"></param> /// <returns></returns> public int GetNsyNewsID(string til) { int d = -1; string sql = "select ID from NsyNews where Title=@til"; SqlParameter[] para = { new SqlParameter("@til", til) }; d = (int)DbHelper.ExecuteScalarBySql(sql, para); return(d); }
/// <summary> /// 根据id获取TypeName /// </summary> /// <param name="id"></param> /// <returns></returns> public string GetViewPointTpName(int id) { string sql = "select TypeName from PointType where id=@id"; SqlParameter[] para = { new SqlParameter("@id", id) }; string tpName = DbHelper.ExecuteScalarBySql(sql, para).ToString(); return(tpName); }
/// <summary> /// 获得页数 /// </summary> /// <param name="d"></param> /// <returns></returns> public int getCount(int d) { string sql = "select count(1) from ViewPoint "; if (d != 0) { sql += " where TpId=@id"; } SqlParameter[] para = { new SqlParameter("@id", d) }; int counts = (int)DbHelper.ExecuteScalarBySql(sql, para); return(counts); }