日期:2013-01-06  浏览次数:20572 次

        /// <summary>
        /// 取的贴子列表
        /// </summary>
        /// <remarks>
        /// 返回一个forum数组
        /// </remarks>
        public ArrayList GetForumList()
        {
            //定义一个forum数组做为返回值
            ArrayList arrForumList =new ArrayList() ;

            //从数据库中读取版面列表
            MyClass.Util.MyConnection myConn = new MyClass.Util.MyConnection("bbs") ;
            SQLCommand myCommand = new SQLCommand() ;
            myCommand.ActiveConnection = myConn ;
            myCommand.CommandText = "up_GetForumList" ;    //调用存储过程
            myCommand.CommandType = CommandType.StoredProcedure ;

            try
            {
                myConn.Open() ;
                SQLDataReader myReader ;
                myCommand.Execute(out myReader) ;

                for (int i = 0 ; myReader.Read() ; i++)
                {
                    MyClass.BBS.Forum objItem = new MyClass.BBS.Forum() ;
                    objItem.ID = myReader["id"].ToString().ToInt32() ;
                    objItem.Name = myReader["title"].ToString() ;
                    objItem.Description = myReader["description"].ToString() ;
                    objItem.TopicCount = myReader["topiccount"].ToString().ToInt32() ;
                    objItem.Layer = myReader["layer"].ToString().ToInt32() ;
                    objItem.FatherID = myReader["fatherid"].ToString().ToInt32() ;
                    objItem.Master = new BBSUser(myReader["userid"].ToString().ToInt32() ,
                   &nbs