package servlet;
import gongong.DateUtils;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.TJiaoshi;
import db.DB;
public class jiaoshi_servlet extends HttpServlet{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");
if(type.endsWith("jiaoshiAdd"))
{
jiaoshiAdd(req, res);
}
if(type.endsWith("jiaoshiUpd"))
{
jiaoshiUpd(req, res);
}
if(type.endsWith("jiaoshiDel"))
{
jiaoshiDel(req, res);
}
if(type.endsWith("jiaoshiMana"))
{
jiaoshiMana(req, res);
}
if(type.endsWith("jiaoshiQuery"))
{
jiaoshiQuery(req, res);
}
}
public void jiaoshiDel(HttpServletRequest req,HttpServletResponse res)
{
int id = Integer.parseInt(req.getParameter("id"));
String del = "yes";
String sql = "update t_jiaoshi set del=? where id=?";
Object[] params={del,id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "教师信息删除成功!");
req.setAttribute("path", "jiaoshi?type=jiaoshiMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void jiaoshiUpd(HttpServletRequest req,HttpServletResponse res)
{
int id = Integer.parseInt(req.getParameter("id"));
String gonghao = req.getParameter("gonghao");
String xingming = req.getParameter("xingming");
String xingbie = req.getParameter("xingbie");
String nianling = req.getParameter("nianling");
String shengri = req.getParameter("shengri");
String gongzuo = req.getParameter("gongzuo");
String zhuanye = req.getParameter("zhuanye");
String zhaopian = req.getParameter("zhaopian");
String beizhu = req.getParameter("beizhu");
String sql = "update t_jiaoshi set gonghao=?,xingming=?,xingbie=?,nianling=?,shengri=?,gongzuo=?,zhuanye=?,zhaopian=?,beizhu=? where id=?";
Object[] params={gonghao,xingming,xingbie,nianling,shengri,gongzuo,zhuanye,zhaopian,beizhu,id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "教师信息修改成功!");
req.setAttribute("path", "jiaoshi?type=jiaoshiMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void jiaoshiAdd(HttpServletRequest req,HttpServletResponse res)
{
String gonghao = req.getParameter("gonghao");
String xingming = req.getParameter("xingming");
String xingbie = req.getParameter("xingbie");
String nianling = req.getParameter("nianling");
String shengri = req.getParameter("shengri");
String gongzuo = req.getParameter("gongzuo");
String zhuanye = req.getParameter("zhuanye");
String zhaopian = req.getParameter("zhaopian");
String beizhu = req.getParameter("beizhu");
String del = "no";
String sql = "insert into t_jiaoshi (gonghao,xingming,xingbie,nianling,shengri,gongzuo,zhuanye,zhaopian,beizhu,del)" +
" values (?,?,?,?,?,?,?,?,?,?)";
Object[] params={gonghao,xingming,xingbie,nianling,shengri,gongzuo,zhuanye,zhaopian,beizhu,del};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "教师信息添加成功!");
req.setAttribute("path", "jiaoshi?type=jiaoshiMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void jiaoshiMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List jiaoshiList=new ArrayList();
String sql="select * from t_jiaoshi where del='no'";
Object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
TJiaoshi jiaoshi=new TJiaoshi();
jiaoshi.setId(rs.getInt("id"));
jiaoshi.setGonghao(rs.getString("gonghao"));
jiaoshi.setXingming(rs.getString("xingming"));
jiaoshi.setXingbie(rs.getString("xingbie"));
jiaoshi.setNianling(rs.getString("nianling"));
jiaoshi.setShengri(rs.getString("shengri"));
jiaoshi.setGongzuo(rs.getString("gongzuo"));
jiaoshi.setZhuanye(rs.getString("zhuanye"));
jiaoshi.setZhaopian(rs.getString("zhaopian"));
jiaoshi.setBeizhu(rs.getString("beizhu"));
jiaoshiList.add(jiaoshi);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("jiaoshiList", jiaoshiList);
req.getRequestDispatcher("admin/jiaoshi/jiaoshiMana.jsp").forward(req, res);
}
public void jiaoshiQuery(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
String xingming = req.getParameter("xingming")==null?"":req.getParameter("xingming");
String zhuanye = req.getParameter("zhuanye")==null?"":req.getParameter("zhuanye");
List jiaoshiList=new ArrayList();
String sql="select * from t_jiaoshi where del='no'";
if(!("".equals(xingming))){
sql += " and xingming like '%"+xingming+"%'";
}
if(!("".equals(zhuanye))){
sql += "and zhuanye like '%"+zhuanye+"%'";
}
Object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
TJiaoshi jiaoshi=new TJiaoshi();
jiaoshi.setId(rs.getInt("id"));
jiaoshi.setGonghao(rs.getString("gonghao"));
jiaoshi.setXingming(rs.getString("xingming"));
jiaoshi.setXingbie(rs.getString("xingbie"));
jiaoshi.setNianling(rs.getString("nianling"));
jiaoshi.setShengri(rs.getString("shengri"));
jiaoshi.setGongzuo(rs.getString("gongzuo"));
jiaoshi.setZhuanye(rs.getString("zhuanye"));
jiaoshi.setZhaopian(rs.getString("zhaopian"));
jiaoshi.setBeizhu(rs.getString("beizhu"));
jiaoshiList.add(jiaoshi);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("xingming", xingming);
req.setAttribute("zhuanye", zhuanye);
req.setAttribute("jiaoshiList", jiaoshiList);
req.getRequestDispatcher("admin/jiaoshi/jiaoshiQuery.jsp").forward(req, res);
}
public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request, response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
随着科技的迅速发展,各种管理系统已应用到社会的各个领域。高等院校作为科技发展的前沿阵地,实现对教师工资的信息化管理是一个必然的趋势和潮流,教师工资采用传统的手工管理模式已经逐渐不能适应时代的发展。 通过教师工资管理系统这个平台,它将计算机操作及管理理念融于教师工资管理的实际运用中,可以实现教师工资管理的信息化、网络化、系统化、规范化,使工作人员从繁杂的数据查询和统计中解脱出来,减少工作量。系统的主要功能包括:教师信息添加管理、教师信息统计、教师信息导出excel、教师工资管理、工资统计等。 本系统前台主要使用JSP作为开发语言,后台使用MySql作为数据库管理系统,开发环境是MyEclipse,服务器采用tomcat,开发出的一个B/S结构的教师工资管理系统。
资源推荐
资源详情
资源评论
收起资源包目录
【管理系统源码】工资管理系统 (198个子文件)
jiaoshi_servlet.class 6KB
gongzi_servlet.class 6KB
loginService.class 4KB
DB.class 3KB
TJiaoshi.class 2KB
EncodingFilter.class 2KB
DateUtils.class 1KB
TGongzi.class 1KB
TAdmin.class 910B
.classpath 2KB
org.eclipse.wst.common.component 453B
org.eclipse.wst.jsdt.ui.superType.container 49B
css.css 10KB
base.css 5KB
woncore.css 3KB
dtree.css 795B
reservation01.gif 22KB
login-content-bg.gif 20KB
login-wel.gif 9KB
login_06.gif 4KB
main_01.gif 3KB
main_21.gif 3KB
main_06.gif 3KB
main_37.gif 2KB
loading.gif 2KB
main_17.gif 2KB
main_066.gif 2KB
main_05.gif 2KB
left_2.gif 1KB
left_4.gif 1KB
left_3.gif 1KB
left_1.gif 1KB
top_12.gif 1KB
globe.gif 1KB
top_14.gif 1KB
top_15.gif 1KB
top_9.gif 1KB
top_13.gif 1KB
login_09.gif 1KB
trash.gif 1KB
question.gif 1KB
top_10.gif 1KB
base.gif 1KB
top_17.gif 1KB
top_11.gif 1KB
top_8.gif 1KB
top_18.gif 995B
nolines_plus.gif 870B
nolines_minus.gif 861B
main_07.gif 821B
main_09.gif 734B
musicfolder.gif 633B
imgfolder.gif 622B
head1.gif 610B
page.gif 582B
main_13.gif 580B
top_16.gif 574B
top_7.gif 561B
main_25.gif 559B
xyb.gif 556B
syb.gif 554B
top_5.gif 523B
main_36.gif 498B
main_43.gif 493B
right_03.gif 486B
main_15.gif 441B
luck.gif 429B
main_03.gif 427B
main_38.gif 426B
tab_bg.gif 376B
folderopen.gif 376B
folder.gif 372B
qx.gif 359B
main_30.gif 354B
main_30_1.gif 354B
dl.gif 341B
main_40.gif 339B
main_11.gif 334B
top_3.gif 316B
top_4.gif 316B
wbg.gif 311B
login_03.gif 305B
right_10.gif 294B
main_18.gif 285B
cd.gif 239B
top_6.gif 214B
right_06.gif 211B
top_2.gif 211B
right_12.gif 200B
right_061.gif 195B
login-top-bg.gif 174B
Submit_bg.gif 171B
top_1.gif 146B
dialogclose.gif 114B
login-buttom-bg.gif 112B
main_29.gif 101B
main_27.gif 101B
main_32.gif 99B
mini_icons_046.gif 94B
plus.gif 89B
共 198 条
- 1
- 2
资源评论
JustWannaRun
- 粉丝: 10
- 资源: 36
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功