using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Includes_Main_Right : System.Web.UI.UserControl
{
    BLL.Class_1 c_1 = new BLL.Class_1();
    BLL.Class_2 c_2 = new BLL.Class_2();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.Bind();
        }
    }
    private void Bind()
    {
        DataTable dt = c_1.toplist(5);
        this.parent.DataSource = dt.DefaultView;
        this.parent.DataBind();
    }
    /// <summary>
    /// 绑定
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void parent_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DataList list = e.Item.FindControl("child") as DataList;
            DataRowView drv = e.Item.DataItem as DataRowView;
            DataTable table = c_2.Class_2listtop(8,int.Parse(drv["ClassID_1"].ToString()), "");
            list.DataSource = table.DefaultView;
            list.DataBind();
        }
    }
}
