protected void Page_Load(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine(Session["user"]); bool isLoggedIn = (Session["user"] == null ? false : true); if (isLoggedIn) { LoginUser user = Session["user"] as LoginUser; if (user.HasPrimaryRole("Admin")) { rdts.Visible = true; rbkg.Visible = true; mgmt.Visible = true; rmpr.Visible = true; report.Visible = true; } else if (user.HasPrimaryRole("user")) { rbkg.Visible = true; if (user.HasSecondaryRole("Admin")) { rdts.Visible = true; } } } else { Response.Redirect("Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { LoginUser user = Session["user"] as LoginUser; if (!(user.HasPrimaryRole("admin") || user.HasSecondaryRole("admin"))) { Response.Redirect("logout.aspx"); } if (!IsPostBack) { this.BindRepeater(); } }
protected void Page_Load(object sender, EventArgs e) { LoginUser user = Session["user"] as LoginUser; if (!(user.HasPrimaryRole("admin") || user.HasSecondaryRole("admin"))) { Response.Redirect("logout.aspx"); } if (!IsPostBack) { DropDownListRoom.DataSource = getData("spGetRoomType", null); DropDownListRoom.DataBind(); ListItem LIRoomType = new ListItem("---Select---", "-1"); DropDownListRoom.Items.Insert(0, LIRoomType); DropDownListGH.DataSource = getData("spGetGuestHouse", null); DropDownListGH.DataBind(); ListItem LIGuestHouse = new ListItem("---Select---", "-1"); DropDownListGH.Items.Insert(0, LIGuestHouse); } }