6.删除收费供求信息
DeleteLeaguerInfo()方法主要用于删除收费供求信息。实现代码如下:
例程14 代码位置:光盘\TM\01\SIS\ App_Code \ Operation.cs
广州网站建设,网站建设,广州网页设计,广州网站设计
- #region 删除收费供求信息
- /// <summary>
- /// 删除收费供求信息
- /// </summary>
- /// <param name="id">要删除信息的ID</param>
- public void DeleteLeaguerInfo(string id)
- {
- int d = data.RunProc("Delete from tb_LeaguerInfo where id='" + id + "'");
- }
- #endregion
7.查询收费供求信息
SelectLeaguerInfo()方法为可重载方法,用于根据不同的条件查询收费供求信息。实现代码如下:
例程15 代码位置:光盘\TM\01\SIS\ App_Code \ Operation.cs
- #region 查询收费供求信息
- /// <summary>
- /// 显示所有的收费信息
- /// </summary>
- /// <returns>返回DataSet结果集</returns>
- public DataSet SelectLeaguerInfo()
- {
- return data.RunProcReturn("Select * from tb_LeaguerInfo order by date desc", "tb_LeaguerInfo");
- }
- /// <summary>
- /// 查询收费到期和未到期供求信息
- /// </summary>
- /// <param name="All">True显示未到期信息,False显示到期信息</param>
- /// <returns>返回DataSet结果集</returns>
- public DataSet SelectLeaguerInfo(bool All)
- {
- if (All) //显示有效收费信息
- return data.RunProcReturn("Select * from tb_LeaguerInfo where showday >= getdate() order by date desc", "tb_LeaguerInfo");
- else //显示过期收费信息
- return data.RunProcReturn("select * from tb_LeaguerInfo where showday<getdate() order by date desc", "tb_LeaguerInfo");
- }
- /// <summary>
- /// 查询同类型收费到期和未到期供求信息
- /// </summary>
- /// <param name="all">True显示未到期信息,False显示到期信息</param>
- /// <param name="infoType">信息类型</param>
- /// <returns>返回DataSet结果集</returns>
- public DataSet SelectLeaguerInfo(bool All, string infoType)
- {
- if (All) //显示有效收费信息
- return data.RunProcReturn("Select * from tb_LeaguerInfo where type='" + infoType + "' and showday >= getdate() order by date desc", "tb_LeaguerInfo");
- else //显示过期收费信息
- return data.RunProcReturn("select * from tb_LeaguerInfo where type='" + infoType + "' and
- showday<getdate() order by date desc", "tb_LeaguerInfo");
- }
- /// <summary>
- /// 查询显示“按类型未过期推荐信息”或“所有的未过期推荐信息”
- /// </summary>
- /// <param name="infoType">信息类型</param>
- /// <param name="checkState">True按类型显示未过期推荐信息 False显示所有未过期推荐信息</param>
- /// <returns></returns>
- public DataSet SelectLeaguerInfo(string infoType,bool checkState)
- {
- if (checkState) //按类型未过期推荐信息
- return data.RunProcReturn("SELECT top 20 * FROM tb_LeaguerInfo WHERE (type = '" + infoType + "') AND (showday >= GETDATE()) AND (CheckState = '" + checkState + "') ORDER BY date DESC", "tb_LeaguerInfo");
- else //显示未过期推荐信息
- return data.RunProcReturn("SELECT top 10 * FROM tb_LeaguerInfo WHERE (showday >=GETDATE()) AND (CheckState = '" + !checkState + "') ORDER BY date DESC", "tb_LeaguerInfo");
- }
- /// <summary>
- /// 查询同类型收费到期和未到期供求信息(前N条信息)
- /// </summary>
- /// <param name="all">True显示未到期信息,False显示到期信息</param>
- /// <param name="infoType">信息类型</param>
- /// <param name="top">获取前N条信息</param>
- /// <returns></returns>
- public DataSet SelectLeaguerInfo(bool All, string infoType, int top)
- {
- if (All) //显示有效收费信息
- return data.RunProcReturn("Select top(" + top + ") * from tb_LeaguerInfo where type='" + infoType + "' and showday >= getdate() order by date desc", "tb_LeaguerInfo");
- else //显示过期收费信息
- return data.RunProcReturn("select top(" + top + ") * from tb_LeaguerInfo where type='" + infoType + "' and showday<getdate() order by date desc", "tb_LeaguerInfo");
- }
- /// <summary>
- /// 根据ID查询收费供求信息
- /// </summary>
- /// <param name="id">供求信息ID</param>
- /// <returns></returns>
- public DataSet SelectLeaguerInfo(string id)
- {
- return data.RunProcReturn("Select * from tb_LeaguerInfo where id='" + id + "' order by date desc",
- "tb_LeaguerInfo");
- }
- #endregion
广州网站建设,网站建设,广州网页设计,广州网站设计



