Пример #1
0
 protected void imgManageRoleSave_Click(object sender, EventArgs e)
 {
     try
     {
         string unselectedRoles = GetListBoxText(lstUnselectedRoles);
         string selectedRoles   = GetListBoxText(lstSelectedRoles);
         if (hdnEditUsername.Value != "")
         {
             string   userRoles = role.GetRoleNames(hdnEditUsername.Value, GetPortalID);
             string[] arrRoles  = userRoles.Split(',');
             UserInfo user      = new UserInfo(Membership.ApplicationName, new Guid(hdnEditUserID.Value), userRoles, GetPortalID);
             if (arrRoles.Length > 0 && selectedRoles.Length > 0)
             {
                 role.ChangeUserInRoles(Membership.ApplicationName, new Guid(hdnEditUserID.Value), userRoles, selectedRoles, GetPortalID);
                 ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("UserManagement", "UserRolesUpdatedSuccessfully"), "", SageMessageType.Success);
             }
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
         ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("UserManagement", "UnknownErrorOccur"), "", SageMessageType.Error);
     }
 }