private void btnSave_Click(object sender, EventArgs e) { ArrayList users = cblUsers.GetSelectedValues(); d.CmsUserRoleLink curl = new d.CmsUserRoleLink(); int roleId = getRoleId(); curl.DeleteByRole(roleId); foreach (string userId in users) { curl.Create(Convert.ToInt32(userId), roleId); } Response.Redirect("roleList.aspx"); }
private void btnSave_Click(object sender, EventArgs e) { ArrayList roles = cblRoles.GetSelectedValues(); d.CmsUserRoleLink curl = new d.CmsUserRoleLink(); int userId = getUserId(); curl.DeleteByUser(userId); foreach (string roleId in roles) { curl.Create(userId, Convert.ToInt32(roleId)); } Response.Redirect("userList.aspx"); }