using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KstCMS.KstCMS_Manager.Module.role_select
{
    public partial class index : KstCmsBase.WebPage.ValiPage
    {
        protected string StrRoleList = null;
        private int RoleCount = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            Repeater1.ItemDataBound += new RepeaterItemEventHandler(Repeater1_ItemDataBound);
            ViewState["ToId"] = Request.QueryString.Get("ToId");
            ViewState["ToName"] = Request.QueryString.Get("ToName");
            ViewState["NoWholeDept"] = Request.QueryString.Get("no_whole_role");

            Repeater1.DataSource = KstCmsBase.DAL.Role.Get_RoleList();
            Repeater1.DataBind();

        }

        void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                StrRoleList += "rolelist[" + RoleCount + "]=" + ((KstCmsBase.Entities.RoleEntity)e.Item.DataItem).RoleId + ";\r\n";

                RoleCount++;
            }
        }
    }
}