String projectAcceptanceTime=request.getParameter("projectAcceptanceTime");
String contractCode=request.getParameter("contractCode");
String projectManager=request.getParameter("projectManager");
String tempProjectGroupCode=request.getParameter("tempProjectGroupCode");
if(new TbProjectDAO().add(new TbProject(projectCode,projectName,projectStartTime,projectEndTime,projectAcceptanceTime,contractCode,projectManager,tempProjectGroupCode))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbProjectList",new TbProjectDAO().getTbProjectAll());
response.sendRedirect("ProjectModule/TbProjectList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_Project", "ProjectId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbProjectList",new TbProjectDAO().getTbProjectAll());
response.sendRedirect("ProjectModule/TbProjectList.jsp");
}
if("edit".equals(method)){
int projectId=Integer.parseInt(request.getParameter("projectId"));
String projectCode=request.getParameter("projectCode");
String projectName=request.getParameter("projectName");
String projectStartTime=request.getParameter("projectStartTime");
String projectEndTime=request.getParameter("projectEndTime");
String projectAcceptanceTime=request.getParameter("projectAcceptanceTime");
String contractCode=request.getParameter("contractCode");
String projectManager=request.getParameter("projectManager");
String tempProjectGroupCode=request.getParameter("tempProjectGroupCode");
if(new TbProjectDAO().edit(new TbProject(projectId,projectCode,projectName,projectStartTime,projectEndTime,projectAcceptanceTime,contractCode,projectManager,tempProjectGroupCode))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbProjectList",new TbProjectDAO().getTbProjectAll());