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

📄 deptdel.jsp

📁 这是一个法律事务所系统源码
💻 JSP
字号:
<%--
模块名称:行政管理
模块功能:部门删除
版    本:V1.0
著 作 人:蔡静
著作日期:2001-10-25
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:= = = = = = = = = = = = = = = = = = = = = = = = = =
	修改日期:
	修 改 人:
	修改理由:
	修改出处:
	= = = = = = = = = = = = = = = = = = = = = = = = = =

--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
  Security auth = new Security();
  String employee_id = (String)session.getAttribute("employee_id");
  if(employee_id == null || employee_id.equals(""))
  {
    response.sendRedirect(response.encodeRedirectURL("../index.htm"));
  }
  String modelid = "Off023";
  int authflag = auth.popedom(employee_id, modelid);
  if(authflag == 0 || authflag == 2 || authflag == -1)
  {
%>
  <jsp:forward page="../inc/noauth.jsp" >
  </jsp:forward>
<%
  }
%>
<html>
<head>
<title>部门删除</title>
</head>
<body>                                                      
<form name="myForm" >
<%
  String sql;
  String dept_ids = request.getParameter("dept_ids");    
  String deptStr = "";
  ResultSet rs = null;
  ExtendString es = new ExtendString();
  String[] dept_id = new String[10];
  dept_id = es.Split(",",dept_ids);
  for (int i=0; i<es.length; i++) {
    sql = "select * from t_employee where dept_id='" + dept_id[i] + "'";
    rs = db.executeQuery(sql);
    if(rs.next())
    {
     	deptStr = deptStr + dept_id[i] + ".";
     	continue;
    }
    sql = "delete from t_dept where dept_id='" + dept_id[i] + "'";
    db.executeUpdate(sql);
  }

%>  
<input type="hidden" name="txtStr" value=<%=deptStr%>>
<%
  if(deptStr.equals(""))
  {
%>
<script language="javascript">
  alert("删除成功!");
  location = "Dept.jsp";
</script>
<%
  }else{%>  
<script language="javascript">
  alert("删除"+document.myForm.txtStr.value+"失败!部门中还有员工!");
  location = "Dept.jsp";
</script>
<%}%>
</form>
</body>
</html>

⌨️ 快捷键说明

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