📄 editaction.java
字号:
package com.stsc.archive.second;
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;
import java.util.Date;
import java.text.SimpleDateFormat;
public final class editAction extends Action
{
/*
public String Iso2Gb(String str)
{
String ret=(str==null) ? "" : str;
try
{
byte[] byteStr=str.getBytes("ISO-8859-1");
return new String(byteStr,"gb2312");
}
catch(Exception e)
{
return ret;
}
}*/
public ActionForward perform(ActionMapping mapping,ActionForm form,
HttpServletRequest req,HttpServletResponse res)
{
translate m=new translate();
String edit=req.getParameter("edit");
System.out.println(req.getParameter("edit"));
Properties dbBase=new Properties();
dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
STPoolDataSet data=new STPoolDataSet();
String sql="SELECT * FROM fVolumn WHERE VolumnID=" +m.Iso2Gb(edit);
//System.out.println(sql);
STResultSet rs=data.getSTResult(sql,dbBase);
rs.next();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM");
String startdate2=null;
String enddate2=null;
String category=rs.getString("Category");
String archivetype=rs.getString("ArchiveType");
String security=rs.getString("Security");
String volumnno=rs.getString("VolumnNo");
String code=rs.getString("Code");
String retentionperiod=rs.getString("RetentionPeriod");
HttpSession session=req.getSession();
session.setAttribute("ar",archivetype);
session.setAttribute("sql2",sql);
//2003-05-28 add by liqf
//存入密级,类目号
session.setAttribute("category",category);
session.setAttribute("security",security);
session.setAttribute("volumnno",volumnno);
session.setAttribute("code",code);
session.setAttribute("retentionperiod",retentionperiod);
String volumntitle=rs.getString("VolumnTitle");
if(rs.getDate("StartDate")==null && rs.getDate("EndDate")==null)
{
//startdate2="0";
//enddate2="0";
//System.out.println("进入if语句");
}
else if(rs.getDate("StartDate")==null && rs.getDate("EndDate")!=null)
{
//startdate2="0";
enddate2=sdf.format(rs.getDate("EndDate"));
//System.out.println("进入else if语句");
}
else if(rs.getDate("EndDate")==null && rs.getDate("StartDate")!=null)
{
//enddate2="0";
startdate2=sdf.format(rs.getDate("StartDate"));
//System.out.println("进入else if语句");
}
else
{
startdate2=sdf.format(rs.getDate("StartDate"));
enddate2=sdf.format(rs.getDate("EndDate"));
System.out.println(rs.getDate("StartDate"));
}
String totalnum=Integer.toString(rs.getInt("TotalNum"));
String totalpage=Integer.toString(rs.getInt("TotalPage"));
String duty=rs.getString("Duty");
String archiveunit=rs.getString("ArchiveUnit");
String remark=rs.getString("Remark");
String status=rs.getString("Status");
int volumnid=rs.getInt("VolumnID");
//System.out.println("status语句");
((fileinfoForm)form).setarchivetype(archivetype);
System.out.println(((fileinfoForm)form).getarchivetype());
((fileinfoForm)form).setvolumnno(volumnno);
((fileinfoForm)form).setvolumntitle(volumntitle);
((fileinfoForm)form).setcode(code);
((fileinfoForm)form).setcategory(category);
((fileinfoForm)form).setretentionperiod(retentionperiod);
((fileinfoForm)form).setstartdate(startdate2);
((fileinfoForm)form).setenddate(enddate2);
((fileinfoForm)form).settotalnum(totalnum);
((fileinfoForm)form).settotalpage(totalpage);
((fileinfoForm)form).setduty(duty);
((fileinfoForm)form).setsecurity(security);
((fileinfoForm)form).setarchiveunit(archiveunit);
((fileinfoForm)form).setremark(remark);
((fileinfoForm)form).setstatus(status);
((fileinfoForm)form).setvolumnid(volumnid);
System.out.println("editAction.java");
return mapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -