예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Security mySecurity = new Security();

            if (!mySecurity.IsAdmin())
            {
                Response.Redirect("Index.aspx");
            }
            if (!IsPostBack)
            {
                LoadUsers();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Security mySecurity = new Security();

            if (!mySecurity.IsAdmin())
            {
                Response.Redirect("Index.aspx");
            }
            if (!IsPostBack)
            {
                loadBookings();
                ddlRoom();
                ddlUser();
                loadRooms();
                LoadFloors();
            }
        }
예제 #3
0
        protected void btnLogin_Click1(object sender, EventArgs e)
        {
            Security mySecurity = new Security();

            if (mySecurity.Login(txtUsername.Text, txtPassword.Text))
            {
                if (mySecurity.IsAdmin())
                {
                    Response.Redirect("Index.aspx");
                }
                else if (mySecurity.IsClient())
                {
                    Response.Redirect("Booking.aspx");
                }
            }
            else
            {
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string   test       = txtPass.Text;
            Security mySecurity = new Security();

            if (mySecurity.IsLoggedIn())
            {
                loginLink.Style.Add("display", "none");
                registerLink.Style.Add("display", "none");
                settingsLink.Visible      = true;
                hlLogout.Visible          = true;
                myBookedRoomsLink.Visible = true;
                pnlUserSettings.Visible   = true;
                //settingsLink.Attributes.Add("onclick", "pnlVisibleTrue()");
                int UserID = mySecurity.UserID;
                LoadUserInfo(UserID);

                lblWelcome.Text = "Welcome " + mySecurity.FullName + "!";
            }
            if (mySecurity.IsAdmin())
            {
                hlAdmin.Visible = true;
            }
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Security mySecurity = new Security();
     if (!mySecurity.IsAdmin())
     {
         Response.Redirect("Index.aspx");
     }
     if (!IsPostBack)
     {
         loadBookings();
         ddlRoom();
         ddlUser();
         loadRooms();
         LoadFloors();
     }
 }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Security mySecurity = new Security();
     if (!mySecurity.IsAdmin())
     {
         Response.Redirect("Index.aspx");
     }
     if (!IsPostBack)
     {
         LoadUsers();
     }
 }