博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POS管理系统之设备出库
阅读量:4306 次
发布时间:2019-06-06

本文共 3515 字,大约阅读时间需要 11 分钟。

JSP:

<html>

  <head>
    <title>登录</title>
   <style type="text/css">
       table{
         color: blue;
         font-weight: bold;
         text-align: center;
         border-color: #C1DCF9;
       }
    </style>
  </head>
 
  <body>
    <form action="<%=request.getContextPath()%>/equipOut.do" method="post">
    <table border="1">
      <tr>
       <td>客户编号</td>
       <td><input type="text" name="userno"></td>
       <td>客户名称</td>
       <td><input type="text" name="username"></td>
      </tr>
      <tr>
         <td>经办人</td>
         <td><input type="text" name="people"></td>
         <td>出库日期</td>
         <td><input type="text" name="date"></td>
      </tr>
      <tr>
          <td>设备编号</td>
       <td>设备种类</td>
       <td>备注</td>
       <td>操作</td>
      </tr>
      <tr>
          <td><input type="text" name="equipno"/></td>
                <td></td>
                <td><input type="text" name="beizhu"></td>
                <td><a href="#">删除</a></td>
      </tr>
      <tr>
           <td colspan="3"></td>
           <td><a href="#">添加</a></td>
      </tr>
      <tr>
           <td colspan="4" class="a"><input type="submit" value="保存">
           </td>
      </tr>
     </table>
    </form>
  
  </body>
</html>

DAO:

public class EquipOutDao extends BaseDao{

    public int insertout(EquipOut e){
     String select="insert into outku values(?,?,?,?,?,?)";
     List<Object> params=new ArrayList<Object>();
     params.add(e.getUserno());
        params.add(e.getUsername());
        params.add(e.getPeople());
        params.add(e.getOutdate());
        params.add(e.getEquipno());
        params.add(e.getBeizhu());
     return this.executeUpdate(select, params);
    }
}

实体类:

public class EquipOut {

 private String userno;
 private String username;
 private String people;
 private String outdate;
 private String equipno;
 private String beizhu;
public String getUserno() {
 return userno;
}
public void setUserno(String userno) {
 this.userno = userno;
}
public String getUsername() {
 return username;
}
public void setUsername(String username) {
 this.username = username;
}
public String getPeople() {
 return people;
}
public void setPeople(String people) {
 this.people = people;
}
public String getOutdate() {
 return outdate;
}
public void setOutdate(String outdate) {
 this.outdate = outdate;
}
public String getEquipno() {
 return equipno;
}
public void setEquipno(String equipno) {
 this.equipno = equipno;
}
public String getBeizhu() {
 return beizhu;
}
public void setBeizhu(String beizhu) {
 this.beizhu = beizhu;
}
public EquipOut(String userno, String username, String people, String outdate,
  String equipno, String beizhu) {
 super();
 this.userno = userno;
 this.username = username;
 this.people = people;
 this.outdate = outdate;
 this.equipno = equipno;
 this.beizhu = beizhu;
}
public EquipOut() {
 super();
 // TODO Auto-generated constructor stub
}

SERVICE:

public class EquipOutService {

  EquipOutDao eod=new EquipOutDao();
  public int insertout(EquipOut e){
   return eod.insertout(e);
  }
}

SERVLET:

public class EquipOutServlet extends HttpServlet {

 @Override

 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException {
  
  doPost(req, resp);
 }

 @Override

 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException {
  req.setCharacterEncoding("utf-8");
  String userno=req.getParameter("userno");
  String username=req.getParameter("username");
  String people=req.getParameter("people");
  String outdate=req.getParameter("outdate");
  String equipno=req.getParameter("equipno");
  String beizhu=req.getParameter("beizhu");
  EquipOutService eos=new EquipOutService();
  EquipOut eo=new EquipOut(userno, username, people, outdate, equipno, beizhu);
     int a=eos.insertout(eo);
     if(a>0){
      resp.sendRedirect(req.getContextPath()+"/tiaozhuan/Success.jsp");
     }else{
      resp.sendRedirect("");
     }
 }

}

转载于:https://www.cnblogs.com/fanweichao/p/3931506.html

你可能感兴趣的文章
Laravel 的生命周期
查看>>
CentOS Docker 安装
查看>>
Nginx
查看>>
Navicat远程连接云主机数据库
查看>>
Nginx配置文件nginx.conf中文详解(总结)
查看>>
Mysql出现Table 'performance_schema.session_status' doesn't exist
查看>>
MySQL innert join、left join、right join等理解
查看>>
vivado模块封装ip/edf
查看>>
sdc时序约束
查看>>
Xilinx Jtag Access/svf文件/BSCANE2
查看>>
NoC片上网络
查看>>
开源SoC整理
查看>>
【2020-3-21】Mac安装Homebrew慢,解决办法
查看>>
influxdb 命令行输出时间为 yyyy-MM-dd HH:mm:ss(年月日时分秒)的方法
查看>>
已知子网掩码,确定ip地址范围
查看>>
判断时间或者数字是否连续
查看>>
docker-daemon.json各配置详解
查看>>
Docker(一)使用阿里云容器镜像服务
查看>>
Docker(三) 构建镜像
查看>>
Spring 全家桶注解一览
查看>>