文章列表上一章
来源:互联网 发布:超图软件 新浪财经 编辑:程序博客网 时间:2024/04/30 01:10
#region /// 重载上一章
/// <summary>
///重载上一章
/// </summary>
/// <param name="nowId">当前ID</param>
/// <param name="tbId">数据表主键列</param>
/// <param name="tbName">数据表名</param>
/// <param name="title">链接文字</param>
/// <param name="url">链接地址</param>
/// <param name="sortId">当前数据表对应的类别ID</param>
/// <param name="stbName">类别表</param>
/// <param name="sId">类别ID</param>
/// <returns>返回String</returns>
public static string PreBus(string nowId, string tbId, string tbName, string title, string url,string sortId,string sId)
{
StringBuilder sbHtml = null;
sbHtml = new StringBuilder();
sbHtml.Append("select * from ");
sbHtml.Append(tbName + " where " + tbId);
sbHtml.Append("= (select MAX(" + tbId + ") from " + tbName + " where ");
sbHtml.Append(tbName + "." + sortId + "= " + sId + " and ");
sbHtml.Append(tbId + "<" + nowId + ")");
string sql = sbHtml.ToString();
DataTable dt = AccessHelper.AccessData(sql);
if (dt.Rows.Count == 0)
{
return "没有上一章";
}
else
{
string id = dt.Rows[0][tbId].ToString();
string name = dt.Rows[0][title].ToString();
sbHtml = new StringBuilder();
sbHtml.Append("<a href='" + url + "?id=" + id + "&sId=" + sId + "'>");
sbHtml.Append(name + "</a>");
string str = sbHtml.ToString();
return str;
}
}
#endregion
/// <summary>
///重载上一章
/// </summary>
/// <param name="nowId">当前ID</param>
/// <param name="tbId">数据表主键列</param>
/// <param name="tbName">数据表名</param>
/// <param name="title">链接文字</param>
/// <param name="url">链接地址</param>
/// <param name="sortId">当前数据表对应的类别ID</param>
/// <param name="stbName">类别表</param>
/// <param name="sId">类别ID</param>
/// <returns>返回String</returns>
public static string PreBus(string nowId, string tbId, string tbName, string title, string url,string sortId,string sId)
{
StringBuilder sbHtml = null;
sbHtml = new StringBuilder();
sbHtml.Append("select * from ");
sbHtml.Append(tbName + " where " + tbId);
sbHtml.Append("= (select MAX(" + tbId + ") from " + tbName + " where ");
sbHtml.Append(tbName + "." + sortId + "= " + sId + " and ");
sbHtml.Append(tbId + "<" + nowId + ")");
string sql = sbHtml.ToString();
DataTable dt = AccessHelper.AccessData(sql);
if (dt.Rows.Count == 0)
{
return "没有上一章";
}
else
{
string id = dt.Rows[0][tbId].ToString();
string name = dt.Rows[0][title].ToString();
sbHtml = new StringBuilder();
sbHtml.Append("<a href='" + url + "?id=" + id + "&sId=" + sId + "'>");
sbHtml.Append(name + "</a>");
string str = sbHtml.ToString();
return str;
}
}
#endregion
0 0
- 文章列表上一章
- 文章列表
- 文章列表
- 文章列表
- 文章列表
- 文章列表
- 文章列表
- 文章列表
- 编程文章相关文章列表
- zhengyun文章列表
- .net文章列表
- 相关文章列表
- 的文章列表
- 待完成文章列表
- 图象处理部分文章列表
- 推荐文章列表
- JAVA文章列表
- 图象处理部分文章列表
- hdu1558——Segment set
- c语言使用中的一点感慨
- leetcode: N-Queues
- HOJ 2634 How to earn more [网络流]最大权闭合图
- OSX10.9 QT5.3.1 关于加载动态库(Cannot load library.....)
- 文章列表上一章
- 周期串
- 常用函数之指定目录下查询文件
- 文章列表下一章
- 【索引】String Algorithms::Exercises: Beginner
- 如何在N个无序数组元素中,查找第K大元素
- 文章列表相关信息
- O(1)时间复杂度求栈的最小元素
- hdu 1598