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 member_left : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindMenu();
        }
    }
    protected void Rep_parent_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        Fm.Bussiness.member member = new Fm.Bussiness.member();
        //获取菜单栏ID
        int mid = int.Parse((e.Item.DataItem as DataRowView)["mid"].ToString());

        //查找子Rep控件
        Repeater subrep = e.Item.FindControl("Rep_sub") as Repeater;

        subrep.DataSource = member.member_menu("parent <>0 and rid="+int.Parse(Session["rid"].ToString())+" and parent="+mid+"");
        subrep.DataBind();
    }
    //绑定主菜单栏
    void BindMenu()
    {
        Fm.Bussiness.member member = new Fm.Bussiness.member();
        //获取角色组ID
        int rid = int.Parse(Session["rid"].ToString());
        //数据绑定
        Rep_parent.DataSource = member.member_menu("parent=0 and rid="+rid+"");
        Rep_parent.DataBind();
    }
}
