📄 pressserv.jsp
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="foton.util.*" %>
<%@ page import="foton.index.*" %>
<%@ page import="java.util.*" %>
<SCRIPT language=javascript>
var isSure=false;
function OpenWin(theURL,winName,features)
{
window.open(theURL,winName,features);
}
function toOpen(str1,str2)
{
if(str1==str2)
{
OpenWin('../job/job_insert.jsp','newWin','scrollbars=yes,width=800,height=600');
}
else
{
alert("密码不对!");
return false;
}
}
</SCRIPT>
<html> <body>
<%
String ID = request.getParameter("ID");
String caption = request.getParameter("caption");
String content = request.getParameter("content");
String jobID = request.getParameter("jobID");
String choice = request.getParameter("action");
String[] check = request.getParameterValues("check");
System.out.println("check="+check);
transCode trans = new transCode();
choice = trans.transCode(choice);
//if(choice.equals("保存")) choice="STORE";
if(choice.equals("更新")) choice="UPDATE";
if(choice.equals("更&新")) choice="GENGXIN";
if(choice.equals("保存")) choice="INSERT";
if(choice.equals("删除")) choice="DEL";
if(choice.equals("增加")) choice="ADD";
pressDAO dao = new pressDAO();
urgentDAO udao = new urgentDAO();
pressInfo info= new pressInfo();
// String ID = String.valueOf(dao.getID());
String picURL = (String)session.getAttribute("picURL");
if(picURL==null) picURL="";
System.out.println("here is pressServ. picURL="+picURL);
//session.removeAttribute("picURL");
info.setID(ID);
info.setCaption(caption);
info.setJobID(jobID);
info.setContent(content);
info.setPicURL(picURL);
////
if (choice.equals("INSERT")) {
dao.insertPress(info);
System.out.println("Here is jobAction!! Successful to insert data into datbase!!!");
%>
<jsp:forward page="../index/press_list.jsp"/>
<%
//prompt = "INSERT";
}
if (choice.equals("DEL")) {
if(check!=null) {
int num = check.length;
for (int i=0; i<=num-1; i++) {
System.out.println("check[i]="+check[i]);
dao.delPress(check[i]);
}
System.out.println("Successful to del data from datbase!!!");
%>
<jsp:forward page="../index/press_list.jsp"/>
<%
}
else {
%>
<script language="javascript">
alert('请选择要删除的条目!');
window.top.location="press_list.jsp";
</script>
<%
}
//prompt = "INSERT";
}
////////////
if (choice.equals("ADD")) {
%>
<jsp:forward page="../index/press_insert.jsp"/>
<%
}
if(choice.equals("UPDATE"))
{ System.out.println("UPDATE begin!!!");
dao.updatePress(info);
System.out.println("successful to UPDATE datbase!!!");
//out.println("数据已经更新!请返回!");
//out.println("数据已经更新!请返回!");
%>
<jsp:forward page="../index/press_list.jsp"/>
<%
//prompt = "UPDATE";
}
if(choice.equals("GENGXIN"))
{ System.out.println("UPDATE begin!!!");
udao.updateUrgent(info);
System.out.println("successful to UPDATE datbase!!!");
//out.println("数据已经更新!请返回!");
//out.println("数据已经更新!请返回!");
%>
<script language="javascript">
alert('信息已经更新!');
window.top.location="../index/press_list.jsp";
</script>
<%
//prompt = "UPDATE";
}
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -