📄 fileinfoaction.java
字号:
package com.stsc.archive.volumn;
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 com.stsc.archive.file.Constants;
public final class fileinfoAction 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)
{
Properties dbBase= new Properties();
dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
String archivetype=req.getParameter("archivetype");
String volumnno=req.getParameter("volumnno");
String volumntitle=req.getParameter("volumntitle");
String code=req.getParameter("code");
String category=req.getParameter("category");
String retentionperiod=req.getParameter("retentionperiod");
String startdate=req.getParameter("startdate");
String enddate=req.getParameter("enddate");
String totalnum=req.getParameter("totalnum");
String totalpage=req.getParameter("totalpage");
String duty=req.getParameter("duty");
String security=req.getParameter("security");
String archiveunit=req.getParameter("archiveunit");
String remark=req.getParameter("remark");
String status=req.getParameter("status");
String check=req.getParameter("check");
String check1=Iso2Gb(check);
String save=req.getParameter("save");
String save1=Iso2Gb(save);
System.out.println(Iso2Gb(save));
String sql="INSERT INTO fVolumn (ArchiveType,VolumnNo,VolumnTitle,Code,Category,RetentionPeriod,StartDate,EndDate,TotalNum,TotalPage,Duty,Security,Remark,Status) VALUES('"
+ Iso2Gb(archivetype)+"','" +Iso2Gb(volumnno)+"','" +Iso2Gb(volumntitle)+"','" +Iso2Gb(code)+"','" +Iso2Gb(category)+"','" +Iso2Gb(retentionperiod)+"','" +Iso2Gb(startdate)+"','" + Iso2Gb(enddate)+ "','" +Iso2Gb(totalnum)+"','" +Iso2Gb(totalpage)+ "','" +Iso2Gb(duty)+"','" +Iso2Gb(security)+ "','" +Iso2Gb(remark)+"','" +Iso2Gb(status)+"')";
STPoolDataSet data=new STPoolDataSet();
data.executeSQL(sql,dbBase);
System.out.println("数据保存进去了");
if(save1.equals("保存并返回首页"))
{
System.out.println("进入if语句");
System.out.println("保存并返回首页按钮");
return mapping.findForward("success1");
}
else//if(save=="保存并继续添加")
{
System.out.println(save1);
if(check1.equals("0"))
{
((fileinfoForm)form).setarchivetype(Iso2Gb(archivetype));
((fileinfoForm)form).setvolumnno(Iso2Gb(volumnno));
((fileinfoForm)form).setvolumntitle(Iso2Gb(volumntitle));
((fileinfoForm)form).setcode(Iso2Gb(code));
((fileinfoForm)form).setcategory(Iso2Gb(category));
((fileinfoForm)form).setretentionperiod(Iso2Gb(retentionperiod));
((fileinfoForm)form).setstartdate(Iso2Gb(startdate));
((fileinfoForm)form).setenddate(Iso2Gb(enddate));
((fileinfoForm)form).settotalnum(Iso2Gb(totalnum));
((fileinfoForm)form).settotalpage(Iso2Gb(totalpage));
((fileinfoForm)form).setduty(Iso2Gb(duty));
((fileinfoForm)form).setsecurity(Iso2Gb(security));
((fileinfoForm)form).setarchiveunit(Iso2Gb(archiveunit));
((fileinfoForm)form).setremark(Iso2Gb(remark));
((fileinfoForm)form).setstatus(Iso2Gb(status));
System.out.println("保存记录");
return mapping.findForward("success1");
}
else{
System.out.println("是不是进来了");
((fileinfoForm)form).reset( mapping, req);
return mapping.findForward("success1");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -