1. On the page
CopyCode The Code is as follows: <TD width = "4%" Height = "26" align = "center">
<Input type = "checkbox" name = "checkbox"
Value = <% = user. GETID () %>/>
</TD>
2. Action Copy code The Code is as follows: String [] checkbox = request. getparametervalues ("checkbox ");
List <integer> checkboxs = new arraylist <integer> ();
Int operatorid = sessionmgr. getaccountsession (request, response). GETID ();
Logger. debug ("-- operatorid --:" + operatorid );
// Check whether the check box is selected
If (checkbox! = NULL &&! "". Equals (checkbox )){
For (INT I = 0; I <checkbox. length; I ++ ){
// Checkboxs. Add (checkbox [I]);
String id_str = checkbox [I];
Int id = integer. parseint (id_str );
// Determine whether it is your own
If (ID = operatorid ){
Message = "users cannot be deleted ";
}
// Determine if it is an admin super Administrator
If (ID = 1 ){
Message = "Admin users cannot delete ";
}
// Determine whether the user has a ticket
Boolean isexist = false;
Isexist = usermgr. isexistworkbillofuser (ID );
Logger. debug ("-- isexist --:" + isexist );
If (isexist ){
Message = "this user cannot delete a ticket ";
}
If (ID! = Operatorid & ID! = 1 &&! Isexist ){
Checkboxs. Add (ID );
}
}
Try {
Usermgr. deleteuser (checkboxs );
Message = "deleted successfully! ";
} Catch (systemexception SE ){
Logger. Error (SE );
}
}
Else {
Message = "You have not selected a user! ";
}