Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
5b602f1250 | 6 years ago |
|
9143746f31 | 6 years ago |
@ -1,17 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Java EE 6-Java EE 6">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.jms.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.annotation.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.ejb.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.persistence.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.transaction.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.resource.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jsp.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jsp.jstl.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/classes" />
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/demo.iml" filepath="$PROJECT_DIR$/demo.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,82 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>校园宿舍管理系统</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">校园宿舍管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="Left.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">学生缺寝记录</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE"><form name="form1" method="post" action="AdminLogList.action" onSubmit="return mycheck()" >
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="33%" height="30" align="right"> </td>
|
||||
<td width="67%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right">楼宇:</td>
|
||||
<td><select name="Building_ID" id="Building_ID" onChange="javascript:window.location='AdminLog.action?BuildingID='+this.value;">
|
||||
<option value="">请选择</option>
|
||||
<s:iterator value="buildinglist">
|
||||
<option value="${Building_ID}" <s:if test="BuildingID==Building_ID">selected</s:if>>${Building_Name}</option>
|
||||
</s:iterator>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right">寝室:</td>
|
||||
<td><select name="Domitory_ID" id="Domitory_ID">
|
||||
<option value="">请选择</option>
|
||||
<s:iterator value="domitorylist">
|
||||
<option value="${Domitory_ID}">${Domitory_Name}</option>
|
||||
</s:iterator>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right">学生学号:</td>
|
||||
<td><%--@declare id="student_id"--%><label for="Student_ID"></label>
|
||||
<input type="text" name="Student_Username" id="Student_Username"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30"> </td>
|
||||
<td><input type="submit" name="button" id="button" value="开始查询"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,59 +0,0 @@
|
||||
<%@ page import="java.util.Date" %>
|
||||
<%@ page import="java.text.SimpleDateFormat" %><%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: Vie
|
||||
Date: 2019/10/24
|
||||
Time: 15:25
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/12.png");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<html>
|
||||
<head>
|
||||
<title>电费使用情况</title>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="StudentLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</center>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,82 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/30
|
||||
Time: 10:04
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
|
||||
<%@page import="java.sql.ResultSet"%>
|
||||
<%@page import="java.sql.PreparedStatement"%>
|
||||
<%@page import="java.sql.DriverManager"%>
|
||||
<%@page import="java.sql.Connection"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,
|
||||
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<title>学生信息</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/bg11.jpg");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
String driver = "com.mysql.cj.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8"
|
||||
+"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ;
|
||||
String usr = "root";
|
||||
String password = "123456";
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
Connection conn = DriverManager.getConnection(url, usr, password);
|
||||
String sqlString = "select * from electricity";
|
||||
PreparedStatement pstmt = conn.prepareStatement(sqlString);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
%>
|
||||
|
||||
<%--<div align="right">欢迎你,<%=request.getParameter("username")%>--%>
|
||||
|
||||
<%-- <a href="logout.jsp">退出</a>--%>
|
||||
|
||||
<%--</div>--%>
|
||||
|
||||
<h2 align="center">宿舍电费列表</h2>
|
||||
|
||||
<br>
|
||||
|
||||
<table border=1 style="margin:auto">
|
||||
|
||||
<tr>
|
||||
<td class="listTable">宿舍号</td>
|
||||
<td class="listTable">电费余额</td>
|
||||
<td id="operate">操作</td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
while (rs.next()) {
|
||||
out.println("<tr>");
|
||||
out.println("<td>" + rs.getString("Electricity_id") + "</td>");
|
||||
out.println("<td>" + rs.getString("Electricity_cost") + "</td>");
|
||||
out.println("<td><a href='www.baidu.com'>修改</a></td>");
|
||||
out.println("</tr>");
|
||||
}
|
||||
%>
|
||||
|
||||
</table>
|
||||
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,154 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/11/20
|
||||
Time: 11:32
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%>
|
||||
|
||||
<%--<%@page import="com.sun.xml.internal.txw2.Document"%>--%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
<span style="font-size:18px;">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||||
<title>动态表格</title>
|
||||
<style type="text/css">
|
||||
body{ background-color:#9CC; text-align:center}
|
||||
table{ margin:10px auto;}
|
||||
tr th { border: 1px solid #096;}
|
||||
td{border: 1px solid #096;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
/*在函数的外部只能声明一些变量之类的,不能用操作方法,因为没有函数去调用执行它。*/
|
||||
//在载入页面的时候就在表格头放入选择框,因为是一次性的
|
||||
window.onload = function(){
|
||||
var tab = document.getElementById('tab');
|
||||
var firsttr = document.getElementsByTagName('tr')[0];
|
||||
var childtd = firsttr.childNodes;
|
||||
//在第一行第一列上加入选择框
|
||||
var inp = document.createElement('input');
|
||||
inp.type = 'checkbox';
|
||||
|
||||
//DOM Leve 2 事件注册
|
||||
catchEvent(inp,'click',function(){ //注册函数 不同状态进行判断
|
||||
if(inp.checked ==true){
|
||||
allSelect();
|
||||
}else{
|
||||
cancelSelect();
|
||||
}
|
||||
});
|
||||
//catchEvent(inp,'click',allSelect);
|
||||
//catchEvent(inp,'change',cancelSelect);
|
||||
childtd[0].appendChild(inp);
|
||||
|
||||
}
|
||||
//增加一行
|
||||
//var count =0;//增加一列用来 计数
|
||||
function addRow(){
|
||||
//count++;
|
||||
var tab = document.getElementById('tab');
|
||||
var firsttr = document.getElementsByTagName('tr')[0];
|
||||
var childtd = firsttr.childNodes;
|
||||
var tr = document.createElement('tr');
|
||||
var arrtd = new Array();
|
||||
var arrinp = new Array();
|
||||
for(var i =0;i<childtd.length;i++){
|
||||
arrtd[i] = document.createElement('td');
|
||||
arrinp[i] = document.createElement('input');
|
||||
if(i==0){
|
||||
arrinp[i].type = 'checkbox';
|
||||
arrinp[i].name = 'selectbox';
|
||||
}else if(i==1){
|
||||
//arrinp[i] = document.createTextNode(count);
|
||||
arrinp[i] = document.createTextNode('');
|
||||
}
|
||||
arrtd[i].appendChild(arrinp[i]);//思考为什么 input也要加上数组。
|
||||
tr.appendChild(arrtd[i]);
|
||||
}
|
||||
|
||||
tab.appendChild(tr);
|
||||
newSort();
|
||||
}
|
||||
//删除操作
|
||||
function deleteRow(){
|
||||
var parentTr = new Array();//先把被选中的行放在一个数组上
|
||||
var box = document.getElementsByName('selectbox');
|
||||
var tab = document.getElementById('tab');
|
||||
for(var i = 0;i<box.length;i++){
|
||||
if(box[i].checked==true){
|
||||
var parent = box[i].parentNode;
|
||||
parentTr[i] = parent.parentNode;//如果直接这种为放在里面为什么不能完全删除??是因为反应不够吗?
|
||||
//tab.removeChild(parentTr);
|
||||
}
|
||||
}
|
||||
for(var i = 0;i<parentTr.length;i++){ //这样做才能把选中的全部删除
|
||||
if(parentTr[i]){ //这边要先判断一下是否为空值,如果不为空才去移除,否者会报错。
|
||||
tab.removeChild(parentTr[i]);
|
||||
}
|
||||
}
|
||||
newSort();
|
||||
}
|
||||
|
||||
//如果执行删除的话则,重新进行排序
|
||||
function newSort(){
|
||||
var text = new Array();
|
||||
var child_td = new Array();
|
||||
var arr_tr = document.getElementsByTagName('tr');
|
||||
for(var i = 1;i<arr_tr.length;i++){
|
||||
child_td[i] = arr_tr[i].childNodes[1];//获得从第二行开始所有第二列的节点
|
||||
if(child_td[i].childNodes[0]){
|
||||
child_td[i].removeChild(child_td[i].childNodes[0]);
|
||||
}
|
||||
text[i] = document.createTextNode(i);
|
||||
child_td[i].appendChild(text[i]);
|
||||
|
||||
}
|
||||
}
|
||||
//全选操作
|
||||
function allSelect(){
|
||||
var box = document.getElementsByName('selectbox');
|
||||
for(var i= 0;i<box.length;i++){
|
||||
box[i].checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
//全部取消选择
|
||||
function cancelSelect(){
|
||||
var box = document.getElementsByName('selectbox');
|
||||
for(var i = 0;i<box.length;i++){
|
||||
if(box[i].checked == true){
|
||||
box[i].checked =false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//事件注册函数
|
||||
function catchEvent(eventobj,event,eventHandler){
|
||||
if(eventobj.addEventListener){
|
||||
eventobj.addEventListener(event,eventHandler,false);
|
||||
}else if(eventobj.attachEvent){
|
||||
event = 'on'+event;
|
||||
eventobj.attachEvent(event,eventHandler);
|
||||
}
|
||||
}
|
||||
|
||||
//catchEvent(add,'click',addRow);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>动态表格</h3>
|
||||
<input type="button" value="增加" id="add" onclick="addRow()" />
|
||||
<input type="button" value="全部选择" onclick="allSelect()" />
|
||||
<input type="button" value="全部取消" onclick="cancelSelect()" />
|
||||
<input type="button" value="删除" id="delete" onclick="deleteRow()"/>
|
||||
<table id="tab" cellpadding="5px" cellspacing="0px">
|
||||
<tr><td></td><td>序号</td><td>题目一</td><td>题目二</td><td>题目三</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html></span>
|
||||
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 267 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 664 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 73 KiB |
@ -1,94 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
<table width="155" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="31" align="center" background="Images/left1.jpg"><strong>系统选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="50" align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="Index.jsp">后台首页</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<%if(session.getAttribute("type").toString().equals("1")){%>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="TeacherManager.action">楼宇管理员管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentManager.action">学生管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="DomitoryManager.action">宿舍管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairManager.action">维修管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentTH.jsp">学生寝室调换</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<%}%>
|
||||
|
||||
<%if(session.getAttribute("type").toString().equals("3")){%>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentLog.action">查询剩余电费</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairAdd.jsp">上报维修信息</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairList.action">我的维修记录</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<%}%>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="PasswordUpdate.jsp">修改密码</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="Quit.action" onclick="return confirm('确定要退出系统吗?')">退出系统</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@ -1,79 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: Vie
|
||||
Date: 2019/10/24
|
||||
Time: 16:03
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>管理员首页</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" > </div>
|
||||
<table width="155" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="31" align="center" background="Images/left1.jpg"><strong>系统选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="50" align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="ManagerPage.jsp">后台首页</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentManage.jsp"> 学生信息管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="NoticeManage.jsp">宿舍公告管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="ElectricManage.jsp">宿舍电费管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentRZ.action">学生入住登记</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairedManage.jsp"> 学生报修管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="PasswordUpdate2.jsp">修改密码</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="http://localhost:8080/StudentManageSystem_war_exploded/" onclick="return confirm('确定要退出系统吗?')">退出系统</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -1,93 +0,0 @@
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %><%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: Vie
|
||||
Date: 2019/10/24
|
||||
Time: 16:03
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>管理员首页</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg");
|
||||
}
|
||||
img{
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
top: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<img src="Images/12.png">
|
||||
<table width="155" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="31" align="center" background="Images/left1.jpg"><strong>系统选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="50" align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="ManagerPage.jsp">后台首页</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentManage.jsp"> 学生信息管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="NoticeManage.jsp">宿舍公告管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="ElectricManage.jsp">宿舍电费管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentRZ.action">学生入住登记</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairedManage.jsp"> 学生报修管理</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="PasswordUpdate2.jsp">修改密码</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="http://localhost:8080/StudentManageSystem_war_exploded/" onclick="return confirm('确定要退出系统吗?')">退出系统</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,104 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>校园宿舍管理系统</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
|
||||
|
||||
function mycheck(){
|
||||
if(isNull(form1.Student_Username.value)){
|
||||
alert("请输入学号!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Password.value)){
|
||||
alert("请输入密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Password2.value)){
|
||||
alert("请输入重复密码!");
|
||||
return false;
|
||||
}
|
||||
if (document.form1.Student_Password.value != document.form1.Student_Password2.value) {
|
||||
alert("您两次输入的新密码不一致!请重新输入!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Name.value)){
|
||||
alert("请输入姓名!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Sex.value)){
|
||||
alert("请选择性别!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Class.value)){
|
||||
alert("请输入班级!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNull(str){
|
||||
if ( str == "" ) return true;
|
||||
var regu = "^[ ]+$";
|
||||
var re = new RegExp(regu);
|
||||
return re.test(str);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">校园宿舍管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="Left.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">学生缺寝记录</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="100%" height="30" align="center" style="color:red;">请先选择楼宇</td>
|
||||
</tr>
|
||||
<s:iterator id="aa" value="list">
|
||||
<tr>
|
||||
<td height="30" align="center">
|
||||
<a href="MyLogList.action?Building_ID=${TB_BuildingID}">${Building_Name}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,104 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>校园宿舍管理系统</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
|
||||
|
||||
function mycheck(){
|
||||
if(isNull(form1.Student_Username.value)){
|
||||
alert("请输入学号!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Password.value)){
|
||||
alert("请输入密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Password2.value)){
|
||||
alert("请输入重复密码!");
|
||||
return false;
|
||||
}
|
||||
if (document.form1.Student_Password.value != document.form1.Student_Password2.value) {
|
||||
alert("您两次输入的新密码不一致!请重新输入!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Name.value)){
|
||||
alert("请输入姓名!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Sex.value)){
|
||||
alert("请选择性别!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Student_Class.value)){
|
||||
alert("请输入班级!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNull(str){
|
||||
if ( str == "" ) return true;
|
||||
var regu = "^[ ]+$";
|
||||
var re = new RegExp(regu);
|
||||
return re.test(str);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">校园宿舍管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="Left.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">学生管理</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="100%" height="30" align="center" style="color:red;">请先选择楼宇</td>
|
||||
</tr>
|
||||
<s:iterator id="aa" value="list">
|
||||
<tr>
|
||||
<td height="30" align="center">
|
||||
<a href="MyStudentList.action?Building_ID=${TB_BuildingID}">${Building_Name}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,57 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/31
|
||||
Time: 12:16
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>公告管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="ManagerLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">公告管理</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,118 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: Vie
|
||||
Date: 2019/10/24
|
||||
Time: 16:03
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>修改密码</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
function mycheck(){
|
||||
if(isNull(form1.Password.value)){
|
||||
alert("请输入原密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Password2.value)){
|
||||
alert("请输入新密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Password3.value)){
|
||||
alert("请输入重复密码!");
|
||||
return false;
|
||||
}
|
||||
if (document.form1.Password2.value != document.form1.Password3.value) {
|
||||
alert("您两次输入的新密码不一致!请重新输入!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNull(str){
|
||||
if ( str == "" ) return true;
|
||||
var regu = "^[ ]+$";
|
||||
var re = new RegExp(regu);
|
||||
return re.test(str);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="StudentLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">修改密码</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE"><form name="form1" method="post" action="PasswordUpdateSave.action" onSubmit="return mycheck()" >
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="33%" height="30" align="right"> </td>
|
||||
<td width="67%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请输入原密码:</td>
|
||||
<td><input name="Password" type="password" class="text2" id="Password">
|
||||
<%if(request.getAttribute("Msg")!=null){%>
|
||||
<span style="color:red;"><%=request.getAttribute("Msg")%></span>
|
||||
<%}%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请输入新密码:</td>
|
||||
<td><input name="Password2" type="password" class="text2" id="Password2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请重复新密码:</td>
|
||||
<td><input name="Password3" type="password" class="text2" id="Password3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30"> </td>
|
||||
<td><input type="submit" name="button" id="button" value="修改密码"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,119 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/30
|
||||
Time: 9:50
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%--<%@ taglib prefix="s" uri="/struts-tags"%>--%>
|
||||
<%--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">--%>
|
||||
<html>
|
||||
<head>
|
||||
<title>修改密码</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script language="JavaScript">
|
||||
function mycheck(){
|
||||
if(isNull(form1.Password.value)){
|
||||
alert("请输入原密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Password2.value)){
|
||||
alert("请输入新密码!");
|
||||
return false;
|
||||
}
|
||||
if(isNull(form1.Password3.value)){
|
||||
alert("请输入重复密码!");
|
||||
return false;
|
||||
}
|
||||
if (document.form1.Password2.value != document.form1.Password3.value) {
|
||||
alert("您两次输入的新密码不一致!请重新输入!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNull(str){
|
||||
if ( str == "" ) return true;
|
||||
var regu = "^[ ]+$";
|
||||
var re = new RegExp(regu);
|
||||
return re.test(str);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="ManagerLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">修改密码</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE"><form name="form1" method="post" action="PasswordUpdateSave.action" onSubmit="return mycheck()" >
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="33%" height="30" align="right"> </td>
|
||||
<td width="67%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请输入原密码:</td>
|
||||
<td><input name="Password" type="password" class="text2" id="Password">
|
||||
<%if(request.getAttribute("Msg")!=null){%>
|
||||
<span style="color:red;"><%=request.getAttribute("Msg")%></span>
|
||||
<%}%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请输入新密码:</td>
|
||||
<td><input name="Password2" type="password" class="text2" id="Password2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="right"><span style="color:red;">*</span>请重复新密码:</td>
|
||||
<td><input name="Password3" type="password" class="text2" id="Password3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30"> </td>
|
||||
<td><input type="submit" name="button" id="button" value="修改密码"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,67 +0,0 @@
|
||||
<%@ page import="java.util.Date" %>
|
||||
<%@ page import="java.text.SimpleDateFormat" %><%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: 黄瑛
|
||||
Date: 2019/10/24
|
||||
Time: 16:03
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>网上报修</title>
|
||||
<style>
|
||||
body{
|
||||
background-image:url("Images/bg11.jpg"); /* 随便选的图,记得改啊卧槽!*/
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
*{margin: 0;padding: 0;}
|
||||
form{margin: 0 auto;padding:15px; width: 300px;height:300px;text-align:center;font-size:25px;}
|
||||
#submit{padding: 20px}
|
||||
#submit input{width: 60px;height: 40px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<div class="wrapper">
|
||||
<form action="<%=request.getContextPath()%>/loginDemo" method="post">
|
||||
<label>报修宿舍:</label>
|
||||
<input type="text" name="num" value="${param.num}" size="15" style="height:30px;weight:100px;"/><br><br>
|
||||
<label>损坏物品:</label>
|
||||
<input type="text" name="item" size="15" style="height:30px;weight:100px;"/><br><br>
|
||||
<label>可修时间:</label>
|
||||
<input type="text" name="time" size="15" style="height:30px;weight:100px;"/><br><br>
|
||||
<label>维修状态:</label>
|
||||
<input type="text" name="status" size="15" style="height:30px;weight:100px;"/><br><br>
|
||||
|
||||
<font color="red">
|
||||
<%
|
||||
if(request.getAttribute("message")!= null){
|
||||
out.print(request.getAttribute("message"));
|
||||
}
|
||||
%>
|
||||
</font>
|
||||
|
||||
<div id="submit">
|
||||
<input type="submit" value="确定" size="10"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,94 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/30
|
||||
Time: 9:37
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="java.sql.ResultSet"%>
|
||||
<%@page import="java.sql.PreparedStatement"%>
|
||||
<%@page import="java.sql.DriverManager"%>
|
||||
<%@page import="java.sql.Connection"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,
|
||||
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<title>学生报修信息管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
String driver = "com.mysql.cj.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8"
|
||||
+"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ;
|
||||
String usr = "root";
|
||||
String password = "123456";
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
Connection conn = DriverManager.getConnection(url, usr, password);
|
||||
String sqlString = "select * from repair";
|
||||
PreparedStatement pstmt = conn.prepareStatement(sqlString);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
%>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="ManagerLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="10" cellspacing="0" cellpadding="0">
|
||||
<caption><h3>宿舍报修信息</h3></caption>
|
||||
<tr>
|
||||
<td class="listTable">报修宿舍</td>
|
||||
<td class="listTable">报修时间</td>
|
||||
<td class="listTable">报修类型</td>
|
||||
<td class="listTable">报修电话</td>
|
||||
<td class="listTable">报修结果</td>
|
||||
<td id="operate">操作</td>
|
||||
</tr>
|
||||
<%
|
||||
while (rs.next()) {
|
||||
out.println("<tr>");
|
||||
out.println("<td>" + rs.getString("Repair_id") + "</td>");
|
||||
out.println("<td>" + rs.getString("Repair_time") + "</td>");
|
||||
out.println("<td>" + rs.getString("Repair_type") + "</td>");
|
||||
out.println("<td>" + rs.getInt("Repair_tel") + "</td>");
|
||||
out.println("<td>" + rs.getString("Repair_result") + "</td>");
|
||||
out.println("<td><a href='www.baidu.com'>已修</a></td>");
|
||||
out.println("</tr>");
|
||||
}
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</center>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,62 +0,0 @@
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %><%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/30
|
||||
Time: 20:48
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
|
||||
<!--这里是pages文件夹里的addStu.jsp-->
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,
|
||||
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<title>添加学生信息</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/bg11.jpg");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 align="center">请输入添加学生信息</h2>
|
||||
<div style="width:100%;text-align:center">
|
||||
<%-- <form action="../addServlet">--%>
|
||||
<table border=5 style="margin:auto">
|
||||
<tr>
|
||||
<td>学号:</td>
|
||||
<td><input type="text" name="stuid" id="stuid"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>登录密码:</td>
|
||||
<td><input type="text" name="stupass" id="stupass"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>姓名:</td>
|
||||
<td><input type="text" name="stuname" id="stuname"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>学生电话:</td>
|
||||
<td><input type="text" name="stutel" id="stutel"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="提交">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,78 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/10/24
|
||||
Time: 10:21
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %>
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
<html>
|
||||
<head>
|
||||
<title>学生首页</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" > </div>
|
||||
<table width="155" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="31" align="center" background="Images/left1.jpg"><strong>系统选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="50" align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentPage.jsp">后台首页</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentTH.jsp">学生寝室调换</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentQC.jsp">学生迁出登记</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairedAdd.jsp">上报维修信息</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="Electric.jsp"> 查看寝室电费</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="PasswordUpdate.jsp">修改密码</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="http://localhost:8080/StudentManageSystem_war_exploded/" onclick="return confirm('确定要退出系统吗?')">退出系统</a></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -1,68 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>校园宿舍管理系统</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">校园宿舍管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="Left.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">我的缺寝记录</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="470" align="center" valign="top" bgcolor="#F6F9FE"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr align="center" class="t1">
|
||||
<td bgcolor="#D5E4F4"><strong>缺寝人</strong></td>
|
||||
<td bgcolor="#D5E4F4"><strong>性别</strong></td>
|
||||
<td bgcolor="#D5E4F4"><strong>日期</strong></td>
|
||||
<td bgcolor="#D5E4F4"><strong>备注</strong></td>
|
||||
<td height="25" bgcolor="#D5E4F4"><strong>寝室长</strong></td>
|
||||
<td bgcolor="#D5E4F4"><strong>登记人</strong></td>
|
||||
</tr>
|
||||
<s:iterator id="aa" value="list">
|
||||
<tr align="center">
|
||||
<td>${Student_Name}</td>
|
||||
<td>${Student_Sex}</td>
|
||||
<td>${Log_Date}</td>
|
||||
<td>${Log_Remark}</td>
|
||||
<td height="25" align="center">${Domitory_Name}</td>
|
||||
<td>${Teacher_Name}</td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
@ -1,96 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/12/30
|
||||
Time: 8:57
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="java.sql.ResultSet"%>
|
||||
<%@page import="java.sql.PreparedStatement"%>
|
||||
<%@page import="java.sql.DriverManager"%>
|
||||
<%@page import="java.sql.Connection"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,
|
||||
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<title>学生信息管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
String driver = "com.mysql.cj.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/test?characterEncoding=utf-8"
|
||||
+"&serverTimezone=GMT"+ "&useUnicode=true"+"&useSSL=false" ;
|
||||
String usr = "root";
|
||||
String password = "123456";
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
Connection conn = DriverManager.getConnection(url, usr, password);
|
||||
String sqlString = "select * from admin";
|
||||
PreparedStatement pstmt = conn.prepareStatement(sqlString);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
%>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="ManagerLeft.jsp"%>
|
||||
</td>
|
||||
<td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="10" cellspacing="0" cellpadding="0" style="margin: auto">
|
||||
<caption><h3>学生基本信息</h3></caption>
|
||||
<tr>
|
||||
<td class="listTable">学号</td>
|
||||
<td class="listTable">登陆密码</td>
|
||||
<td class="listTable">姓名</td>
|
||||
<td class="listTable">电话</td>
|
||||
<td id="operate">操作</td>
|
||||
</tr>
|
||||
<%
|
||||
while (rs.next()) {
|
||||
out.println("<tr>");
|
||||
out.println("<td>" + rs.getInt("Admin_id") + "</td>");
|
||||
out.println("<td>" + rs.getString("Admin_password") + "</td>");
|
||||
out.println("<td>" + rs.getString("Admin_name") + "</td>");
|
||||
out.println("<td>" + rs.getString("Admin_tel") + "</td>");
|
||||
out.println("<td><a href='http://localhost:8080/StudentManageSystem_war_exploded/DeleteServlet?id=" + rs.getInt("Admin_id")+ "'>删除</a></td>");
|
||||
out.println("</tr>");
|
||||
}
|
||||
%>
|
||||
<div align="right" >
|
||||
<input type="button" style="color: darkslateblue" value="添加学生" onclick="javascript:window.location.href = 'StudentAdd.jsp'">
|
||||
</div>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</center>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,92 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: vie
|
||||
Date: 2019/10/24
|
||||
Time: 10:21
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
<html>
|
||||
<head>
|
||||
<title>学生首页</title>
|
||||
<style>
|
||||
body{
|
||||
background-image: url("Images/T(O8JNVG9RJ~H_O_TN8VLSD.jpg");
|
||||
}
|
||||
img{
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
top: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div align="right" style="color: lavender">欢迎你,<%=request.getParameter("Username")%></div>
|
||||
<img src="Images/12.png">
|
||||
<table width="155" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="31" align="center" background="Images/left1.jpg"><strong>系统选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="50" align="center" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentPage.jsp">后台首页</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentTH.jsp">学生寝室调换</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="StudentQC.jsp">学生迁出登记</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="RepairedAdd.jsp">上报维修信息</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="Electric.jsp"> 查看寝室电费</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="PasswordUpdate.jsp">修改密码</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="5" align="center"><img src="Images/ic.gif" width="1" height="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" align="center" background="Images/left2.jpg" style="text-align:left; padding-left:40px;"><a href="http://localhost:8080/StudentManageSystem_war_exploded/" onclick="return confirm('确定要退出系统吗?')">退出系统</a></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/lib.iml" filepath="$PROJECT_DIR$/.idea/lib.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="92fbfdc3-c7e6-47cf-96fb-6b796ef6c51e" name="Default Changelist" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1Ux80PEJ98gDO4u9GOLCZKAxKX0" />
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="last_opened_file_path" value="E:/huaweicloud/phoenix-sample" />
|
||||
<property name="settings.editor.selected.configurable" value="vcs.Git" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="92fbfdc3-c7e6-47cf-96fb-6b796ef6c51e" name="Default Changelist" comment="" />
|
||||
<created>1576286661953</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1576286661953</updated>
|
||||
<workItem from="1576286667729" duration="306000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
</project>
|
@ -1,99 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: MaCong
|
||||
Date: 2019/10/24
|
||||
Time: 10:04
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@ page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="java.util.Date" %>
|
||||
<!DOCTYPE html>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
|
||||
<body style="background:url(Images/bj_zhuce.jpg)">
|
||||
<div align="right" > </div>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>用户登录</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,
|
||||
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
function validate_form() {
|
||||
var name = document.getElementById("Username").value;
|
||||
var password = document.getElementById("password").value;
|
||||
if (name == null || name == "") {
|
||||
alert("您的用户名不能为空");
|
||||
return false;
|
||||
}
|
||||
if (password == null || password == "") {
|
||||
alert("您的密码不能为空");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<img src="Images/157776728736064.png">
|
||||
<form action="addStudent.jsp" onsubmit="return validate_form()" method="post">
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0" style="margin: auto">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#7817c0; font-size:25px; font-weight:bolder; padding-left:50px;">高校学生公寓管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" bgcolor="#E6F5FF" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="33%" height="30" align="right"> </td>
|
||||
<td width="67%"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="800" height="80" align="right" class="STYLE2">用户名:</td>
|
||||
<td width="300" align="left"><input style="color: red;font-size:30px;" size="20" type="text" name="Username" id="Username" class="text1" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="20" align="right" class="STYLE2">密码:</td>
|
||||
<td width="300" align="left"><input style="color: green;font-size:30px;" size="20" type="password" name="password" id="password" class="text1" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="100"> </td>
|
||||
<td><input type="submit" name="button" id="button" value="登录"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</form>
|
||||
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
|
||||
<%!Date time= new Date();%>
|
||||
<%
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
|
||||
%>
|
||||
<h3><% out.println(sdf1.format(time)); %></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,113 +0,0 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>校园宿舍管理系统</title>
|
||||
<base href="<%=basePath%>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="Style/Style.css" rel="stylesheet" type="text/css" />
|
||||
<script src="script/jquery-1.11.1.min.js">
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#right1{
|
||||
background-image: url("Images/bg002.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
#right2{
|
||||
background-image: url("Images/bg001.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
#right3{
|
||||
background-image: url("Images/bg003.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 600px 400px;
|
||||
}
|
||||
*{ padding: 0; margin: 0}
|
||||
.mark{
|
||||
width: 100%;
|
||||
height: 3128px;
|
||||
background: #000;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0.3;
|
||||
}
|
||||
.pic{
|
||||
position: center;
|
||||
margin-left: 292px;
|
||||
margin-top: -620px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body id="body">
|
||||
<center>
|
||||
<table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">校园宿舍管理系统</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" background="Images/MenuBg.jpg"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
|
||||
<%@ include file="Left.jsp"%>
|
||||
</td>
|
||||
<%if(session.getAttribute("type").toString().equals("1")){%>
|
||||
<td width="709" align="center" valign="middle" bgcolor="#F6F9FE" id="right1"><h1 style="color: blue;font-size: 2.4em;">欢迎系统管理员登陆</h1></td>
|
||||
<%}%>
|
||||
<%if(session.getAttribute("type").toString().equals("2")){%>
|
||||
<td width="709" align="center" valign="middle" bgcolor="#F6F9FE" id="right2"><h1 style="color: red;font-size: 2.4em;">欢迎宿舍管理员登陆</h1></td>
|
||||
<%}%>
|
||||
<%if(session.getAttribute("type").toString().equals("3")){%>
|
||||
<td width="709" align="center" valign="middle" bgcolor="#F6F9FE" id="right3"><h1 style="color: yellow;font-size: 2.4em;">欢迎高校学生登陆</h1></td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="35" background="Images/bootBg.jpg"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
function auto(){
|
||||
//2、3秒后要干的事情
|
||||
var body=document.getElementsByTagName('body');
|
||||
//创建一个灰色的蒙层
|
||||
var newDiv=document.createElement("div"); //<div></div>
|
||||
newDiv.className="mark"//div的class名称为mark <div class="mark"></div>
|
||||
//将创建好的蒙层追加至body
|
||||
body[0].appendChild(newDiv);
|
||||
//创建img元素
|
||||
var newImg=document.createElement('img');//<img>
|
||||
newImg.src="Images/notice.jpg";
|
||||
//<img src="images/pic.png">
|
||||
newImg.className='pic';
|
||||
body[0].appendChild(newImg);
|
||||
|
||||
//点击图片上的"x"时,关闭黑色蒙层和图片
|
||||
newImg.onclick=function()
|
||||
{
|
||||
body[0].removeChild(newDiv);
|
||||
body[0].removeChild(newImg);
|
||||
}
|
||||
}
|
||||
setTimeout(auto,3000);
|
||||
</script>
|
@ -1,100 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.dao.AdminDao;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
public class GoLogin extends ActionSupport {
|
||||
|
||||
//??????Action????????????????????????
|
||||
private String Type;
|
||||
private String Username;
|
||||
private String Password;
|
||||
private String Msg;
|
||||
private String check;
|
||||
|
||||
public String getCheck() {
|
||||
return check;
|
||||
}
|
||||
|
||||
public void setCheck(String check) {
|
||||
this.check = check;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return Type;
|
||||
}
|
||||
public void setType(String type) {
|
||||
Type = type;
|
||||
}
|
||||
public String getUsername() {
|
||||
return Username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
Username = username;
|
||||
}
|
||||
public String getPassword() {
|
||||
return Password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
Password = password;
|
||||
}
|
||||
public String getMsg() {
|
||||
return Msg;
|
||||
}
|
||||
public void setMsg(String msg) {
|
||||
Msg = msg;
|
||||
}
|
||||
/**
|
||||
* 以上就是获取输入登入信息的 * */
|
||||
public String execute() throws Exception {
|
||||
|
||||
|
||||
|
||||
|
||||
if(Type.equals("系统管理员"))
|
||||
{
|
||||
if (null == new AdminDao().CheckLogin(Username, Password)) {
|
||||
Msg = "系统检查为空啊哈哈";
|
||||
return INPUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
//???ID
|
||||
String Admin_ID=new AdminDao().CheckLogin(Username, Password);
|
||||
//????session
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
session.setAttribute("id", Admin_ID);
|
||||
session.setAttribute("type", "1");
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
else if(Type.equals("学生"))
|
||||
{
|
||||
if (null == new StudentDao().CheckLogin(Username, Password)) {
|
||||
Msg = "学生用户名或密码输入错误";
|
||||
return INPUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
//???ID
|
||||
String Student_ID=new StudentDao().CheckLogin(Username, Password);
|
||||
//????session
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
session.setAttribute("id", Student_ID);
|
||||
session.setAttribute("type", "3");
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg = "用户名或密码输入错误";
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class LogAdd extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
|
||||
private String Student_ID;
|
||||
public String getStudent_ID() {
|
||||
return Student_ID;
|
||||
}
|
||||
public void setStudent_ID(String studentID) {
|
||||
Student_ID = studentID;
|
||||
}
|
||||
private StudentBean cnbean;
|
||||
public StudentBean getCnbean() {
|
||||
return cnbean;
|
||||
}
|
||||
public void setCnbean(StudentBean cnbean) {
|
||||
this.cnbean = cnbean;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询
|
||||
cnbean=new StudentDao().GetBean(Integer.parseInt(Student_ID));
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.LogBean;
|
||||
import com.dao.LogDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class LogAddSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Log_Date ;
|
||||
private String Log_Remark ;
|
||||
|
||||
public String getLog_Date() {
|
||||
return Log_Date;
|
||||
}
|
||||
|
||||
public void setLog_Date(String logDate) {
|
||||
Log_Date = logDate;
|
||||
}
|
||||
|
||||
public String getLog_Remark() {
|
||||
return Log_Remark;
|
||||
}
|
||||
|
||||
public void setLog_Remark(String logRemark) {
|
||||
Log_Remark = logRemark;
|
||||
}
|
||||
|
||||
private String Log_StudentID;
|
||||
public String getLog_StudentID() {
|
||||
return Log_StudentID;
|
||||
}
|
||||
|
||||
public void setLog_StudentID(String logStudentID) {
|
||||
Log_StudentID = logStudentID;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//添加
|
||||
LogBean cnbean=new LogBean();
|
||||
cnbean.setLog_StudentID(Integer.parseInt(Log_StudentID));
|
||||
cnbean.setLog_TeacherID(Integer.parseInt(session.getAttribute("id").toString()));
|
||||
cnbean.setLog_Date(Log_Date);
|
||||
cnbean.setLog_Remark(Log_Remark);
|
||||
|
||||
new LogDao().Add(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('缺寝登记成功!');window.location='Index.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TBBean;
|
||||
import com.dao.TBDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyLog extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<TBBean> list;
|
||||
public List<TBBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<TBBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
|
||||
//查询所有
|
||||
list=new TBDao().GetList("TB_TeacherID="+session.getAttribute("id"),"Building_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.DomitoryBean;
|
||||
import com.bean.LogBean;
|
||||
import com.dao.DomitoryDao;
|
||||
import com.dao.LogDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyLogList extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<LogBean> list;
|
||||
public List<LogBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<LogBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
private String Building_ID;
|
||||
public String getBuilding_ID() {
|
||||
return Building_ID;
|
||||
}
|
||||
public void setBuilding_ID(String buildingID) {
|
||||
Building_ID = buildingID;
|
||||
}
|
||||
private List<DomitoryBean> domitorylist;
|
||||
public List<DomitoryBean> getDomitorylist() {
|
||||
return domitorylist;
|
||||
}
|
||||
public void setDomitorylist(List<DomitoryBean> domitorylist) {
|
||||
this.domitorylist = domitorylist;
|
||||
}
|
||||
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
private String Domitory_ID;
|
||||
|
||||
public String getDomitory_ID() {
|
||||
return Domitory_ID;
|
||||
}
|
||||
public void setDomitory_ID(String domitoryID) {
|
||||
Domitory_ID = domitoryID;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询条件
|
||||
String strWhere="Student_State='入住' and Building_ID="+Building_ID;
|
||||
if(!(isInvalid(SearchKey)))
|
||||
{
|
||||
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
}
|
||||
if(!(isInvalid(Domitory_ID)))
|
||||
{
|
||||
strWhere+=" and Domitory_ID='"+Domitory_ID+"'";
|
||||
}
|
||||
//查询所有
|
||||
list=new LogDao().GetList(strWhere,"Log_Date desc");
|
||||
|
||||
//查询所有寝室
|
||||
domitorylist=new DomitoryDao().GetList("Domitory_BuildingID="+Building_ID,"Domitory_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TBBean;
|
||||
import com.dao.TBDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyStudent extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<TBBean> list;
|
||||
public List<TBBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<TBBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
|
||||
//查询所有
|
||||
list=new TBDao().GetList("TB_TeacherID="+session.getAttribute("id"),"Building_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.DomitoryBean;
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.DomitoryDao;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MyStudentList extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<StudentBean> list;
|
||||
public List<StudentBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<StudentBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
private String Building_ID;
|
||||
public String getBuilding_ID() {
|
||||
return Building_ID;
|
||||
}
|
||||
public void setBuilding_ID(String buildingID) {
|
||||
Building_ID = buildingID;
|
||||
}
|
||||
private List<DomitoryBean> domitorylist;
|
||||
public List<DomitoryBean> getDomitorylist() {
|
||||
return domitorylist;
|
||||
}
|
||||
public void setDomitorylist(List<DomitoryBean> domitorylist) {
|
||||
this.domitorylist = domitorylist;
|
||||
}
|
||||
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
private String Domitory_ID;
|
||||
|
||||
public String getDomitory_ID() {
|
||||
return Domitory_ID;
|
||||
}
|
||||
public void setDomitory_ID(String domitoryID) {
|
||||
Domitory_ID = domitoryID;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询条件
|
||||
String strWhere="Student_State='入住' and Building_ID="+Building_ID;
|
||||
if(!(isInvalid(SearchKey)))
|
||||
{
|
||||
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
}
|
||||
if(!(isInvalid(Domitory_ID)))
|
||||
{
|
||||
strWhere+=" and Domitory_ID='"+Domitory_ID+"'";
|
||||
}
|
||||
//查询所有
|
||||
list=new StudentDao().GetList(strWhere,"Domitory_Name");
|
||||
|
||||
//查询所有寝室
|
||||
domitorylist=new DomitoryDao().GetList("Domitory_BuildingID="+Building_ID,"Domitory_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.NoticeBean;
|
||||
import com.dao.NoticeDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
public class Notice extends ActionSupport {
|
||||
private String Msg1;
|
||||
private String Msg2;
|
||||
|
||||
public String getMsg2() {
|
||||
return Msg2;
|
||||
}
|
||||
|
||||
public void setMsg2(String msg2) {
|
||||
Msg2 = msg2;
|
||||
}
|
||||
|
||||
public String getMsg1() {
|
||||
return Msg1;
|
||||
}
|
||||
public void setMsg1(String msg1) {
|
||||
Msg1 = msg1;
|
||||
}
|
||||
private List<NoticeBean> list;
|
||||
public List<NoticeBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<NoticeBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
private List<NoticeBean> repairlist;
|
||||
public List<NoticeBean> getRepairlist() {
|
||||
return list;
|
||||
}
|
||||
public void setRepairlist(List<NoticeBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response= ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
//查询
|
||||
list= new NoticeDao().GetBean();
|
||||
Msg1= String.valueOf(list.get(0));
|
||||
Msg2= String.valueOf(list.get(1));
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.OutBean;
|
||||
import com.dao.OutDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class OutList extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<OutBean> list;
|
||||
public List<OutBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<OutBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//查询所有
|
||||
list=new OutDao().GetList("","o.Out_Date desc");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.AdminBean;
|
||||
import com.bean.StudentBean;
|
||||
import com.bean.TeacherBean;
|
||||
import com.dao.AdminDao;
|
||||
import com.dao.StudentDao;
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class PasswordUpdateSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Password;
|
||||
private String Password2;
|
||||
private String Msg;
|
||||
public String getPassword() {
|
||||
return Password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
Password = password;
|
||||
}
|
||||
|
||||
public String getPassword2() {
|
||||
return Password2;
|
||||
}
|
||||
|
||||
public void setPassword2(String password2) {
|
||||
Password2 = password2;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return Msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
Msg = msg;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
String type=session.getAttribute("type").toString();
|
||||
if(type.equals("1"))//校园管理员身份
|
||||
{
|
||||
//查询原密码是否正确
|
||||
if (new AdminDao().CheckPassword(session.getAttribute("id").toString(), Password)) {
|
||||
//修改密码
|
||||
AdminBean cnbean=new AdminBean();
|
||||
cnbean=new AdminDao().GetBean(Integer.parseInt(session.getAttribute("id").toString()));
|
||||
cnbean.setAdmin_Password(Password2);
|
||||
new AdminDao().Update(cnbean);
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='PasswordUpdate.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg = "用户名或者密码错误";
|
||||
return INPUT;
|
||||
}
|
||||
}
|
||||
else if(type.equals("2"))//楼宇管理员身份
|
||||
{
|
||||
//查询原密码是否正确
|
||||
if (new TeacherDao().CheckPassword(session.getAttribute("id").toString(), Password)) {
|
||||
//修改密码
|
||||
TeacherBean cnbean=new TeacherBean();
|
||||
cnbean=new TeacherDao().GetBean(Integer.parseInt(session.getAttribute("id").toString()));
|
||||
cnbean.setTeacher_Password(Password2);
|
||||
new TeacherDao().Update(cnbean);
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='PasswordUpdate.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg = "用户名或者密码错误";
|
||||
return INPUT;
|
||||
}
|
||||
}
|
||||
else if(type.equals("3"))//学生身份
|
||||
{
|
||||
//查询原密码是否正确
|
||||
if (new StudentDao().CheckPassword(session.getAttribute("id").toString(), Password)) {
|
||||
//修改密码
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean=new StudentDao().GetBean(Integer.parseInt(session.getAttribute("id").toString()));
|
||||
cnbean.setStudent_Password(Password2);
|
||||
new StudentDao().Update(cnbean);
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='PasswordUpdate.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg = "用户名或者密码错误";
|
||||
return INPUT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
|
||||
public class Quit extends ActionSupport {
|
||||
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//清除session
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
session.removeAttribute("id");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.dao.RepairDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
public class RepairAdd extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private int repair_id ;
|
||||
private String repair_address ;
|
||||
private String repair_info ;
|
||||
private String repair_cost;
|
||||
private String repair_time;
|
||||
private String repair_status ;
|
||||
private String repair_tel ;
|
||||
|
||||
public int getRepair_id() {
|
||||
return repair_id;
|
||||
}
|
||||
|
||||
public void setRepair_id(int repair_id) {
|
||||
this.repair_id = repair_id;
|
||||
}
|
||||
public String getRepair_address() {
|
||||
return repair_address;
|
||||
}
|
||||
|
||||
public void setRepair_address(String repair_address) {
|
||||
this.repair_address = repair_address;
|
||||
}
|
||||
|
||||
public String getRepair_info() {
|
||||
return repair_info;
|
||||
}
|
||||
|
||||
public void setRepair_info(String repair_info) {
|
||||
this.repair_info = repair_info;
|
||||
}
|
||||
|
||||
public String getRepair_cost() {
|
||||
return repair_cost;
|
||||
}
|
||||
|
||||
public void setRepair_cost(String repair_cost) {
|
||||
this.repair_cost = repair_cost;
|
||||
}
|
||||
|
||||
public String getRepair_time() {
|
||||
return repair_time;
|
||||
}
|
||||
|
||||
public void setRepair_time(String repair_time) {
|
||||
this.repair_time = repair_time;
|
||||
}
|
||||
|
||||
public String getRepair_status() {
|
||||
return repair_status;
|
||||
}
|
||||
|
||||
public void setRepair_status(String repair_status) {
|
||||
this.repair_status = repair_status;
|
||||
}
|
||||
|
||||
public String getRepair_tel() {
|
||||
return repair_tel;
|
||||
}
|
||||
|
||||
public void setRepair_tel(String repair_tel) {
|
||||
this.repair_tel = repair_tel;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
// List<StudentBean> list=new StudentDao().GetList("Student_Username='"+Student_Username+"'", "");
|
||||
// if(list.size()>0)
|
||||
// {
|
||||
// out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
// out.flush();out.close();return null;
|
||||
// }
|
||||
//添加
|
||||
|
||||
Repair_addBean cnbean=new Repair_addBean();
|
||||
//new日期对
|
||||
long l = System.currentTimeMillis();
|
||||
Date date = new Date(l);
|
||||
//转换提日期输出格式
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
repair_time=dateFormat.format(date);
|
||||
repair_cost="25";
|
||||
repair_status="待维修";
|
||||
// Repair_addBean cnbean=new Repair_addBean();
|
||||
cnbean.setRepair_id(repair_id);
|
||||
cnbean.setRepair_address(repair_address);
|
||||
cnbean.setRepair_info(repair_info);
|
||||
cnbean.setRepair_tel(repair_tel);
|
||||
// cnbean.setRepair_time(repair_time);
|
||||
//cnbean.setRepair_cost(repair_cost);
|
||||
cnbean.setRepair_status(repair_status);
|
||||
new RepairDao().Add(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('添加成功!');window.location='Index.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.dao.RepairDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
public class RepairList extends ActionSupport {
|
||||
|
||||
private int repair_id;
|
||||
|
||||
|
||||
public int getRepair_id() {
|
||||
return repair_id;
|
||||
}
|
||||
|
||||
public void setRepair_id(int studentid) {
|
||||
repair_id = repair_id;
|
||||
}
|
||||
|
||||
private List<Repair_addBean> list;
|
||||
public List<Repair_addBean> getList() { return list;
|
||||
}
|
||||
public void setList(List<Repair_addBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response= ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
//查询
|
||||
// list=new RepairDao(List<Repair_addBean>)().GetBean(repair_id);
|
||||
|
||||
list=new RepairDao().GetList("strwhere","repair_id");
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.dao.RepairDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RepairManager extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<Repair_addBean> list;
|
||||
public List<Repair_addBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<Repair_addBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
// private List<Repair_addBean> buildinglist;
|
||||
// public List<Repair_addBean> getBuildinglist() {
|
||||
// return buildinglist;
|
||||
//}
|
||||
// public void setBuildinglist(List<Repair_addBean> buildinglist) {
|
||||
// this.buildinglist = buildinglist;
|
||||
// }
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//查询条件
|
||||
String strWhere="1=1";
|
||||
if(!(isInvalid(SearchKey)))
|
||||
{
|
||||
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
}
|
||||
// if(!(isInvalid(Integer.toString(repair_id))))
|
||||
// {
|
||||
// strWhere+=" and repair_id='"+repair_id+"'";
|
||||
// }
|
||||
|
||||
//查询所有楼宇
|
||||
//list=new RepairDao().GetList("","repair_id");
|
||||
|
||||
//查询所有
|
||||
list=new RepairDao().GetList(strWhere,"repair_tel");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.dao.RepairDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class RepairUpdate extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private int repair_id;
|
||||
private Repair_addBean cnbean;
|
||||
public int getRepair_id() {
|
||||
System.out.println(repair_id);
|
||||
return repair_id;
|
||||
}
|
||||
|
||||
public void setRepair_id(int studentid) {
|
||||
repair_id = studentid;
|
||||
}
|
||||
|
||||
public Repair_addBean getCnbean() { return cnbean;
|
||||
}
|
||||
|
||||
public void setCnbean(Repair_addBean cnbean) {
|
||||
this.cnbean = cnbean;
|
||||
}
|
||||
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询所有楼宇
|
||||
//list=new RepairDao().GetList("","repair_id");
|
||||
//查询
|
||||
cnbean=new RepairDao().GetBean(repair_id);
|
||||
System.out.println(repair_id);
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,142 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.dao.RepairDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class RepairUpdateSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private int repair_id;
|
||||
private String repair_address;
|
||||
private String repair_info;
|
||||
private String repair_cost;
|
||||
private String repair_tel;
|
||||
private String repair_status;
|
||||
private String repair_time;
|
||||
public int getRepair_id() {
|
||||
|
||||
return repair_id;
|
||||
}
|
||||
|
||||
public void setRepair_id(int cookID) {
|
||||
this.repair_id = cookID;
|
||||
}
|
||||
|
||||
|
||||
public String getRepair_time() {
|
||||
return repair_time;
|
||||
}
|
||||
|
||||
public void setRepair_time(String repair_time) {
|
||||
this.repair_time = repair_time;
|
||||
}
|
||||
|
||||
public String getRepair_address() {
|
||||
return repair_address;
|
||||
}
|
||||
|
||||
public void setRepair_address(String repair_address) {
|
||||
this.repair_address = repair_address;
|
||||
}
|
||||
|
||||
public String getRepair_info() {
|
||||
return repair_info;
|
||||
}
|
||||
|
||||
public void setRepair_info(String repair_info) {
|
||||
this.repair_info = repair_info;
|
||||
}
|
||||
|
||||
public String getRepair_cost() {
|
||||
return repair_cost;
|
||||
}
|
||||
|
||||
public void setRepair_cost(String repair_cost) {
|
||||
this.repair_cost = repair_cost;
|
||||
}
|
||||
|
||||
public String getRepair_tel() {
|
||||
return repair_tel;
|
||||
}
|
||||
|
||||
public void setRepair_tel(String repair_tel) {
|
||||
this.repair_tel = repair_tel;
|
||||
}
|
||||
|
||||
public String getRepair_status() {
|
||||
return repair_status;
|
||||
}
|
||||
|
||||
public void setRepair_status(String cookStatus) {
|
||||
this.repair_status = cookStatus;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
System.out.println(repair_id);
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
//List<Repair_addBean> list=new RepairDao().GetList("Teacher_Username='"+Teacher_Username+"' and Teacher_ID!="+Teacher_ID, "");
|
||||
// if(list.size()>0)
|
||||
// {
|
||||
// out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
// out.flush();out.close();return null;
|
||||
// }
|
||||
//修改
|
||||
|
||||
Repair_addBean cnbean=new Repair_addBean();
|
||||
|
||||
cnbean=new RepairDao().GetBean(repair_id);
|
||||
|
||||
cnbean.setRepair_id(repair_id);
|
||||
|
||||
//cnbean.setRepair_address(repair_address);
|
||||
//cnbean.setRepair_info(repair_info);
|
||||
// cnbean.setRepair_cost(rs.getString("repair_cost"));
|
||||
//cnbean.setRepair_tel(repair_tel);
|
||||
// cnbean=new RepairDao().GetBean(repair_id);
|
||||
cnbean.setRepair_status(repair_status);
|
||||
// if(!(isInvalid(repair_status)))
|
||||
//{
|
||||
// cnbean.setRepair_status(repair_status);
|
||||
// }
|
||||
new RepairDao().Update(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='RepairManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class StudentAddSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Student_Username ;
|
||||
private String Student_Password ;
|
||||
private String Student_Name ;
|
||||
private String Student_Sex ;
|
||||
private String Student_Class ;
|
||||
public String getStudent_Username() {
|
||||
return Student_Username;
|
||||
}
|
||||
|
||||
public void setStudent_Username(String studentUsername) {
|
||||
Student_Username = studentUsername;
|
||||
}
|
||||
|
||||
public String getStudent_Password() {
|
||||
return Student_Password;
|
||||
}
|
||||
|
||||
public void setStudent_Password(String studentPassword) {
|
||||
Student_Password = studentPassword;
|
||||
}
|
||||
|
||||
public String getStudent_Name() {
|
||||
return Student_Name;
|
||||
}
|
||||
|
||||
public void setStudent_Name(String studentName) {
|
||||
Student_Name = studentName;
|
||||
}
|
||||
|
||||
public String getStudent_Sex() {
|
||||
return Student_Sex;
|
||||
}
|
||||
|
||||
public void setStudent_Sex(String studentSex) {
|
||||
Student_Sex = studentSex;
|
||||
}
|
||||
|
||||
public String getStudent_Class() {
|
||||
return Student_Class;
|
||||
}
|
||||
|
||||
public void setStudent_Class(String studentClass) {
|
||||
Student_Class = studentClass;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
List<StudentBean> list=new StudentDao().GetList("Student_Username='"+Student_Username+"'", "");
|
||||
if(list.size()>0)
|
||||
{
|
||||
out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//添加
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean.setStudent_Username(Student_Username);
|
||||
cnbean.setStudent_Password(Student_Password);
|
||||
cnbean.setStudent_Name(Student_Name);
|
||||
cnbean.setStudent_Sex(Student_Sex);
|
||||
cnbean.setStudent_Class(Student_Class);
|
||||
cnbean.setStudent_State("未入住");
|
||||
cnbean.setStudent_DomitoryID(1);
|
||||
new StudentDao().Add(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('添加成功!');window.location='StudentManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class StudentDel extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private int Student_ID ;
|
||||
public int getStudent_ID() {
|
||||
return Student_ID;
|
||||
}
|
||||
|
||||
public void setStudent_ID(int userID) {
|
||||
Student_ID = userID;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
|
||||
//删除
|
||||
new StudentDao().Delete(Student_ID);
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class StudentManager extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<StudentBean> list;
|
||||
private int a;
|
||||
|
||||
public int getA() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public void setA(int a) {
|
||||
this.a = a;
|
||||
}
|
||||
|
||||
public List<StudentBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<StudentBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
private String State;
|
||||
public String getState() {
|
||||
return State;
|
||||
}
|
||||
public void setState(String state) {
|
||||
State = state;
|
||||
}
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//查询条件
|
||||
String strWhere="1=1";
|
||||
if(!(isInvalid(SearchKey)))
|
||||
{
|
||||
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
}
|
||||
if(!(isInvalid(State)))
|
||||
{
|
||||
strWhere+=" and Student_State='"+State+"'";
|
||||
}
|
||||
else
|
||||
{strWhere+="and Student_State='入住'";}
|
||||
//查询所有楼宇
|
||||
//List<StudentBean> list;
|
||||
if(session.getAttribute("number111")==null){
|
||||
|
||||
a=1;
|
||||
list=new StudentDao().GetAllList1(a);}
|
||||
else
|
||||
|
||||
//查询所有
|
||||
list=new StudentDao().GetList("","Student_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class StudentUpdate extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Student_ID;
|
||||
private StudentBean cnbean;
|
||||
public String getStudent_ID() {
|
||||
return Student_ID;
|
||||
}
|
||||
|
||||
public void setStudent_ID(String studentID) {
|
||||
Student_ID = studentID;
|
||||
}
|
||||
|
||||
public StudentBean getCnbean() {
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
public void setCnbean(StudentBean cnbean) {
|
||||
this.cnbean = cnbean;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询
|
||||
cnbean=new StudentDao().GetBean(Integer.parseInt(Student_ID));
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.dao.StudentDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class StudentUpdateSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Student_ID ;
|
||||
private String Student_Username ;
|
||||
private String Student_Password ;
|
||||
private String Student_Name ;
|
||||
private String Student_Sex ;
|
||||
private String Student_Class ;
|
||||
public String getStudent_ID() {
|
||||
return Student_ID;
|
||||
}
|
||||
|
||||
public void setStudent_ID(String studentID) {
|
||||
Student_ID = studentID;
|
||||
}
|
||||
|
||||
public String getStudent_Username() {
|
||||
return Student_Username;
|
||||
}
|
||||
|
||||
public void setStudent_Username(String studentUsername) {
|
||||
Student_Username = studentUsername;
|
||||
}
|
||||
|
||||
public String getStudent_Password() {
|
||||
return Student_Password;
|
||||
}
|
||||
|
||||
public void setStudent_Password(String studentPassword) {
|
||||
Student_Password = studentPassword;
|
||||
}
|
||||
|
||||
public String getStudent_Name() {
|
||||
return Student_Name;
|
||||
}
|
||||
|
||||
public void setStudent_Name(String studentName) {
|
||||
Student_Name = studentName;
|
||||
}
|
||||
|
||||
public String getStudent_Sex() {
|
||||
return Student_Sex;
|
||||
}
|
||||
|
||||
public void setStudent_Sex(String studentSex) {
|
||||
Student_Sex = studentSex;
|
||||
}
|
||||
|
||||
public String getStudent_Class() {
|
||||
return Student_Class;
|
||||
}
|
||||
|
||||
public void setStudent_Class(String studentClass) {
|
||||
Student_Class = studentClass;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
List<StudentBean> list=new StudentDao().GetList("Student_Username='"+Student_Username+"' and Student_ID!="+Student_ID, "");
|
||||
if(list.size()>0)
|
||||
{
|
||||
out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//修改
|
||||
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean=new StudentDao().GetAllBean(Integer.parseInt(Student_ID));
|
||||
cnbean.setStudent_Username(Student_Username);
|
||||
cnbean.setStudent_Name(Student_Name);
|
||||
cnbean.setStudent_Sex(Student_Sex);
|
||||
cnbean.setStudent_Class(Student_Class);
|
||||
if(!(isInvalid(Student_Password)))
|
||||
{
|
||||
cnbean.setStudent_Password(Student_Password);
|
||||
}
|
||||
new StudentDao().Update(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='StudentManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TeacherBean;
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class TeacherAddSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Teacher_Username ;
|
||||
private String Teacher_Password ;
|
||||
private String Teacher_Name ;
|
||||
private String Teacher_Sex ;
|
||||
private String Teacher_Tel ;
|
||||
|
||||
public String getTeacher_Username() {
|
||||
return Teacher_Username;
|
||||
}
|
||||
|
||||
public void setTeacher_Username(String cookUsername) {
|
||||
Teacher_Username = cookUsername;
|
||||
}
|
||||
|
||||
public String getTeacher_Password() {
|
||||
return Teacher_Password;
|
||||
}
|
||||
|
||||
public void setTeacher_Password(String cookPassword) {
|
||||
Teacher_Password = cookPassword;
|
||||
}
|
||||
|
||||
public String getTeacher_Name() {
|
||||
return Teacher_Name;
|
||||
}
|
||||
|
||||
public void setTeacher_Name(String cookName) {
|
||||
Teacher_Name = cookName;
|
||||
}
|
||||
|
||||
public String getTeacher_Sex() {
|
||||
return Teacher_Sex;
|
||||
}
|
||||
|
||||
public void setTeacher_Sex(String cookSex) {
|
||||
Teacher_Sex = cookSex;
|
||||
}
|
||||
|
||||
public String getTeacher_Tel() {
|
||||
return Teacher_Tel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
List<TeacherBean> list=new TeacherDao().GetList("Teacher_Username='"+Teacher_Username+"'", "");
|
||||
if(list.size()>0)
|
||||
{
|
||||
out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//添加
|
||||
TeacherBean cnbean=new TeacherBean();
|
||||
cnbean.setTeacher_Username(Teacher_Username);
|
||||
cnbean.setTeacher_Password(Teacher_Password);
|
||||
cnbean.setTeacher_Name(Teacher_Name);
|
||||
cnbean.setTeacher_Sex(Teacher_Sex);
|
||||
cnbean.setTeacher_Tel(Teacher_Tel);
|
||||
|
||||
new TeacherDao().Add(cnbean);
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('添加成功!');window.location='TeacherManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class TeacherDel extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
|
||||
private int Teacher_ID;
|
||||
|
||||
|
||||
public int getTeacher_ID() { return Teacher_ID; }
|
||||
|
||||
public void setTeacher_ID(int userID) {
|
||||
Teacher_ID= userID;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
|
||||
//删除
|
||||
new TeacherDao().Delete(Teacher_ID);
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TeacherBean;
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class TeacherManager extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<TeacherBean> list;
|
||||
public List<TeacherBean> getList() {
|
||||
return list;
|
||||
}
|
||||
public void setList(List<TeacherBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//查询条件
|
||||
String strWhere="1=1";
|
||||
if(!(isInvalid(SearchKey)))
|
||||
{
|
||||
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
}
|
||||
//查询所有
|
||||
list=new TeacherDao().GetList(strWhere,"Teacher_Name");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TeacherBean;
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
public class TeacherUpdate extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Teacher_ID;
|
||||
private TeacherBean cnbean;
|
||||
public String getTeacher_ID() {
|
||||
return Teacher_ID;
|
||||
}
|
||||
|
||||
public void setTeacher_ID(String studentID) {
|
||||
Teacher_ID = studentID;
|
||||
}
|
||||
|
||||
public TeacherBean getCnbean() {
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
public void setCnbean(TeacherBean cnbean) {
|
||||
this.cnbean = cnbean;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询
|
||||
cnbean=new TeacherDao().GetBean(Integer.parseInt(Teacher_ID));
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.TeacherBean;
|
||||
import com.dao.TeacherDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class TeacherUpdateSave extends ActionSupport {
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private String Teacher_ID ;
|
||||
private String Teacher_Username ;
|
||||
private String Teacher_Password ;
|
||||
private String Teacher_Name ;
|
||||
private String Teacher_Sex ;
|
||||
private String Teacher_Tel ;
|
||||
public String getTeacher_ID() {
|
||||
return Teacher_ID;
|
||||
}
|
||||
|
||||
public void setTeacher_ID(String cookID) {
|
||||
Teacher_ID = cookID;
|
||||
}
|
||||
|
||||
public String getTeacher_Username() {
|
||||
return Teacher_Username;
|
||||
}
|
||||
|
||||
public void setTeacher_Username(String cookUsername) {
|
||||
Teacher_Username = cookUsername;
|
||||
}
|
||||
|
||||
public String getTeacher_Password() {
|
||||
return Teacher_Password;
|
||||
}
|
||||
|
||||
public void setTeacher_Password(String cookPassword) {
|
||||
Teacher_Password = cookPassword;
|
||||
}
|
||||
|
||||
public String getTeacher_Name() {
|
||||
return Teacher_Name;
|
||||
}
|
||||
|
||||
public void setTeacher_Name(String cookName) {
|
||||
Teacher_Name = cookName;
|
||||
}
|
||||
|
||||
public String getTeacher_Sex() {
|
||||
return Teacher_Sex;
|
||||
}
|
||||
|
||||
public void setTeacher_Sex(String cookSex) {
|
||||
Teacher_Sex = cookSex;
|
||||
}
|
||||
|
||||
public String getTeacher_Tel() {
|
||||
return Teacher_Tel;
|
||||
}
|
||||
|
||||
public void setTeacher_Tel(String cookTel) {
|
||||
Teacher_Tel = cookTel;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response=ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询用户名是否存在
|
||||
List<TeacherBean> list=new TeacherDao().GetList("Teacher_Username='"+Teacher_Username+"' and Teacher_ID!="+Teacher_ID, "");
|
||||
if(list.size()>0)
|
||||
{
|
||||
out.print("<script language='javascript'>alert('用户名已经存在!');history.back(-1);</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//修改
|
||||
|
||||
TeacherBean cnbean=new TeacherBean();
|
||||
cnbean=new TeacherDao().GetBean(Integer.parseInt(Teacher_ID));
|
||||
cnbean.setTeacher_Username(Teacher_Username);
|
||||
cnbean.setTeacher_Name(Teacher_Name);
|
||||
cnbean.setTeacher_Sex(Teacher_Sex);
|
||||
cnbean.setTeacher_Tel(Teacher_Tel);
|
||||
if(!(isInvalid(Teacher_Password)))
|
||||
{
|
||||
cnbean.setTeacher_Password(Teacher_Password);
|
||||
}
|
||||
new TeacherDao().Update(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='RepairManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.electric_addBean;
|
||||
import com.dao.electriDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class electricAdd extends ActionSupport {
|
||||
private int Electric_ID;
|
||||
private String Electric_Dormitory_Number;
|
||||
private String Electric_Residual;
|
||||
private String Edate;
|
||||
public int getElectric_ID() {
|
||||
return Electric_ID;
|
||||
}
|
||||
|
||||
public void setElectric_ID(int Electric_ID) {
|
||||
this.Electric_ID = Electric_ID;
|
||||
}
|
||||
|
||||
public String getElectric_Dormitory_Number() {
|
||||
return Electric_Dormitory_Number;
|
||||
}
|
||||
|
||||
public void setElectric_Dormitory_Number(String Dormitory_Number) {
|
||||
this.Electric_Dormitory_Number = Electric_Dormitory_Number;
|
||||
}
|
||||
|
||||
public String getElectric_Residual() {
|
||||
return Electric_Residual;
|
||||
}
|
||||
|
||||
public void setElectric_Residual(String Electric_Residual) {
|
||||
this.Electric_Residual = Electric_Residual;
|
||||
}
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response = null;
|
||||
response = ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if (session.getAttribute("id") == null) {
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='electricAdd.jsp';</script>");
|
||||
out.flush();
|
||||
out.close();
|
||||
return null;
|
||||
}
|
||||
long l = System.currentTimeMillis();
|
||||
Date date = new Date(l);
|
||||
//转换提日期输出格式
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Edate=dateFormat.format(date);
|
||||
Electric_ID=1;
|
||||
Electric_Dormitory_Number="01-1-101";
|
||||
Electric_Residual="46";
|
||||
electric_addBean cnbean=new electric_addBean();
|
||||
cnbean.setElectric_ID(Electric_ID);
|
||||
cnbean.setElectric_Dormitory_Number(Electric_Dormitory_Number);
|
||||
cnbean.setElectric_Residual(Electric_Residual);
|
||||
new electriDao().Add(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('添加成功!');window.location='StudentManager.action.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
}
|
@ -1,127 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.electric_addBean;
|
||||
import com.dao.electriDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
public class electricManager extends ActionSupport {
|
||||
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private List<electric_addBean> list;
|
||||
|
||||
|
||||
public List<electric_addBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<electric_addBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
private String SearchRow;
|
||||
private String SearchKey;
|
||||
|
||||
public String getSearchRow() {
|
||||
return SearchRow;
|
||||
}
|
||||
|
||||
public void setSearchRow(String searchRow) {
|
||||
SearchRow = searchRow;
|
||||
}
|
||||
|
||||
public String getSearchKey() {
|
||||
return SearchKey;
|
||||
}
|
||||
|
||||
public void setSearchKey(String searchKey) {
|
||||
SearchKey = searchKey;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response = null;
|
||||
response = ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
//查询条件
|
||||
// String strWhere="1=1";
|
||||
// if(!(isInvalid(SearchKey)))
|
||||
// {
|
||||
// strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
|
||||
// }
|
||||
// if(!(isInvalid(State)))
|
||||
// {
|
||||
// strWhere+=" and Student_State='"+State+"'";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// strWhere+=" and Student_State='入住'";
|
||||
// }
|
||||
//查询所有
|
||||
if(session.getAttribute("type").toString().equals("3")){ String strWhere = "1=1";
|
||||
if (!(isInvalid(SearchKey))) {
|
||||
strWhere += " and " + SearchRow + "='" + SearchKey + "'";
|
||||
}
|
||||
// if(!(isInvalid(Integer.toString(repair_id))))
|
||||
// {
|
||||
// strWhere+=" and repair_id='"+repair_id+"'";
|
||||
// }
|
||||
|
||||
//查询所有楼宇
|
||||
//list=new RepairDao().GetList("","repair_id");
|
||||
|
||||
//查询所有
|
||||
list = new electriDao().GetList(strWhere, "Electric_Dormitory_Number");
|
||||
|
||||
return ERROR;}
|
||||
else{
|
||||
String strWhere = "1=1";
|
||||
if (!(isInvalid(SearchKey))) {
|
||||
strWhere += " and " + SearchRow + "='" + SearchKey + "'";
|
||||
}
|
||||
// if(!(isInvalid(Integer.toString(repair_id))))
|
||||
// {
|
||||
// strWhere+=" and repair_id='"+repair_id+"'";
|
||||
// }
|
||||
|
||||
//查询所有楼宇
|
||||
//list=new RepairDao().GetList("","repair_id");
|
||||
|
||||
//查询所有
|
||||
list = new electriDao().GetList(strWhere, "Electric_Dormitory_Number");
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,79 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.electric_addBean;
|
||||
import com.dao.electriDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
public class electricUpdatesave extends ActionSupport {
|
||||
private int Electric_ID;
|
||||
private String Electric_Dormitory_Number;
|
||||
private String Electric_Residual;
|
||||
public int getElectric_ID() {
|
||||
return Electric_ID;
|
||||
}
|
||||
|
||||
public void setElectric_ID(int studentID) {
|
||||
this.Electric_ID = studentID;
|
||||
}
|
||||
|
||||
public String getElectric_Dormitory_Number() {
|
||||
return Electric_Dormitory_Number;
|
||||
}
|
||||
|
||||
public void setElectric_Dormitory_Number(String studentDormitory_Number) {
|
||||
this. Electric_Dormitory_Number = studentDormitory_Number;
|
||||
}
|
||||
|
||||
|
||||
public String getElectric_Residual() {
|
||||
return Electric_Residual;
|
||||
}
|
||||
public void setElectric_Residual(String studentResidual) { this.Electric_Residual = studentResidual;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response= ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
electric_addBean cnbean=new electric_addBean();
|
||||
cnbean= new electriDao().GetBean(Electric_ID);
|
||||
cnbean.setElectric_ID(Electric_ID);
|
||||
cnbean.setElectric_Dormitory_Number(Electric_Dormitory_Number);
|
||||
cnbean.setElectric_Residual(Electric_Residual);
|
||||
|
||||
|
||||
/*if(!(isInvalid(Student_Password)))
|
||||
{
|
||||
cnbean.setStudent_Password(Student_Password);
|
||||
}*/
|
||||
new electriDao().Update(cnbean);
|
||||
|
||||
//跳转
|
||||
out.print("<script language='javascript'>alert('修改成功!');window.location='electricManager.action';</script>");
|
||||
out.flush();out.close();return null;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package com.action;
|
||||
|
||||
import com.bean.electric_addBean;
|
||||
import com.dao.electriDao;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public class electricupdate extends ActionSupport{
|
||||
|
||||
//下面是Action内用于封装用户请求参数的属性
|
||||
private int Electric_ID;
|
||||
|
||||
private electric_addBean cnbean;
|
||||
public int getElectric_ID() {
|
||||
return Electric_ID;
|
||||
}
|
||||
|
||||
public void setElectric_ID(int Electric_ID) {
|
||||
this.Electric_ID= Electric_ID;
|
||||
}
|
||||
|
||||
public electric_addBean getCnbean() {
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
public void setCnbean(electric_addBean cnbean) {
|
||||
this.cnbean = cnbean;
|
||||
}
|
||||
|
||||
//处理用户请求的execute方法
|
||||
public String execute() throws Exception {
|
||||
|
||||
//解决乱码,用于页面输出
|
||||
HttpServletResponse response=null;
|
||||
response= ServletActionContext.getResponse();
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//创建session对象
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//验证是否正常登录
|
||||
if(session.getAttribute("id")==null){
|
||||
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
|
||||
out.flush();out.close();return null;
|
||||
}
|
||||
|
||||
//查询
|
||||
cnbean=new electriDao().GetBean(Electric_ID);
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
package com.bean;
|
||||
public class AdminBean {
|
||||
|
||||
private int Admin_ID ;
|
||||
private String Admin_Username ;
|
||||
private String Admin_Password ;
|
||||
private String Admin_Name ;
|
||||
private String Admin_Sex ;
|
||||
private String Admin_Tel ;
|
||||
public int getAdmin_ID() {
|
||||
return Admin_ID;
|
||||
}
|
||||
public void setAdmin_ID(int adminID) {
|
||||
Admin_ID = adminID;
|
||||
}
|
||||
public String getAdmin_Username() {
|
||||
return Admin_Username;
|
||||
}
|
||||
public void setAdmin_Username(String adminUsername) {
|
||||
Admin_Username = adminUsername;
|
||||
}
|
||||
public String getAdmin_Password() {
|
||||
return Admin_Password;
|
||||
}
|
||||
public void setAdmin_Password(String adminPassword) {
|
||||
Admin_Password = adminPassword;
|
||||
}
|
||||
public String getAdmin_Name() {
|
||||
return Admin_Name;
|
||||
}
|
||||
public void setAdmin_Name(String adminName) {
|
||||
Admin_Name = adminName;
|
||||
}
|
||||
public String getAdmin_Sex() {
|
||||
return Admin_Sex;
|
||||
}
|
||||
public void setAdmin_Sex(String adminSex) {
|
||||
Admin_Sex = adminSex;
|
||||
}
|
||||
public String getAdmin_Tel() {
|
||||
return Admin_Tel;
|
||||
}
|
||||
public void setAdmin_Tel(String adminTel) {
|
||||
Admin_Tel = adminTel;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package com.bean;
|
||||
|
||||
public class Repair_addBean {
|
||||
private int repair_id;
|
||||
private String repair_address;
|
||||
private String repair_info;
|
||||
private String repair_cost;
|
||||
private String repair_tel;
|
||||
private String repair_status;
|
||||
private String repair_time;
|
||||
public int getRepair_id() {
|
||||
return repair_id;
|
||||
}
|
||||
|
||||
public void setRepair_id(int repair_id) {
|
||||
this.repair_id = repair_id;
|
||||
}
|
||||
|
||||
|
||||
public String getRepair_time() {
|
||||
return repair_time;
|
||||
}
|
||||
|
||||
public void setRepair_time(String repair_time) {
|
||||
this.repair_time = repair_time;
|
||||
}
|
||||
|
||||
public String getRepair_address() {
|
||||
return repair_address;
|
||||
}
|
||||
|
||||
public void setRepair_address(String repair_address) {
|
||||
this.repair_address = repair_address;
|
||||
}
|
||||
|
||||
public String getRepair_info() {
|
||||
return repair_info;
|
||||
}
|
||||
|
||||
public void setRepair_info(String repair_info) {
|
||||
this.repair_info = repair_info;
|
||||
}
|
||||
|
||||
public String getRepair_cost() {
|
||||
return repair_cost;
|
||||
}
|
||||
|
||||
public void setRepair_cost(String repair_cost) {
|
||||
this.repair_cost = repair_cost;
|
||||
}
|
||||
|
||||
public String getRepair_tel() {
|
||||
return repair_tel;
|
||||
}
|
||||
|
||||
public void setRepair_tel(String repair_tel) {
|
||||
this.repair_tel = repair_tel;
|
||||
}
|
||||
|
||||
public String getRepair_status() {
|
||||
return repair_status;
|
||||
}
|
||||
|
||||
public void setRepair_status(String repair_status) {
|
||||
this.repair_status = repair_status;
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package com.bean;
|
||||
public class StudentBean {
|
||||
|
||||
private int Student_ID ;
|
||||
private int Student_DomitoryID ;
|
||||
private String Student_Username ;
|
||||
private String Student_Password ;
|
||||
private String Student_Name ;
|
||||
private String Student_Sex ;
|
||||
private String Student_Class ;
|
||||
private String Student_State ;
|
||||
public int getStudent_ID() {
|
||||
return Student_ID;
|
||||
}
|
||||
public void setStudent_ID(int studentID) {
|
||||
Student_ID = studentID;
|
||||
}
|
||||
public int getStudent_DomitoryID() {
|
||||
return Student_DomitoryID;
|
||||
}
|
||||
public void setStudent_DomitoryID(int studentDomitoryID) {
|
||||
Student_DomitoryID = studentDomitoryID;
|
||||
}
|
||||
public String getStudent_Username() {
|
||||
return Student_Username;
|
||||
}
|
||||
public void setStudent_Username(String studentUsername) {
|
||||
Student_Username = studentUsername;
|
||||
}
|
||||
public String getStudent_Password() {
|
||||
return Student_Password;
|
||||
}
|
||||
public void setStudent_Password(String studentPassword) {
|
||||
Student_Password = studentPassword;
|
||||
}
|
||||
public String getStudent_Name() {
|
||||
return Student_Name;
|
||||
}
|
||||
public void setStudent_Name(String studentName) {
|
||||
Student_Name = studentName;
|
||||
}
|
||||
public String getStudent_Sex() {
|
||||
return Student_Sex;
|
||||
}
|
||||
public void setStudent_Sex(String studentSex) {
|
||||
Student_Sex = studentSex;
|
||||
}
|
||||
public String getStudent_Class() {
|
||||
return Student_Class;
|
||||
}
|
||||
public void setStudent_Class(String studentClass) {
|
||||
Student_Class = studentClass;
|
||||
}
|
||||
public String getStudent_State() {
|
||||
return Student_State;
|
||||
}
|
||||
public void setStudent_State(String studentState) {
|
||||
Student_State = studentState;
|
||||
}
|
||||
private String Domitory_Name ;
|
||||
private String Building_Name ;
|
||||
public String getDomitory_Name() {
|
||||
return Domitory_Name;
|
||||
}
|
||||
public void setDomitory_Name(String domitoryName) {
|
||||
Domitory_Name = domitoryName;
|
||||
}
|
||||
public String getBuilding_Name() {
|
||||
return Building_Name;
|
||||
}
|
||||
public void setBuilding_Name(String buildingName) {
|
||||
Building_Name = buildingName;
|
||||
}
|
||||
private String Domitory_Type ;
|
||||
private String Domitory_Number ;
|
||||
private String Domitory_Tel ;
|
||||
public String getDomitory_Type() {
|
||||
return Domitory_Type;
|
||||
}
|
||||
public void setDomitory_Type(String domitoryType) {
|
||||
Domitory_Type = domitoryType;
|
||||
}
|
||||
public String getDomitory_Number() {
|
||||
return Domitory_Number;
|
||||
}
|
||||
public void setDomitory_Number(String domitoryNumber) {
|
||||
Domitory_Number = domitoryNumber;
|
||||
}
|
||||
public String getDomitory_Tel() {
|
||||
return Domitory_Tel;
|
||||
}
|
||||
public void setDomitory_Tel(String domitoryTel) {
|
||||
Domitory_Tel = domitoryTel;
|
||||
}
|
||||
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package com.bean;
|
||||
public class TeacherBean {
|
||||
|
||||
private int Teacher_ID ;
|
||||
private String Teacher_Username ;
|
||||
private String Teacher_Password ;
|
||||
private String Teacher_Name ;
|
||||
private String Teacher_Sex ;
|
||||
private String Teacher_Tel ;
|
||||
public int getTeacher_ID() {
|
||||
return Teacher_ID;
|
||||
}
|
||||
public void setTeacher_ID(int teacherID) {
|
||||
Teacher_ID = teacherID;
|
||||
}
|
||||
public String getTeacher_Username() {
|
||||
return Teacher_Username;
|
||||
}
|
||||
public void setTeacher_Username(String teacherUsername) {
|
||||
Teacher_Username = teacherUsername;
|
||||
}
|
||||
public String getTeacher_Password() {
|
||||
return Teacher_Password;
|
||||
}
|
||||
public void setTeacher_Password(String teacherPassword) {
|
||||
Teacher_Password = teacherPassword;
|
||||
}
|
||||
public String getTeacher_Name() {
|
||||
return Teacher_Name;
|
||||
}
|
||||
public void setTeacher_Name(String teacherName) {
|
||||
Teacher_Name = teacherName;
|
||||
}
|
||||
public String getTeacher_Sex() {
|
||||
return Teacher_Sex;
|
||||
}
|
||||
public void setTeacher_Sex(String teacherSex) {
|
||||
Teacher_Sex = teacherSex;
|
||||
}
|
||||
public String getTeacher_Tel() {
|
||||
return Teacher_Tel;
|
||||
}
|
||||
public void setTeacher_Tel(String teacherTel) {
|
||||
Teacher_Tel = teacherTel;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.bean;
|
||||
|
||||
public class electric_addBean {
|
||||
private int Electric_ID;
|
||||
private String Electric_Dormitory_Number;
|
||||
private String Electric_Residual;
|
||||
|
||||
|
||||
public int getElectric_ID() {
|
||||
return Electric_ID;
|
||||
}
|
||||
|
||||
public void setElectric_ID(int Electric_ID) {
|
||||
this.Electric_ID =Electric_ID;
|
||||
}
|
||||
|
||||
public String getElectric_Dormitory_Number() {
|
||||
return Electric_Dormitory_Number;
|
||||
}
|
||||
|
||||
public void setElectric_Dormitory_Number(String Electric_Dormitory_Number) {
|
||||
this.Electric_Dormitory_Number =Electric_Dormitory_Number;}
|
||||
|
||||
|
||||
public String getElectric_Residual( ) { return Electric_Residual; }
|
||||
|
||||
public void setElectric_Residual(String Electric_Residual) {
|
||||
this.Electric_Residual= Electric_Residual;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,224 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.db.DBHelper;
|
||||
import com.bean.AdminBean;
|
||||
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
|
||||
public class AdminDao {
|
||||
|
||||
//验证登录
|
||||
public String CheckLogin(String username, String password){
|
||||
System.out.println("user"+username+"password"+password);
|
||||
String id = null;
|
||||
String sql="select * from Admin where Admin_Username='"+username+"' and Admin_Password='"+password+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
id = rs.getString("Admin_ID");
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){}
|
||||
return id;
|
||||
}
|
||||
//验证密码
|
||||
public boolean CheckPassword(String id, String password){
|
||||
boolean ps = false;
|
||||
String sql="select * from Admin where Admin_ID='"+id+"' and Admin_Password='"+password+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
ps=true;
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){}
|
||||
return ps;
|
||||
}
|
||||
//获取列表
|
||||
public List<AdminBean> GetList(String strwhere,String strorder){
|
||||
String sql="select * from Admin";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" where "+strwhere;
|
||||
}
|
||||
if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<AdminBean> list=new ArrayList<AdminBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
AdminBean cnbean=new AdminBean();
|
||||
cnbean.setAdmin_ID(rs.getInt("Admin_ID"));
|
||||
cnbean.setAdmin_Username(rs.getString("Admin_Username"));
|
||||
cnbean.setAdmin_Password(rs.getString("Admin_Password"));
|
||||
cnbean.setAdmin_Name(rs.getString("Admin_Name"));
|
||||
cnbean.setAdmin_Sex(rs.getString("Admin_Sex"));
|
||||
cnbean.setAdmin_Tel(rs.getString("Admin_Tel"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取指定ID的实体Bean
|
||||
public AdminBean GetBean(int id){
|
||||
String sql="select * from Admin where Admin_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
AdminBean cnbean=new AdminBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setAdmin_ID(rs.getInt("Admin_ID"));
|
||||
cnbean.setAdmin_Username(rs.getString("Admin_Username"));
|
||||
cnbean.setAdmin_Password(rs.getString("Admin_Password"));
|
||||
cnbean.setAdmin_Name(rs.getString("Admin_Name"));
|
||||
cnbean.setAdmin_Sex(rs.getString("Admin_Sex"));
|
||||
cnbean.setAdmin_Tel(rs.getString("Admin_Tel"));
|
||||
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
//添加
|
||||
public void Add(AdminBean cnbean){
|
||||
String sql="insert into Admin (";
|
||||
sql+="Admin_Username,Admin_Password,Admin_Name,Admin_Sex,Admin_Tel";
|
||||
sql+=") values(";
|
||||
sql+="'"+cnbean.getAdmin_Username()+"','"+cnbean.getAdmin_Password()+"','"+cnbean.getAdmin_Name()+"','"+cnbean.getAdmin_Sex()+"','"+cnbean.getAdmin_Tel()+"'";
|
||||
sql+=")";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改
|
||||
public void Update(AdminBean cnbean){
|
||||
String sql="update Admin set ";
|
||||
sql+="Admin_Username='"+cnbean.getAdmin_Username()+"',";
|
||||
sql+="Admin_Password='"+cnbean.getAdmin_Password()+"',";
|
||||
sql+="Admin_Name='"+cnbean.getAdmin_Name()+"',";
|
||||
sql+="Admin_Sex='"+cnbean.getAdmin_Sex()+"',";
|
||||
sql+="Admin_Tel='"+cnbean.getAdmin_Tel()+"'";
|
||||
|
||||
sql+=" where Admin_ID='"+cnbean.getAdmin_ID()+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除
|
||||
public void Delete(String strwhere){
|
||||
String sql="delete Admin where ";
|
||||
sql+=strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,202 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.bean.Repair_addBean;
|
||||
import com.db.DBHelper;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RepairDao {
|
||||
//获取列表
|
||||
public List<Repair_addBean> GetList(String strwhere, String strorder){
|
||||
String sql="select * from repair ";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" where "+strwhere;
|
||||
}
|
||||
if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<Repair_addBean> list=new ArrayList<Repair_addBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
Repair_addBean cnbean=new Repair_addBean();
|
||||
// cnbean.setRepair_time((rs.getInt("Repair_time")));
|
||||
cnbean.setRepair_id(rs.getInt("repair_id"));
|
||||
cnbean.setRepair_info(rs.getString("repair_info"));
|
||||
cnbean.setRepair_address(rs.getString("repair_address"));
|
||||
//cnbean.setRepair_info(rs.getString("repair_info;"));
|
||||
// cnbean.setRepair_cost(rs.getString("repair_cost"));
|
||||
cnbean.setRepair_tel(rs.getString("repair_tel"));
|
||||
cnbean.setRepair_status(rs.getString("repair_status"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取指定ID的实体Bean
|
||||
public Repair_addBean GetBean(int id){
|
||||
|
||||
String sql="select * from repair where repair_id="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
Repair_addBean cnbean=new Repair_addBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setRepair_id(rs.getInt("repair_id"));
|
||||
// cnbean.setRepair_info(rs.getString("repair_info"));
|
||||
// cnbean.setRepair_address(rs.getString("repair_address"));
|
||||
// cnbean.setRepair_tel(rs.getString("repair_tel"));
|
||||
cnbean.setRepair_status(rs.getString("repair_status"));
|
||||
// cnbean.setTeacher_Tel(rs.getString("Teacher_Tel"));
|
||||
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
//添加
|
||||
public void Add(Repair_addBean cnbean){
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
|
||||
String sql="insert into repair (";
|
||||
sql+="repair_id,repair_info,repair_address,repair_tel";
|
||||
sql+=") values(";
|
||||
sql+="'"+cnbean.getRepair_id()+"','"+cnbean.getRepair_info()+"','"+cnbean.getRepair_address()+"','"+cnbean.getRepair_tel()+"'";
|
||||
|
||||
sql+=")";
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改
|
||||
public void Update(Repair_addBean cnbean){
|
||||
String sql="update repair set ";
|
||||
// sql+="repair_id='"+cnbean.getRepair_id()+"',";
|
||||
// sql+="repair_info='"+cnbean.getRepair_info()+"',";
|
||||
//sql+="repair_address='"+cnbean.getRepair_address()+"',";
|
||||
// sql+="repair_tel='"+cnbean.getRepair_tel()+"',";
|
||||
sql+="repair_status='"+cnbean.getRepair_status()+"'";
|
||||
|
||||
sql+=" where repair_id='"+cnbean.getRepair_id()+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
System.out.println(sql);
|
||||
System.out.println("修改状态成功");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除
|
||||
public void Delete(String strwhere){
|
||||
String sql="delete repair where ";
|
||||
sql+=strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,462 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.bean.StudentBean;
|
||||
import com.db.DBHelper;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StudentDao {
|
||||
|
||||
//验证登录
|
||||
public String CheckLogin(String username, String password){
|
||||
String id = null;
|
||||
String sql="select * from Student where Student_Username='"+username+"' and Student_Password='"+password+"' or Student_State='入住'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
System.out.println(sql);
|
||||
Connection conn = new DBHelper().getConn();
|
||||
System.out.println(conn);
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
id = rs.getString("Student_ID");
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){
|
||||
System.out.println(ex);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
//验证密码
|
||||
public boolean CheckPassword(String id, String password){
|
||||
boolean ps = false;
|
||||
String sql="select * from Student where Student_ID='"+id+"' and Student_Password='"+password+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
ps=true;
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){}
|
||||
return ps;
|
||||
}
|
||||
//获取所有列表
|
||||
public List<StudentBean> GetAllList(String strwhere,String strorder){
|
||||
String sql="select *from Student";
|
||||
// String sql1="select count(*) from Student";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" where "+strwhere;
|
||||
}
|
||||
if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
System.out.println(sql);
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
// String count="";
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<StudentBean> list=new ArrayList<StudentBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
// count= String.valueOf(stat.executeQuery(sql1));
|
||||
// System.out.println(count);
|
||||
HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
// session.setAttribute("number", count);
|
||||
while(rs.next()){
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public List<StudentBean> GetAllList1(int a){
|
||||
|
||||
|
||||
System.out.println(a);
|
||||
a=a*16;
|
||||
int b=16;
|
||||
System.out.println("a"+a);
|
||||
System.out.println("b"+b);
|
||||
String sql="select *from Student LIMIT ";
|
||||
sql+=a+","+b;
|
||||
String sql1="select count(*) from Student";
|
||||
System.out.println(sql);
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
String count="";
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<StudentBean> list=new ArrayList<StudentBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
// count= String.valueOf(stat.executeQuery(sql1));
|
||||
System.out.println(count);
|
||||
// HttpSession session = ServletActionContext.getRequest().getSession();
|
||||
//// session.setAttribute("number", count);
|
||||
while(rs.next()){
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//获取列表
|
||||
public List<StudentBean> GetList(String strwhere,String strorder){
|
||||
String sql="select * from Student,Domitory,Building where Student_DomitoryID=Domitory_ID and Domitory_BuildingID=Building_ID";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" and "+strwhere;
|
||||
}
|
||||
if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
// System.out.println(sql);
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<StudentBean> list=new ArrayList<StudentBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
StudentBean cnbean=new StudentBean();
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
cnbean.setDomitory_Name(rs.getString("Domitory_Name"));
|
||||
cnbean.setBuilding_Name(rs.getString("Building_Name"));
|
||||
cnbean.setDomitory_Type(rs.getString("Domitory_Type"));
|
||||
cnbean.setDomitory_Number(rs.getString("Domitory_Number"));
|
||||
cnbean.setDomitory_Tel(rs.getString("Domitory_Tel"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//获取指定ID的实体Bean
|
||||
public StudentBean GetAllFirstBean(String strwhere){
|
||||
String sql="select * from Student where "+strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
StudentBean cnbean=new StudentBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
if(rs.next()){
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
//获取指定ID的实体Bean
|
||||
public StudentBean GetFirstBean(String strwhere){
|
||||
String sql="select * from Student,Domitory,Building where Student_DomitoryID=Domitory_ID and Domitory_BuildingID=Building_ID and "+strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
StudentBean cnbean=new StudentBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
if(rs.next()){
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
cnbean.setDomitory_Name(rs.getString("Domitory_Name"));
|
||||
cnbean.setDomitory_Number(rs.getString("Domitory_Number"));
|
||||
cnbean.setBuilding_Name(rs.getString("Building_Name"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
//获取指定ID的实体Bean
|
||||
public StudentBean GetAllBean(int id){
|
||||
String sql="select * from Student where Student_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
StudentBean cnbean=new StudentBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
//获取指定ID的实体Bean
|
||||
public StudentBean GetBean(int id){
|
||||
String sql="select * from Student,Domitory,Building where Student_DomitoryID=Student_DomitoryID and where Building_ID=Building and where Student_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
StudentBean cnbean=new StudentBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setStudent_ID(rs.getInt("Student_ID"));
|
||||
cnbean.setStudent_DomitoryID(rs.getInt("Student_DomitoryID"));
|
||||
cnbean.setStudent_Username(rs.getString("Student_Username"));
|
||||
cnbean.setStudent_Password(rs.getString("Student_Password"));
|
||||
cnbean.setStudent_Name(rs.getString("Student_Name"));
|
||||
cnbean.setStudent_Sex(rs.getString("Student_Sex"));
|
||||
cnbean.setStudent_Class(rs.getString("Student_Class"));
|
||||
cnbean.setStudent_State(rs.getString("Student_State"));
|
||||
cnbean.setDomitory_Name(rs.getString("Domitory_Name"));
|
||||
cnbean.setBuilding_Name(rs.getString("Building_Name"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
//添加
|
||||
public void Add(StudentBean cnbean){
|
||||
String sql="insert into Student (";
|
||||
sql+="Student_DomitoryID,Student_Username,Student_Password,Student_Name,Student_Sex,Student_Class,Student_State";
|
||||
sql+=") values(";
|
||||
sql+="'"+cnbean.getStudent_DomitoryID()+"','"+cnbean.getStudent_Username()+"','"+cnbean.getStudent_Password()+"','"+cnbean.getStudent_Name()+"','"+cnbean.getStudent_Sex()+"','"+cnbean.getStudent_Class()+"','"+cnbean.getStudent_State()+"'";
|
||||
sql+=")";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改
|
||||
public void Update(StudentBean cnbean){
|
||||
String sql="update Student set ";
|
||||
sql+="Student_DomitoryID='"+cnbean.getStudent_DomitoryID()+"',";
|
||||
sql+="Student_Username='"+cnbean.getStudent_Username()+"',";
|
||||
sql+="Student_Password='"+cnbean.getStudent_Password()+"',";
|
||||
sql+="Student_Name='"+cnbean.getStudent_Name()+"',";
|
||||
sql+="Student_Sex='"+cnbean.getStudent_Sex()+"',";
|
||||
sql+="Student_Class='"+cnbean.getStudent_Class()+"',";
|
||||
sql+="Student_State='"+cnbean.getStudent_State()+"'";
|
||||
|
||||
sql+=" where Student_ID='"+cnbean.getStudent_ID()+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除
|
||||
public void Delete(int id){
|
||||
String sql="delete from student where Student_ID="+id;
|
||||
//sql+=strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,231 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.db.DBHelper;
|
||||
import com.bean.TeacherBean;
|
||||
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
|
||||
public class TeacherDao {
|
||||
|
||||
//验证登录
|
||||
public String CheckLogin(String username, String password){
|
||||
System.out.println("user"+username+"password"+password);
|
||||
String id = null;
|
||||
String sql="select * from Teacher where Teacher_Username='"+username+"' and Teacher_Password='"+password+"'";
|
||||
System.out.println(sql);
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
System.out.println(conn);
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
id = rs.getString("Teacher_ID");
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){
|
||||
System.out.println(ex);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
//验证密码
|
||||
public boolean CheckPassword(String id, String password){
|
||||
boolean ps = false;
|
||||
String sql="select * from Teacher where Teacher_ID='"+id+"' and Teacher_Password='"+password+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
ps=true;
|
||||
}
|
||||
}
|
||||
catch(SQLException ex){}
|
||||
return ps;
|
||||
}
|
||||
//获取列表
|
||||
public List<TeacherBean> GetList(String strwhere,String strorder){
|
||||
String sql="select * from Teacher";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" where "+strwhere;
|
||||
}
|
||||
if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<TeacherBean> list=new ArrayList<TeacherBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
TeacherBean cnbean=new TeacherBean();
|
||||
cnbean.setTeacher_ID(rs.getInt("Teacher_ID"));
|
||||
cnbean.setTeacher_Username(rs.getString("Teacher_Username"));
|
||||
cnbean.setTeacher_Password(rs.getString("Teacher_Password"));
|
||||
cnbean.setTeacher_Name(rs.getString("Teacher_Name"));
|
||||
cnbean.setTeacher_Sex(rs.getString("Teacher_Sex"));
|
||||
cnbean.setTeacher_Tel(rs.getString("Teacher_Tel"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取指定ID的实体Bean
|
||||
public TeacherBean GetBean(int id){
|
||||
String sql="select * from Teacher where Teacher_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
TeacherBean cnbean=new TeacherBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setTeacher_ID(rs.getInt("Teacher_ID"));
|
||||
cnbean.setTeacher_Username(rs.getString("Teacher_Username"));
|
||||
cnbean.setTeacher_Password(rs.getString("Teacher_Password"));
|
||||
cnbean.setTeacher_Name(rs.getString("Teacher_Name"));
|
||||
cnbean.setTeacher_Sex(rs.getString("Teacher_Sex"));
|
||||
cnbean.setTeacher_Tel(rs.getString("Teacher_Tel"));
|
||||
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
|
||||
//添加
|
||||
public void Add(TeacherBean cnbean){
|
||||
String sql="insert into Teacher (";
|
||||
sql+="Teacher_Username,Teacher_Password,Teacher_Name,Teacher_Sex,Teacher_Tel";
|
||||
sql+=") values(";
|
||||
sql+="'"+cnbean.getTeacher_Username()+"','"+cnbean.getTeacher_Password()+"','"+cnbean.getTeacher_Name()+"','"+cnbean.getTeacher_Sex()+"','"+cnbean.getTeacher_Tel()+"'";
|
||||
|
||||
sql+=")";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改
|
||||
public void Update(TeacherBean cnbean){
|
||||
String sql="update Teacher set ";
|
||||
sql+="Teacher_Username='"+cnbean.getTeacher_Username()+"',";
|
||||
sql+="Teacher_Password='"+cnbean.getTeacher_Password()+"',";
|
||||
sql+="Teacher_Name='"+cnbean.getTeacher_Name()+"',";
|
||||
sql+="Teacher_Sex='"+cnbean.getTeacher_Sex()+"',";
|
||||
sql+="Teacher_Tel='"+cnbean.getTeacher_Tel()+"'";
|
||||
|
||||
sql+=" where Teacher_ID='"+cnbean.getTeacher_ID()+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
System.out.println(sql);
|
||||
System.out.println("修改状态成功");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除
|
||||
public void Delete(int id){
|
||||
String sql="delete from teacher where Teacher_ID="+id;
|
||||
//sql+=strwhere;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断是否空值
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
//测试
|
||||
public static void main(String[] args) {
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,179 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
|
||||
|
||||
import com.bean.electric_addBean;
|
||||
import com.db.DBHelper;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class electriDao {
|
||||
//获取列表
|
||||
|
||||
public List<electric_addBean> GetList(String strwhere,String strorder){
|
||||
String sql="select * from electric";
|
||||
if(!(isInvalid(strwhere)))
|
||||
{
|
||||
sql+=" where "+strwhere;
|
||||
}if(!(isInvalid(strorder)))
|
||||
{
|
||||
sql+=" order by "+strorder;
|
||||
}
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
List<electric_addBean> list=new ArrayList<electric_addBean>();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
electric_addBean cnbean=new electric_addBean();
|
||||
cnbean.setElectric_ID(rs.getInt("Electric_ID"));
|
||||
cnbean.setElectric_Dormitory_Number(rs.getString("Electric_Dormitory_Number"));
|
||||
cnbean.setElectric_Residual(rs.getString("Electric_Residual"));
|
||||
list.add(cnbean);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public electric_addBean GetBean(int id){
|
||||
String sql="select * from electric where Electric_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
electric_addBean cnbean=new electric_addBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
// cnbean.setTeacher_ID(rs.getInt("Teacher_ID"));
|
||||
cnbean.setElectric_ID(rs.getInt("Electric_ID"));
|
||||
cnbean.setElectric_Dormitory_Number(rs.getString("Electric_Dormitory_Number"));
|
||||
cnbean.setElectric_Residual(rs.getString("Electric_Residual"));
|
||||
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
public void Add(electric_addBean cnbean){
|
||||
String sql="insert into electric (";
|
||||
sql+="Electric_ID,Electric_Dormitory_Number,Electric_Residual";
|
||||
sql+=") values(";
|
||||
sql+="'"+cnbean.getElectric_ID()+"','"+cnbean.getElectric_Dormitory_Number()+"','"+cnbean.getElectric_Residual()+"'";
|
||||
sql+=")";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改
|
||||
public void Update(electric_addBean cnbean){
|
||||
String sql="update electric set ";
|
||||
//sql+="Electric_Domitory_Number='"+cnbean.getElectric_Dormitory_Number()+"',";
|
||||
sql+="Electric_Residual='"+cnbean.getElectric_Residual()+"'";
|
||||
// sql+="Student_Password='"+cnbean.getStudent_Password()+"',";
|
||||
|
||||
sql+=" where Electric_ID='"+cnbean.getElectric_ID()+"'";
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
stat.executeUpdate(sql);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
public electric_addBean GetAllBean(int id){
|
||||
String sql="select * from electric where Electric_ID="+id;
|
||||
Statement stat = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = new DBHelper().getConn();
|
||||
electric_addBean cnbean=new electric_addBean();
|
||||
try{
|
||||
stat = conn.createStatement();
|
||||
rs = stat.executeQuery(sql);
|
||||
while(rs.next()){
|
||||
cnbean.setElectric_ID(rs.getInt("Electric_ID"));
|
||||
cnbean.setElectric_Dormitory_Number(rs.getString("Electric_Dormitory_Number"));
|
||||
cnbean.setElectric_Residual(rs.getString("Electric_Residual"));
|
||||
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
if (stat != null)
|
||||
stat.close();
|
||||
if (rs != null)
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cnbean;
|
||||
}
|
||||
private boolean isInvalid(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
}
|