if("add".equals(method)){
String companyTypeName=request.getParameter("companyTypeName");
String companyTypeMemo=request.getParameter("companyTypeMemo");
String createTime=publicClass.decodeDate();
if(new TbCompanyTypeDAO().add(new TbCompanyType(companyTypeName,companyTypeMemo,createTime))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbCompanyTypeList",new TbCompanyTypeDAO().getTbCompanyTypeAll());
response.sendRedirect("CompanytypeModule/TbCompanyTypeList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_CompanyType", "CompanyTypeId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbCompanyTypeList",new TbCompanyTypeDAO().getTbCompanyTypeAll());
response.sendRedirect("CompanytypeModule/TbCompanyTypeList.jsp");
}
if("edit".equals(method)){
int companyTypeId=Integer.parseInt(request.getParameter("companyTypeId"));
String companyTypeName=request.getParameter("companyTypeName");
String companyTypeMemo=request.getParameter("companyTypeMemo");
String createTime=publicClass.decodeDate();
if(new TbCompanyTypeDAO().edit(new TbCompanyType(companyTypeId,companyTypeName,companyTypeMemo,createTime))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbCompanyTypeList",new TbCompanyTypeDAO().getTbCompanyTypeAll());