/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> //protected void addUser_Click(object sender, EventArgs e) //{ // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>window.open('Add.aspx','','top=200,left=250,height=400,width=500');</script>"); //} /// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void cancleUser_Click(object sender, EventArgs e) { CheckBox chk; bool success = false; LabMS.BLL.UserTable BuserTable = new LabMS.BLL.UserTable(); for (int i = 0; i < gvuser.Rows.Count; i++) { chk = (CheckBox)gvuser.Rows[i].FindControl("chkchoose"); if (chk.Checked) { int UserId = int.Parse(gvuser.DataKeys[i].Value.ToString()); try { BuserTable.Delete(UserId); success = true; } catch (Exception ex) { throw ex; } } } if (success == true) { Common.JShelper.JSAlert(this.Page, "", "删除用户信息成功!"); Bind(); } else { Common.JShelper.JSAlert(this.Page, "", "删除用户信息失败!"); } }