⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 personduty_son.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
字号:
<%
/**********************************************************
Copyright (C),2003-10-18, Beijing  USTB.
All rights reserved.
Filename: workerDuty.jsp
Author:    
Version 1.0
Date:2003-10-18
Description:个人职务管理.jsp
Function List://主要方法列表
1.  ...
History://修改历史纪录表,包括修改日期、修改者、修改内容简述
1.  Date:2003-10-18
    Author:
    Modification:
2.Date:2003-10-22
    Author:
    Modification:修改  
***********************************************************/
%>
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,oa.main.DealString"%>

<%
oa.bean.PersonDutyBean myBean = null;
oa.bean.DepartmentBean dpBean = null;
oa.bean.PersonBean psBean = null;
oa.bean.RightBean rtBean = null;
try{
	myBean = new oa.bean.PersonDutyBean(); 
	dpBean = new oa.bean.DepartmentBean(); 
	psBean = new oa.bean.PersonBean();
	rtBean = new oa.bean.RightBean();

	if ( myBean.getConn() == null
		|| dpBean.getConn() == null
		|| psBean.getConn() == null
		|| rtBean.getConn() == null )
	{
		%>		
		数据库无法响应,请<a href="javascript:window.history.back(-1);">返回</a>重试
		<%out.close();
	}

  	DealString ds = new DealString();
	//取得菜单类别
	String strType = ds.toString((String)request.getParameter("txt_type"));

	//组织机构编号
	String strOrgNO = ds.toString((String)request.getParameter("txt_orgno"));

	//职务编号
	String strDutyNO = ds.toString((String)request.getParameter("txt_dutyno"));

	//增删改类型
	String strEdit = ds.toString((String)request.getParameter("txt_edit"));

	//取得当前人员编号
	String strPersonNo = ds.toString((String)request.getParameter("txt_personno"));

	//第几页
	String strPage = ds.toString((String)request.getParameter("txt_page"));
%>
<%
String userid = (String)session.getAttribute("zgbh");//从session取出来  
if(userid==null || userid.equals(""))
{
	System.out.println("session过期,请重新登陆!");
}
%>	

<%//权限判断
	rtBean.setUID(userid);
	rtBean.setOrgid(strOrgNO);
%>

<%
	String bmbh = dpBean.getBMBH(strPersonNo);
	String bmMC = psBean.getFatherName(bmbh);//strOrgNO
	bmMC+= myBean.getOrgName(bmbh);
	String zgXM = myBean.getPersonName(strPersonNo);
	String mixName = myBean.getBMMC_ZWMC(strPersonNo);
	String strzgNo = psBean.getZGGH(strPersonNo);
%>

<br>

<div align=center>
<font color="#CC00FF" size=2><b>分配职务<b></font>
</div>
<br>

<table id="t1" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="D0E7FF" width="100%" height="2">
   <tr bgColor="#ffffff" height="22">
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" value="分配职务" class=fashion onmouseover="msover();" onmouseout="msout();" onclick="return toServlet(1)">
		&nbsp;
  <%
  if(rtBean.isRightModelbh("分派职务","删除人的职务"))
  {
  %>  
		<input type="button" value="删除职务" class=fashion onmouseover="msover();" onmouseout="msout();" onclick="return toServlet(2)">
		&nbsp;
<%} %>
		<input type="button" value="返回" class=fashion onmouseover="msover();" onmouseout="msout();"onclick="backtoAddPage()">
	 </td>
   </tr>
 </table>
<table class="tab" cellSpacing="0" cellPadding="0" width="100%" border="0">
 <tbody>
    <tr align="left" bgColor="#2969b5" height="22">
       <td></td></tr></tbody></table>
	<TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=3 ALIGN=center style="table-layout:fixed;word-break:break-all" align=center>
		<tr align=center bgColor="#d0e7ff" height="22">
		  <td width="30%" align="right">将被分配职务的职工:</td>
		  <td width="22%" align="center"> &nbsp;部门名称:</td>         
		  <td colspan=2 width="44%" align="left" bordercolor="#F6FEE8">
          <font color="#FFFFFF">
		  <span style="background-color: #d0e7ff">
		  <input type="text" size="40" value="<%=bmMC%>" name="txt_personBmName" class=txtframe style="background-color: #d0e7ff; color: #000000; border-style: solid; border-color: #d0e7ff" readonly> 		  	  
          </span></font> 
		  		  
		  </td>
		  <!--td width="22%" > </td-->

		</tr>
		<tr align=center  bgColor="#ffffff" height="22">
		  <td width="30%" > </td>
		  <td width="22%" align="center"> &nbsp;工&nbsp;&nbsp;号&nbsp;:</td>
		  <td width="22%" align="left">
		  <input type="text" size="20" value="<%=strzgNo%>" name="txt_personNo" class=txtframe bgcolor=#D0E7FF style="background-color: #ffffff; border-style: solid; border-color: #ffffff" readonly> 		  
		  </td>
		  <td width="22%" > </td>

		</tr>
		<tr align=center bgColor="#d0e7ff" height="22">
		  <td width="30%" > </td>
		  <td width="22%" align="center"> &nbsp;职工姓名:</td>
		  <td width="22%" align="left">
		  <input type="text" size="20" value="<%=zgXM%>" name="txt_personName" class=txtframe style="background-color: #d0e7ff; border-style: solid; border-color: #d0e7ff" readonly> 		  
		  </td>
		  <td width="22%" > 
		  </td>
		</tr>
		<tr align=center bgColor="#ffffff" >
		  <td width="30%" > </td>
		  <td width="22%" align="center">&nbsp;&nbsp;已分配职务:</td>
		  <td colspan="2" width=""align="left">
			<textarea rows="7" name="zwmc" cols="50" style="border-style: double; border-color: #d0e7ff" readonly><%=mixName%></textarea>
		   </td>
		</tr>
		<tr>
		  <td width="30%" bgColor="#d0e7ff" height="22">&nbsp;&nbsp;</td>
		  <td width="22%" bgColor="#d0e7ff" height="22">&nbsp;&nbsp;</td>
		  <td width="22%" bgColor="#d0e7ff" height="22">&nbsp;&nbsp;</td>
		  <td width="22%" bgColor="#d0e7ff" height="22">&nbsp;&nbsp;</td>
		</tr>
		<tr align=center bgColor="#ffffff" height="22">
		  <td width="30%" align="right">将被分配的职务:
<%
String dutybmno = ds.toGBK((String)request.getParameter("hid_dutybmno"));
if(dutybmno==null)dutybmno="";
%>
		  <input type=hidden size="15" name="hid_dutybmno" value="<%=dutybmno%>"class="" readonly > <!-----------------隐藏框储存所选部门编号---------------------->
		  </td>
		  <td width="22%" align="center"> &nbsp;部门名称:</td>
		  <td width="22%" align="left">
<%
	String bmName = ds.toGBK((String)request.getParameter("txt_dutyBmName"));
	if(bmName==null)bmName="";
%>
		  <input type="text" size="20" value="<%=bmName%>" name="txt_dutyBmName" class=txtframe readonly> 		  
		  </td>
		  <td width="22%" align=""> 
            <input type="button" value="选择部门" name="bmmcxz" class=fashion onmouseover="msover();" onmouseout="msout();" onclick="gototree()"> <!--gototree() selduty()-->
          </td>

		</tr>
		<tr bgColor="#d0e7ff" height="22">
		  <td width="30%" > </td>
		  <td width="22%" align="center">&nbsp;职务名称:</td>
		  <td width="22%" align="left">
			<input type="text" size="20" name="txt_dutyName" class=txtframe readonly> 		  
			<input type="hidden" name="hid_dutyzwno" class=txtframe readonly>  
		  </td>

		  <td width="22%" align="left">
			<select name=leftselect size=1 style="width:130;" onchange="onchg(this)">
			<option value="">请选择职务</option>
		<%
		Vector vt = new Vector();
		
		if(dutybmno!=null && !dutybmno.equals(""))
		{
			//得到所有的职务名称
			dpBean.setID(dutybmno);//00000000000000000000
			vt = (Vector)dpBean.getOrgDutys();
			for(int i=0;i<vt.size();i++)
			{
				String zwName = (String)(((Hashtable)(vt.get(i))).get("ZWMC"));	
		%>
				<option value="<%=zwName%>"><%=zwName%></option>;
		<%
			}
		}
		%>
			</select>		  
		  </td>
		  <td width="22%" > </td>
		</tr>	
<%
	String oper = (String)request.getParameter("txt_doright");
	String flow = ds.toGBK((String)request.getParameter("txt_roadright"));
	if(oper==null)oper="";
	if(flow==null)flow="";

%>
  <%
  if(rtBean.isRightModelbh("分派职务","同时分派权限"))
  {
  %>  
    <tr bgColor="#ffffff" height="22">
	  <td   align="right">&nbsp;修改操作权限 :</td>
	  <td  colspan="3" align="left">
	  <input type="text" size="40" value="<%=oper%>" name="txt_doright" class=txtframe readonly>
	  <input type="button" value="选择操作" class=fashion onmouseover="msover();" onmouseout="msout();"onclick="GoCzqxWindow(1);">
	
	  
	  <input type="hidden" size="40" value="<%=flow%>" name="txt_roadright" class=txtframe readonly>
	  </td>
<%}%>

</table>


<script>
	function toServlet(edittype)
	{
		if(edittype==1)
		{
			if(document.all.form1.txt_dutyBmName.value=="" || document.all.form1.txt_dutyName.value=="")
			{
				alert("请选择部门或职务!");
				return false;
			}	
			document.all.txt_type.value = "4";
			document.all.txt_edit.value = "4";//新增
			document.all.form1.action="../../Org"
			document.all.form1.submit();
		}
		if(edittype==2)
		{			
			var url = "delDuty.jsp?txt_orgno=<%=strOrgNO%>&txt_personno=<%=strPersonNo%>";
			var hWnd = window.open(url,"HelpWindow","width=500,height=335,resizable=no,scrollbars=yes");
			if ((document.window != null) && (!hWnd.opener)) 
				hWnd.opener = document.window;
			hWnd.focus();
		}
		document.all.txt_personno.value = "<%=strPersonNo%>";//个人职务表
		return true;
	}

	function gototree()
	{
		var url = "";
		url = "selDadbm.jsp?flg=2";
		var hWnd_son = window.open(url,"HelpWindow11","width=500,height=335,resizable=no,scrollbars=yes");
		if ((document.window != null) && (!hWnd_son.opener)) 
		   hWnd_son.opener = window; //document.window;		   
	    hWnd_son.focus();
	}

	function onchg(selobj)
	{
		var choice = selobj.selectedIndex;
		document.all.txt_dutyName.value = selobj.options[choice].value;
	}
	function GoCzqxWindow(id)//选择操作权限formname
	{
		var url = "";
		if(id==1)
			url ="middle.jsp?t=1"// "selectczqx.jsp";
		if(id==2)
			url ="middle.jsp?t=2"// "sellcqx.jsp?strlcqx="+document.all.txt_roadright.value;
		var hWnd = window.open(url,"HelpWindow2","width=600,height=435,resizable=yes,scrollbars=yes");
	    if ((document.window != null) && (!hWnd.opener)) 
		    hWnd.opener = document.window;
	    hWnd.focus();
	}

		function backtoAddPage()
	{
		//判断操作人是否有发表文章权限
<%		
		rtBean.setUID(strPersonNo);
		rtBean.setOrgid("-1");
		boolean bool = rtBean.isRightMode("主页管理","发表文章");
		if(bool==true)
		{	%>
		
			document.all.txt_page.value = "4";		

<%		}else{	%>
		
			document.all.txt_page.value = "5";

<%		}	%>	
		document.all.txt_type.value = "3";
		document.all.txt_edit.value = "1";		
		document.all.txt_orgno.value = "<%=strOrgNO%>";
		document.all.txt_personno.value = "<%=strPersonNo%>";			
		document.all.form1.action = "index.jsp";
		document.all.form1.submit();	
	}
</script>
<%}finally{
	if(myBean!=null)myBean.closeConn();
	if(dpBean!=null)dpBean.closeConn();
	if(psBean!=null)psBean.closeConn();
	if(rtBean!=null)rtBean.closeConn();
}
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -