int departId=Integer.parseInt(request.getParameter("departId"));
int userId=Integer.parseInt(request.getParameter("userId"));
int isMaster=Integer.parseInt(request.getParameter("isMaster"));
String createTime=request.getParameter("createTime");
if(new TbDepartUserMiddleDAO().add(new TbDepartUserMiddle(departId,userId,isMaster,createTime))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbDepartUserMiddleList",new TbDepartUserMiddleDAO().getTbDepartUserMiddleAll());
response.sendRedirect("DepartusermiddleModule/TbDepartUserMiddleList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_DepartUserMiddle", "DepartUserMiddleId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbDepartUserMiddleList",new TbDepartUserMiddleDAO().getTbDepartUserMiddleAll());
response.sendRedirect("DepartusermiddleModule/TbDepartUserMiddleList.jsp");
}
if("edit".equals(method)){
int departUserMiddleId=Integer.parseInt(request.getParameter("departUserMiddleId"));
int departId=Integer.parseInt(request.getParameter("departId"));
int userId=Integer.parseInt(request.getParameter("userId"));
int isMaster=Integer.parseInt(request.getParameter("isMaster"));
String createTime=request.getParameter("createTime");
if(new TbDepartUserMiddleDAO().add(new TbDepartUserMiddle(departUserMiddleId,departId,userId,isMaster,createTime))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbDepartUserMiddleList",new TbDepartUserMiddleDAO().getTbDepartUserMiddleAll());