String partyAName=request.getParameter("partyAName");
String partyAAddress=request.getParameter("partyAAddress");
String partyBName=request.getParameter("partyBName");
String partybAddress=request.getParameter("partybAddress");
if(new TbContractDAO().add(new TbContract(contractCode,contractName,contractContent,startDateSigned,endDateSigned,partyAName,partyAAddress,partyBName,partybAddress,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbContractList",new TbContractDAO().getTbContractAll());
response.sendRedirect("ContractModule/TbContractList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delinForStringPrimaryKey("Tb_Contract", "ContractCode", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbContractList",new TbContractDAO().getTbContractAll());
response.sendRedirect("ContractModule/TbContractList.jsp");
}
if("edit".equals(method)){
String contractCode=request.getParameter("contractCode");
String contractName=request.getParameter("contractName");
String contractContent=request.getParameter("contractContent");
String startDateSigned=request.getParameter("startDateSigned");
String endDateSigned=request.getParameter("endDateSigned");
String partyAName=request.getParameter("partyAName");
String partyAAddress=request.getParameter("partyAAddress");
String partyBName=request.getParameter("partyBName");
String partybAddress=request.getParameter("partybAddress");
if(new TbContractDAO().edit(new TbContract(contractCode,contractName,contractContent,startDateSigned,endDateSigned,partyAName,partyAAddress,partyBName,partybAddress,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbContractList",new TbContractDAO().getTbContractAll());