Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request["bookid"]);
            //图书详情
            BooksBll bbl = new BooksBll();

            books = bbl.GetModel(id);

            //随机显示图书
            DataSet ds = bbl.GetBooksByRandom(4);

            booksList = bbl.DataTableToList(ds.Tables[0]);

            //猜你喜欢
            DataSet ds1 = bbl.GetBooksByRandom(12);

            guestLike = bbl.DataTableToList(ds1.Tables[0]);

            count = new BookCommentBll().GetRecordCount("BookId=" + id);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            typeList = c.GetModelList("");

            DataSet ds = book.TodayTuiJian();

            //今日推荐
            tuijianlist = book.DataTableToList(ds.Tables[0]);

            //热门活动
            DataSet ds1 = book.GetBooksByRandom(4);

            hotList = book.DataTableToList(ds1.Tables[0]);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BooksBll bbl = new BooksBll();

            typelist = new CategoriesBll().GetModelList("");
            string index = Request["index"];

            if (string.IsNullOrEmpty(index))
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(index);
            }



            //获得类型id
            string  typeId = Request["typeId"];
            DataSet ds;

            if (string.IsNullOrEmpty(typeId))
            {
                ds = bbl.GetListByPage("", "Id", (pageIndex - 1) * pageSize + 1, pageIndex * pageSize);
                //总条数
                total = bbl.GetRecordCount("");
            }
            else
            {
                ds = bbl.GetListByPage("CategoryId=" + typeId, "Id", (pageIndex - 1) * pageSize + 1, pageIndex * pageSize);
                //总条数
                total = bbl.GetRecordCount("CategoryId=" + typeId);
            }
            //总页码数
            pageCount = Convert.ToInt32(Math.Ceiling((double)total / pageSize));

            //每页显示的数据集
            bookslist = bbl.DataTableToList(ds.Tables[0]);
            //随机显示3条数据
            DataSet ds1 = bbl.GetBooksByRandom(3);

            ramdomBooks = bbl.DataTableToList(ds1.Tables[0]);
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //随机显示3条数据
            DataSet ds1 = bbl.GetBooksByRandom(3);

            ramdomBooks = bbl.DataTableToList(ds1.Tables[0]);

            if (Request["zi"] != null)
            {
                searchWord = Request["zi"];

                Maticsoft.Model.SearchDetails sd = new Maticsoft.Model.SearchDetails()
                {
                    KeyWords       = searchWord,
                    SearchDateTime = DateTime.Now
                };
                new SearchDetailsBll().Add(sd);
            }
            DataSet ds = new BooksBll().searchResult(searchWord);

            searchList = new BooksBll().DataTableToList(ds.Tables[0]);
        }