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

namespace UI.Controls
{
    public partial class Header : System.Web.UI.UserControl
    {

        public IList<RoleRightsDTO> MenuDataSource
        {
            set
            {
                headerRadMenu.DataSource = value;
                headerRadMenu.DataTextField = "MenuName";
                headerRadMenu.DataNavigateUrlField = "PageUrl";
                headerRadMenu.DataFieldID = "MenuId";
                headerRadMenu.DataFieldParentID = "MenuParentId";
                headerRadMenu.DataBind();

                UserDTO userDetails = (UserDTO)Session["UserInfo"];
                lblWelcomeText.Text = (string)GetGlobalResourceObject("Res", "Welcome") + " " +userDetails.Name;

            }
        }

        protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
        {
            Session.Abandon();
            FormsAuthentication.SignOut();
        }




    }
}