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

namespace ResMangSys
{
    public partial class RepRegistManager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["id"] != null)
                {
                    if (Session["role"].ToString() != "manager")
                    {
                        Response.Redirect("Default.aspx");
                        return;
                    }
                }
                else
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
            }
            else
            {
                if (Session["id"] == null)
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
                if (Session["role"].ToString() != "manager")
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
            }
        }
    }
}