Beispiel #1
0
    private void DisplayMilkInfo(int bid)
    {
        Milk milk = MilkManager.GetMilkById(bid);

        lblTitle.Text = milk.Name;
        IList <MilkRatings> ratings = MilkRatingManager.GetMilkRatingsInfo(bid);

        if (ratings.Count > 0)
        {
            foreach (MilkRatings r in ratings)
            {
                lblRating.Text += r.User.Name + "<br/>" + r.Rating + "星" + "<br/>" + r.Comment + "<br/>";
            }
        }
    }
Beispiel #2
0
    private void Databind()
    {
        PagedDataSource objPds = new PagedDataSource();

        //对PagedDataSource 对象的相关属性赋值
        objPds.DataSource  = MilkManager.GetOrderedSmallBookByCategoryId(Convert.ToInt32(ViewState["CategoryId"]), (string)ViewState["Order"]);
        objPds.AllowPaging = true;
        objPds.PageSize    = 4;

        objPds.CurrentPageIndex = Pager;
        lblCurrentPage.Text     = "第 " + (objPds.CurrentPageIndex + 1).ToString() + " 页 共 " + objPds.PageCount.ToString() + " 页";
        SetEnable(objPds);

        //把PagedDataSource 对象赋给DataList控件
        DataList1.DataSource = objPds;
        DataList1.DataBind();
    }
Beispiel #3
0
    private void DisplayHotBooks()
    {
        IList <MyMilkModels.Categories> list = CategoryManager.GetAllCategories();

        foreach (MyMilkModels.Categories item in list)
        {
            AccordionPane ap             = new AccordionPane();
            Label         lbCategoryMenu = new Label();
            lbCategoryMenu.Text = item.Name;
            ap.HeaderContainer.Controls.Add(lbCategoryMenu);
            IList <MyMilkModels.Milk> milklist = MilkManager.GetMilkByCategoryId(item.Id);
            foreach (MyMilkModels.Milk bitem in milklist)
            {
                HyperLink hl = new HyperLink();
                hl.Text        = bitem.Name + "</br>";
                hl.NavigateUrl = "~/MilkDetail.aspx?id=" + bitem.Id;
                ap.ContentContainer.Controls.Add(hl);
            }
            Accordion1.Panes.Add(ap);
        }
    }
Beispiel #4
0
 public string[] GetMilkHotSearchKeywords(string prefixText, int count)
 {
     return(MilkManager.GetMilkHotSearchKeywords(prefixText, count));
 }