Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RAFSecurity   _securityManager = new RAFSecurity();
            List <object> _dat             = _securityManager.searchForUsers(Page.User.Identity.Name, 5);

            if (_dat.Count != 0)
            {
                if (!(_securityManager.getUserRights((int)_dat[0] + "", "Page").Contains("PageRolModifications")))
                {
                    Response.Redirect("/default.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["RolId"] != null)
                {
                    RolId.Value      = Request.QueryString["RolId"];
                    _securityManager = new RAFSecurity();
                    List <object> _data = _securityManager.searchForGroups(RolId.Value.ToString(), 2);
                    if (_data != null)
                    {
                        TBRolName.Text      = (String)_data[1];
                        TXBDescription.Text = (String)_data[2];
                        if ((Boolean)_data[3])
                        {
                            RaBuHabilitar.SelectedIndex = 0;
                        }
                        else
                        {
                            RaBuHabilitar.SelectedIndex = 1;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        { //Permisos para esta página
            RAFSecurity   _securityManager = new RAFSecurity();
            List <object> _dat             = _securityManager.searchForUsers(Page.User.Identity.Name, 5);

            if (_dat.Count != 0)
            {
                if (!(_securityManager.getUserRights((int)_dat[0] + "", "Page").Contains("PageUserModifications")))
                {
                    Response.Redirect("/default.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["ui"] != null)
                {
                    UserId.Value     = Request.QueryString["ui"];
                    _securityManager = new RAFSecurity();
                    List <object> _data = _securityManager.searchForUsers(UserId.Value.ToString(), 4);
                    if (_data != null)
                    {
                        if (_data[1].ToString() != null && _data[1].ToString() != "")
                        {
                            TBUserName.Text = (String)_data[1];
                        }
                        if (_data[2].ToString() != null && _data[2].ToString() != "")
                        {
                            nameT.Text = (String)_data[2];
                        }
                        if (_data[3].ToString() != null && _data[3].ToString() != "")
                        {
                            TBSecondName.Text = (String)_data[3];
                        }
                        if (_data[4].ToString() != null && _data[4].ToString() != "")
                        {
                            TBLastName1.Text = (String)_data[4];
                        }
                        if (_data[5].ToString() != null && _data[5].ToString() != "")
                        {
                            TBLastName2.Text = (String)_data[5];
                        }
                        if ((String)_data[6] == "E")
                        {
                            RaBuHabilitar.SelectedIndex = 0;
                        }
                        else
                        {
                            RaBuHabilitar.SelectedIndex = 1;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RAFSecurity   _securityManager = new RAFSecurity();
            List <object> _data            = _securityManager.searchForUsers(Page.User.Identity.Name, 5);

            if (_data.Count != 0)
            {
                if (!(_securityManager.getUserRights((int)_data[0] + "", "Section").Contains("SecCustomerSearch")))
                {
                    Response.Redirect("/default.aspx");
                }
            }
        }
Esempio n. 4
0
        protected void getRights()
        {
            _sections.Clear();
            _Categories.Clear();
            _pages.Clear();
            RAFSecurity   _securityManager = new RAFSecurity();
            List <object> _data            = _securityManager.searchForUsers(Page.User.Identity.Name, 5);

            if (_data.Count != 0)
            {
                _sections   = _securityManager.getUserRights((int)_data[0] + "", "Section");
                _Categories = _securityManager.getUserRights((int)_data[0] + "", "Category");
                _pages      = _securityManager.getUserRights((int)_data[0] + "", "Page");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            RAFSecurity   _securityManager = new RAFSecurity();
            List <object> _data            = _securityManager.searchForUsers(Page.User.Identity.Name, 5);

            if (_data.Count != 0)
            {
                if (!(_securityManager.getUserRights((int)_data[0] + "", "Page").Contains("PageCustomerInfo")))
                {
                    Response.Redirect("/default.aspx");
                }
            }

            if (!IsPostBack)
            {
                if (Request.QueryString["cu"] != null)
                {
                    custIDHid.Value = Request.QueryString["cu"];
                }
            }
        }
Esempio n. 6
0
        protected void BTNNewUser_Click(object sender, EventArgs e)
        {
            RAFSecurity _securityManager = new RAFSecurity();

            if (TBUserName.Text != null && TBPass.Text == TBPassConfirm.Text && TBPass.Text.Length > 5)
            {
                if (_securityManager.insertUser(TBUserName.Text, TBPass.Text, nameT.Text, TBSecondName.Text, TBLastName1.Text, TBLastName2.Text, Membership.Provider.Name))
                {
                    List <object> _result = _securityManager.searchForUsers(TBUserName.Text, 5);

                    Response.Redirect("/UserModifications.aspx?ui=" + _result[0]);
                }
                else
                {
                    errorMsg.Text    = "Error el Nombre del Usuario ya está en uso";
                    errorMsg.Visible = true;
                }
            }
            else
            {
                errorMsg.Text    = "Ingrese los datos correctamente";
                errorMsg.Visible = true;
            }
        }