Esempio n. 1
0
        public void AddRole(object sender, EventArgs e)
        {
            try
            {
                Roles.CreateRole(NewRole.Text);
                SueetieRole sueetieRole = new SueetieRole
                {
                    RoleName         = NewRole.Text,
                    RoleID           = SueetieRoles.GetAspnetRoleID(NewRole.Text),
                    IsGroupAdminRole = chkIsGroupAdminRole.Checked,
                    IsGroupUserRole  = chkIsGroupUserRole.Checked,
                    IsBlogOwnerRole  = chkIsBlogOwnerRole.Checked
                };
                SueetieRoles.CreateSueetieRole(sueetieRole);
                SueetieRoles.ClearRolesListCache();
                ActivitiesDataSource.Select();
                UserRoles.DataBind();

                createRoleSuccess = true;
            }
            catch
            {
                createRoleSuccess = false;
            }
            NewRole.Text = string.Empty;
            chkIsGroupAdminRole.Checked = false;
            chkIsGroupUserRole.Checked  = false;
            chkIsBlogOwnerRole.Checked  = false;
        }