protected void buttonUpdate_OnClick(object sender, EventArgs e) { var list = new List <Models.UserGroupGroupManagement>(); foreach (GridViewRow row in gvGroups.Rows) { var cb = (CheckBox)row.FindControl("chkSelector"); if (cb == null || !cb.Checked) { continue; } var dataKey = gvGroups.DataKeys[row.RowIndex]; if (dataKey == null) { continue; } var userGroupManagement = new Models.UserGroupGroupManagement { UserGroupId = CloneDeployUserGroup.Id, GroupId = Convert.ToInt32(dataKey.Value) }; list.Add(userGroupManagement); } BLL.UserGroupGroupManagement.DeleteUserGroupGroupManagements(CloneDeployUserGroup.Id); BLL.UserGroupGroupManagement.AddUserGroupGroupManagements(list); BLL.UserGroup.UpdateAllGroupMembersGroupMgmt(CloneDeployUserGroup); EndUserMessage = "Updated Group Management"; }
protected void buttonUpdate_OnClick(object sender, EventArgs e) { var list = new List<Models.UserGroupGroupManagement>(); foreach (GridViewRow row in gvGroups.Rows) { var cb = (CheckBox)row.FindControl("chkSelector"); if (cb == null || !cb.Checked) continue; var dataKey = gvGroups.DataKeys[row.RowIndex]; if (dataKey == null) continue; var userGroupManagement = new Models.UserGroupGroupManagement { UserGroupId = CloneDeployUserGroup.Id, GroupId = Convert.ToInt32(dataKey.Value) }; list.Add(userGroupManagement); } BLL.UserGroupGroupManagement.DeleteUserGroupGroupManagements(CloneDeployUserGroup.Id); BLL.UserGroupGroupManagement.AddUserGroupGroupManagements(list); BLL.UserGroup.UpdateAllGroupMembersGroupMgmt(CloneDeployUserGroup); EndUserMessage = "Updated Group Management"; }