protected void btnDelete_Click(object sender, EventArgs e) { //创建用户数据表操作类对象 OperatorAuthorization operauth = new OperatorAuthorization(); string userid = this.txtUserID.Text.Trim(); //删除用户数据 if (operauth.DelOperater(userid)) { Common.ShowMsg("删除成功!"); //记录操作员操作 RecordOperate.SaveRecord(Session["UserID"].ToString(), "系统管理", "删除用户信息"); } else { return; } Server.Transfer("System_UserAuthorization_Index.aspx"); }
/// <summary> /// DataGrid选择项响应事件方法 /// </summary> /// <param name="source"></param> /// <param name="e"></param> public void DataOperate(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { //创建用户数据表操作类对象 OperatorAuthorization operate = new OperatorAuthorization(); string UserId = ((Label)e.Item.Cells[0].Controls[1]).Text; //删除用户数据 if (operate.DelOperater(UserId)) { Common.ShowMsg("删除成功!"); //记录操作员操作 RecordOperate.SaveRecord(Session["UserID"].ToString(), "系统管理", "删除用户信息;用户ID:" + UserId); } Server.Transfer("System_UserAuthorization_Index.aspx"); } else { string Url = "System_UserAuthorization_Admin.aspx?UserID=" + ((Label)e.Item.Cells[0].Controls[1]).Text; Server.Transfer(Url); } }