Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        oRoleAction = new DL_WEB.DAL.Master.RoleAction();
        RoleID      = Request.Params.GetValues("RoleID") != null?Convert.ToInt32(Request.Params.GetValues("RoleID")[0]) : 0;

        if (RoleID != 0)
        {
            RadTree1.DataFieldID       = "ActionID";
            RadTree1.DataFieldParentID = "ParentID";
            RadTree1.DataSource        = oRoleAction.LoadRoleActionsByRoleID(RoleID);
            RadTree1.DataBind();
        }
        else
        {
            Response.Redirect("Roles.aspx");
        }
    }
Пример #2
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (Context.User.Identity.IsAuthenticated)
        {
            if (null == Session["Organization"])
            {
                if (!(Request.FilePath.Contains("ActiveOrganization.aspx") || Request.FilePath.Contains("Logoff.aspx")))
                {
                    Response.Redirect("./ActiveOrganization.aspx?redirecturl=" + HttpUtility.UrlEncode(Request.FilePath));
                }
                else
                {
                    MyGeneration.dOOdads.BusinessEntity.ClearConnectionString();
                }
            }
            else
            {
                DL_WEB.DAL.Master.Organization org = Session["Organization"] as DL_WEB.DAL.Master.Organization;

                ProfileTopLink.Visible   = ProfileBottomLink.Visible = true;
                lblOrganizationName.Text = ": " + org.Name;

                if (Session["RoleActions"] == null)
                {
                    DL_WEB.DAL.Master.UserRole oUserRole = new DL_WEB.DAL.Master.UserRole();
                    oUserRole.Where.UserID.Operator         = WhereParameter.Operand.Equal;
                    oUserRole.Where.UserID.Value            = DL_WEB.DAL.Master.User.GetUserID(Context.User.Identity.Name);
                    oUserRole.Where.OrganizationID.Operator = WhereParameter.Operand.Equal;
                    oUserRole.Where.OrganizationID.Value    = org.OrganizationID;
                    oUserRole.Query.Load();
                    DL_WEB.DAL.Master.RoleAction oRoleAction = new DL_WEB.DAL.Master.RoleAction();
                    DataTable dtRoleActions = oRoleAction.LoadRoleActionsByRoleID(oUserRole.RoleID);
                    Session.Add("RoleActions", dtRoleActions);
                }
            }
        }
    }