/// <summary> /// 保存当前组用户 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { string users = "-1,"; foreach (DataGridItem item in dgUser.Items) { if (item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.Item) { CheckBox chk = (CheckBox)item.Cells[2].Controls[1]; if (chk.Checked) { users += item.Cells[3].Text + ","; } } } users += "-1"; string sql = "update sys_UserList set GroupID=" + GroupID + " where UserID in (" + users + ")"; if (objUser.AddUserToGroup(sql)) { JScript.Instance.ShowMessage(this, "添加成功!"); } }