package BranchesMgr.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import BranchesMgr.dao.BranchesDao;
import BranchesMgr.dao.CityAreaDao;
import BranchesMgr.dao.impl.BranchesDaoImpl;
import BranchesMgr.dao.impl.CityAreaDaoImpl;
import BranchesMgr.entity.Branches;
import BranchesMgr.entity.CityArea;
public class updateServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
String name=request.getParameter("name");
int cityid=Integer.parseInt(request.getParameter("city"));
String address=request.getParameter("address");
String telephone=request.getParameter("telephone");
Branches breach=new Branches();
breach.setName(name);
breach.setCityAreatyid(cityid);
breach.setAddress(address);
breach.setTelephone(telephone);
BranchesDao breadao=new BranchesDaoImpl();
int rel=breadao.UpdateBranches(breach);
if(rel>0){
out.print("<script>alert('修改成功!');location.href='BrancheseServlet';</script>");
}else{
out.print("<script>alert('修改失败!');location.href='BrancheseServlet';</script>");
}
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
银行营业网点管理系统——Servlet包(updateServlet )
原创
©著作权归作者所有:来自51CTO博客作者穆雄雄的博客的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章