📄 delviewpopedomaction.java
字号:
package com.stsc.archive.manage;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import java.util.Properties;
import org.apache.struts.util.MessageResources;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;
public final class DelViewPopedomAction extends Action
{
public ActionForward perform(ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)
{
System.out.println("mapping.getAttribute(): = " + mapping.getAttribute());
System.out.println("mapping.getScope(): = " + mapping.getScope());
String roleId = req.getParameter("roleid");
int iRoleId = Integer.parseInt(roleId);
System.out.println(roleId);
Properties dbBase = new Properties();
dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
STPoolDataSet data = new STPoolDataSet();
//---------------删除----------------------------------------------
String[] strValues = req.getParameterValues("enterName");
if( (strValues != null) && (strValues.length > 0) )
{
String delSql = "DELETE FROM fUserRole WHERE RoleID=" + iRoleId + "and (EnterName='" + strValues[0] + "'";
System.out.println(strValues[0]);
int iLeng = strValues.length;
for(int i=1; i<iLeng; i++)
{
delSql += " OR EnterName='" + strValues[i] + "'";
System.out.println(strValues[i]);
}
delSql += ")";
data.executeSQL(delSql, dbBase);
}
else
{
System.out.println("No find enterName");
}
//=================================================================
/**
String sql = "SELECT EnterName,UserName FROM fUserName where EnterName IN (SELECT EnterName from fUserRole WHERE RoleID=" + iRoleId + ")";
STResultSet rs = data.getSTResult(sql, dbBase);
PopedomUserList users = new PopedomUserList();
while(rs!=null && rs.next())
{
User user = new User();
user.setEnterName(rs.getString("EnterName"));
user.setUserName(rs.getString("UserName"));
users.addUser(user);
}
users.setRoleid(iRoleId);
HttpSession session = req.getSession();
session.setAttribute("popedomUsers", users);
//--------为隐藏域所用------------------------
RoleUser roleuser = new RoleUser();
roleuser.setRoleid(iRoleId);
session.setAttribute("ROLEID", roleuser);
//============================================
String strRole = "";
sql = "SELECT Role FROM fRole WHERE RoleID=" + iRoleId;
rs = data.getSTResult(sql, dbBase);
while(rs!=null && rs.next())
{
strRole = rs.getString("Role");
}
session.setAttribute("role", strRole);
System.out.println(strRole);
*/
CommonSql comsql = new CommonSql();
comsql.ToViewPopedom(form, req, iRoleId);
return mapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -