?? jcy_jcyjc_submit_cf.jsp
字號:
<%@ page contentType="text/html; charset=GBK" language="java" import="java.sql.*,com.vstsoft.std.*" errorPage="" %>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<jsp:useBean id="jcypurview" class="com.vstsoft.jcypurview" scope = "session" />
<html>
<%vststd std = new vststd();%>
<%
String jcyjcxh_id = std.getValue(request,"ID"); //公務員獎懲代碼
String szt = std.getValue(request,"zt"); //按鈕類別
String imager = "";
String userid = std.getValue(request,"userid"); //公務員編號
int ixy = 0;
String sfjl =""; //是否獎勵
String lry =""; //錄入人
%>
<%
if (jcypurview.checkLogin() == false)
{
%>
<Script Language=javascript>
alert("用戶已斷線或未正常登錄,請重新登錄!")
window.open("../index.htm","_top")
</Script>
<% return;
}
if (szt.equals("del"))
{
if (jcypurview.purviewVerdict("B0500026") == false) //判斷是否有刪除權限
{
%>
<Script Language=javascript>
alert("您沒有操作此頁權限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}
if (szt.equals("modify"))
{
if (jcypurview.purviewVerdict("B0500024") == false) //判斷是否有修改權限
{
%>
<Script Language=javascript>
alert("您沒有操作此頁權限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}
if (szt.equals("new"))
{
if (jcypurview.purviewVerdict("B0500025") == false) //判斷是否有新增權限
{
%>
<Script Language=javascript>
alert("您沒有操作此頁權限!")
window.open("../index.jsp","_top")
</Script>
<% return;
}
}%>
<%
String nowuserid = jcypurview.getUserid(); //取當前用戶編號
String nowusername = jcypurview.getUserName(); //取當前用戶名稱
String nowuserszqx = jcypurview.getUserSzqx(); //取當前用戶所在區縣
String nowuserszdw = jcypurview.getUserSzdw(); //取當前用戶所在單位
%>
<%//新增單位
if ( szt.equals("new"))
{
String jcyy = std.getValue(request,"jcyy").trim(); //單位獎懲原因
if (jcyy.equals(""))
{
imager = "懲罰名稱不能為空!";
ixy = 1;
}
if (ixy != 1)
{
if (jcyy.length() > 500)
{
imager = "懲罰名稱長度不能大于500位!";
ixy = 1;
}
}
String jcrq =std.getValue(request,"rq"); //獎懲日期
String cfzl =std.getValue(request,"cfzl");
if (ixy == 0)
{
String lrrq = std.getDateStr("YYYY.MM.DD"); //取數據庫時間
String jcyjcxh ="SELECT LPAD(SEQ_jcyID.NEXTVAL,10,'0') FROM DUAL"; //獎懲編號
sun.jdbc.rowset.CachedRowSet crs = std.getResultBySelect("SELECT LPAD(SEQ_jcyID.NEXTVAL,10,'0') FROM DUAL");
crs.next();
String suserid = crs.getString(1);
//新增單位信息
String sql_insert = "insert into jcy_jcyjc (jcyjcxh) values ('"+suserid+"')";
int isi = std.getResultByUpdate(sql_insert);
if (isi == 1 )
{
String sql_update = "update jcy_jcyjc set userid='"+userid+"',sfcf='01',cfzl='"+cfzl+"',jcrq=to_date('"+jcrq+"','YYYY.MM.DD'),jcyy='"+jcyy+"',lrrq=to_date('"+lrrq+"','YYYY.MM.DD'),lry='"+nowuserid+"' where jcyjcxh = '"+suserid+"'";
int isu = std.getResultByUpdate(sql_update);
if (isu == 1)
{
imager = "保存成功!";
//return;
}else
{
ixy = 1;
imager = "新增失敗!";
}
}
}
}
//修改單位
if (szt.equals("modify"))
{
//修改單位
String jcyy = std.getValue(request,"jcyy").trim(); //單位原因
if (jcyy.equals(""))
{
imager = "懲罰名稱不能為空!";
ixy = 1;
}
if (ixy != 1)
{
if (jcyy.length() > 500)
{
imager = "懲罰名稱長度不能大于500位!";
ixy = 1;
}
}
String jcrq =std.getValue(request,"rq"); //獎懲日期
String cfzl =std.getValue(request,"cfzl");
String lrrq = std.getDateStr("YYYY.MM.DD"); //取數據庫時間
if(ixy == 0)
{
String sql_modify_update = "update jcy_jcyjc set userid='"+userid+"',sfcf='01',cfzl='"+cfzl+"',jcrq=to_date('"+jcrq+"','YYYY.MM.DD'),jcyy='"+jcyy+"',lrrq=to_date('"+lrrq+"','YYYY.MM.DD'),lry='"+nowuserid+"' where jcyjcxh = '"+jcyjcxh_id+"'";
int imodify = std.getResultByUpdate(sql_modify_update);
if (imodify == 1 )
{
imager = "修改成功!";
}else
{
ixy = 1;
imager = "修改失敗!";
}
}
}
//單位懲罰信息刪除
if(szt.equals("del"))
{
String sql_del = "delete from jcy_jcyjc where jcyjcxh = '"+jcyjcxh_id+"'";
int idel = std.getResultByUpdate(sql_del);
if (idel == 1)
{
//imager = "減少成功!";
imager = "刪除成功!";
}else
{
ixy = 1;
imager = "刪除失敗!";
}
}
%>
<head>
<title>
</title>
</head>
<body onLoad="parent.f_imager('<%=imager%>','<%=ixy%>')">
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -