📄 sysroledel.java
字号:
package com.chis.model.user;
import com.stframe.dao.DaoUtil;
import com.stframe.form.ActionForm;
import com.stframe.servlet.ActionInstance;
/**
* 删除角色
* @author zxh
*
*/
public class SysRoleDel extends ActionInstance {
public int execute(ActionForm af) throws Exception {
String roleid = af.getHttpRequest().getParameter("id");
try{
//删除该角色群组表对应的数据
String rolegroupsql = "DELETE FROM SYS_GROUP_ROLE WHERE ROLE_ID='"+roleid+"'";
DaoUtil.execute(af.getConnection(),rolegroupsql);
//删除用户角色表中该角色得数据
String roleusersql = "DELETE FROM SYS_USER_ROLE WHERE ROLE_ID='"+roleid+"'";
DaoUtil.execute(af.getConnection(),roleusersql);
//删除角色功能表中该角色得数据
String rolefuncsql = "DELETE FROM SYS_ROLE_MODULE WHERE ROLE_ID='"+roleid+"'";
DaoUtil.execute(af.getConnection(),rolefuncsql);
//删除角色信息
String rolesql = "DELETE FROM SYS_ROLE WHERE ID='"+roleid+"'";
DaoUtil.execute(af.getConnection(),rolesql);
af.getHttpRequest().setAttribute("result","删除角色");
af.getHttpRequest().setAttribute("goto","Selevet.do?action=BASE_SYSROLE_LIST");
af.getHttpRequest().setAttribute("CMD",af.getHttpRequest().getParameter("CMD"));
return 1;
}catch(Exception e)
{
e.printStackTrace();
af.getHttpRequest().setAttribute("result","删除角色");
return 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -