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

namespace ResMangSys
{
    public partial class Main : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["id"] == null)
                {
                    Response.Redirect("Default.aspx");
                    return;
                    login.Style["display"] = "";
                    chgPwd.Style["display"] = "none";
                    logout.Style["display"] = "none";
                    repRecSearch.Style["display"] = "none";
                    blackManager.Style["display"] = "none";
                }
                else if (Session["role"].ToString() == "user")
                {
                    login.Style["display"] = "none";
                    chgPwd.Style["display"] = "";
                    logout.Style["display"] = "";
                    repRecSearch.Style["display"] = "none";
                    blackManager.Style["display"] = "none";
                    tipsMsg.Style["display"] = "none";
                }
                else if(Session["role"].ToString()=="manager")
                {
                    login.Style["display"] = "none";
                    chgPwd.Style["display"] = ""; 
                    logout.Style["display"] = "";
                    repRecSearch.Style["display"] = "";
                    blackManager.Style["display"] = "";
                    tipsMsg.Style["display"] = "none";
                    //ulay.Style["display"] = "";
                }
                else if (Session["role"].ToString() == "advUser")
                {
                    login.Style["display"] = "none";
                    chgPwd.Style["display"] = "";
                    logout.Style["display"] = "";
                    repRecSearch.Style["display"] = "";
                    blackManager.Style["display"] = "none";
                    tipsMsg.Style["display"] = "none";
                }
            }
        }
    }
}