protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //写删除人员系统日志start DataTable dtuser = Hyoa_user.Getuserbyid(v_uids[i]); //如果是admin,提示不能删除 if (dtuser.Rows[0]["hy_userid"].ToString() == "admin") { Response.Write("<script>alert('admin为超级管理员,您无法进行删除!');</script>"); return; } HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = dtuser.Rows[0]["hy_username"].ToString() + "被删除"; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //写删除人员系统日志end Hyoa_user.id = v_uids[i]; Hyoa_user.Deletebyid(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }