打印本文 打印本文  关闭窗口 关闭窗口
asp+的论坛列表程序---代码部分
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 12:39:38
       + "&PageNo=" + (intPageNo - 1).ToString() ;
          linkPrevPage1.ToolTip     = "回到上一页。" ;
        }
     else
        {
          linkPrevPage.ToolTip     = "你现在就位于第一页,你还想上哪儿?" ;
          linkPrevPage1.ToolTip     = "你现在就位于第一页,你还想上哪儿?" ;
        }
     
     //后页
     if (intPageNo < intPageCount )
       {
         linkNextPage.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + (intPageNo + 1).ToString() ;
         linkNextPage.ToolTip      = "到下一页。" ;
         linkNextPage1.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + (intPageNo + 1).ToString() ;
         linkNextPage1.ToolTip      = "到下一页。" ;
       }
     else
       {
         linkNextPage.ToolTip      = "你现在就位于最后一页,你还想上哪
儿?" ;                                                                               
         linkNextPage1.ToolTip      = "你现在就位于最后一页,你还想上哪
儿?" ;                                                                               
       }
       
     //末页
     if (intPageNo != intPageCount)
       {
         linkLastPage.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + intPageCount.ToString() ;
         linkLastPage.ToolTip      = "到最后一页。" ;
         linkLastPage1.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + intPageCount.ToString() ;
         linkLastPage1.ToolTip      = "到最后一页。" ;
       }
     else
       {
         linkLastPage.ToolTip      = "你现在就位于最后一页。" ;
         linkLastPage1.ToolTip      = "你现在就位于最后一页。" ;
       }                                 
        
        
      //贴子列表
      ShowTopicList(intForumID , 0 , intPageNo , intPageSize) ;
      
      //显示转换版面下拉列表
      ShowChangeForum(intForumID) ;
    }

  private void ShowTopicList(int a_intForumID , int a_intDays , int a_intPageNo , int a_intPageSize)
    {
      
      //读出纪录
      SQLConnection myConnection = new SQLConnection("server=server1;uid=sa;pwd=;database=BBS");
      SQLCommand myCommand = new SQLCommand("up_TopicsList" , myConnection);

      myCommand.ActiveConnection = myConnection ;
      myCommand.CommandType = CommandType.StoredProcedure;
      
      SQLParameter workParam = null;

      //论坛id
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_ForumID", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intForumID ;
        
         
      //限定天数
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intDays", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intDays ;
      
      //页号
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intPageNo", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intPageNo ;
      
      //每页显示数
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intPageSize", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intPageSize ;
      
      SQLDataReader myReader ;

      try
        {
          myConnection.Open();
          myCommand.Execute(out myReader);
          //Response.Write(myReader.HasValue.ToString());
          
          //取纪录
          if (lblTopicCounts.Text.ToInt32() == 0)        //如果没有发言
            {
              TableRow tr = new TableRow() ;
              tr.BackColor = Color.White ;
              TableCell td = new TableCell() ;
              td.ColumnSpan = 6 ;
              td.VerticalAlign = VerticalAlign.Middle ;
              td.HorizontalAlign = HorizontalAlign.Center ;
              td.Height  =200 ;
 

上一页  [1] [2] [3] [4]  下一页



打印本文 打印本文  关闭窗口 关闭窗口