示例#1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        SnitzRoleProvider.UpdateRoleInfo(Convert.ToInt32(txtRoleID.Text), txtName.Text, txtDescription.Text);

        RoleTable.DataBind();
        RoleView.SetActiveView(viewNewRole);
        errLbl2.Visible = false;
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         RoleView.SetActiveView(viewNewRole);
     }
     RoleTable.PageSize = Config.TopicPageSize;
 }
示例#3
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DeleteClick")
        {
            try
            {
                if (Roles.DeleteRole(e.CommandArgument.ToString(), !delPopRoles.Checked))
                {
                    errLbl2.Text    = "Role deleted successfully.";
                    errLbl2.Visible = true;
                }
            }
            catch (ProviderException p)
            {
                errLbl2.Text    = p.Message;
                errLbl2.Visible = true;
            }

            RoleTable.DataBind();
        }

        if (e.CommandName == "EditClick")
        {
            SnitzRoleProvider srp = new SnitzRoleProvider();

            int      roleid = Convert.ToInt32(e.CommandArgument);
            RoleInfo role   = SnitzRoleProvider.GetRoleFull(roleid);

            txtRoleID.Text      = roleid.ToString();
            txtName.Text        = role.RoleName;
            txtDescription.Text = role.Description.ToString();
            UsersInRole.Text    = String.Format("{0} User(s) in {1} Role", srp.GetUsersInRole(txtName.Text).Length, role.RoleName);
            RoleView.SetActiveView(viewEditRole);
            errLbl2.Visible = false;

            UserListPanel.Visible = (roleid > 1);
            RefreshUserList();
        }
    }
示例#4
0
 protected void btnReset_Click(object sender, EventArgs e)
 {
     RoleView.SetActiveView(viewNewRole);
     errLbl2.Visible = false;
 }