protected void Page_Load(object sender, EventArgs e) { Security mySecurity = new Security(); if (!mySecurity.IsAdmin()) { Response.Redirect("Index.aspx"); } if (!IsPostBack) { LoadUsers(); } }
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(); } }
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 { } }
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; } }