if("add".equals(method)){
int userId=Integer.parseInt(request.getParameter("userId"));
int roleId=Integer.parseInt(request.getParameter("roleId"));
String createTime=request.getParameter("createTime");
if(new TbUserRoleMiddleDAO().add(new TbUserRoleMiddle(userId,roleId,createTime))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbUserRoleMiddleList",new TbUserRoleMiddleDAO().getTbUserRoleMiddleAll());
response.sendRedirect("TbuserrolemiddleModule/TbUserRoleMiddleList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("TbUserRoleMiddle", "UserRoleMiddleId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbUserRoleMiddleList",new TbUserRoleMiddleDAO().getTbUserRoleMiddleAll());
response.sendRedirect("TbuserrolemiddleModule/TbUserRoleMiddleList.jsp");
}
if("edit".equals(method)){
int userRoleMiddleId=Integer.parseInt(request.getParameter("userRoleMiddleId"));
int userId=Integer.parseInt(request.getParameter("userId"));
int roleId=Integer.parseInt(request.getParameter("roleId"));
String createTime=request.getParameter("createTime");
if(new TbUserRoleMiddleDAO().add(new TbUserRoleMiddle(userRoleMiddleId,userId,roleId,createTime))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbUserRoleMiddleList",new TbUserRoleMiddleDAO().getTbUserRoleMiddleAll());