/// <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"; if (userDal.AddUserToGroup(Convert.ToInt32(GroupID), users)) { JScript.Instance.ShowMessage(this, "添加成功!"); } }