using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using BusinessLayer;
using DTO;

namespace UI
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        UserManager UM = new UserManager();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //if (Session[Constant.SessionContant.USER_SESSION] == null)
                //{
                //   Response.Redirect("~/login.aspx", false); 

                //}
                //else
                //{
                //    var userDetails = (M_Site_User)Session[Constant.SessionContant.USER_SESSION];
                headerUserControl.MenuDataSource = (IList<RoleRightsDTO>)Session["RoleRights"];
                //}


                //headerRadMenu.DataSource = RoleRights;
                //headerRadMenu.DataTextField = "MenuName";
                //headerRadMenu.DataNavigateUrlField = "PageUrl";
                //headerRadMenu.DataFieldID = "MenuId";
                //headerRadMenu.DataFieldParentID = "MenuParentId";
                //headerRadMenu.DataBind();

                //siteMasterMenuRepeater.DataSource = (from item in RoleRights
                //                                     where item.MenuParentId == null
                //                                     select new { PageUrl = item.PageUrl.Replace("~/", "../"), MenuName = item.MenuName }).ToList();
                //siteMasterMenuRepeater.DataBind();
            }

        }
    }
}
