⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 personnel.java

📁 本系统是一套基于WEB的软件平台。借助于现代信息技术手段
💻 JAVA
字号:
package JXC.web;
import JXC.Com.DBConnect;
import java.lang.String;
import JXC.util.StrFun;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
 * Title:       明细单信息
 * Description:
 * Copyright:    Copyright (c) 2003
 * Company:      torch
 * @author:		 wind
 * @version 1.0
 */
public class personnel{
  private int id;
  private String bh;
  private String name;
  private String sex;
  private String birthday;
  private String workday;
  private String post;
  private String business;
  private String diploma;
  private String pay;
  private String department;
  private String card;
  private String memo;
  public void personnel(){}
  public int  getId() {
    return id;
  }
  public void setId(int anew) {
    this.id=anew;
  }
  public void setId(String anew) {
     if (anew!=null)
    this.id=Integer.parseInt(anew);
  }
  public String  getBh() {
    return bh;
  }
  public void setBh(String anew) {
    this.bh=anew;
  }
  public String  getName() {
    return name;
  }
  public void setName(String anew) {
    this.name=anew;
  }
  public String  getSex() {
    return sex;
  }
  public void setSex(String anew) {
    this.sex=anew;
  }
  public String  getBirthday() {
    return birthday;
  }
  public void setBirthday(String anew) {
    this.birthday=anew;
  }
  public String  getWorkday() {
    return workday;
  }
  public void setWorkday(String anew) {
    this.workday=anew;
  }
  public String  getPost() {
    return post;
  }
  public void setPost(String anew) {
    this.post=anew;
  }
  public String  getBusiness() {
    return business;
  }
  public void setBusiness(String anew) {
    this.business=anew;
  }
  public String  getDiploma() {
    return diploma;
  }
  public void setDiploma(String anew) {
    this.diploma=anew;
  }
  public String  getPay() {
    return pay;
  }
  public void setPay(String anew) {
    this.pay=anew;
  }
  public String  getDepartment() {
    return department;
  }
  public void setDepartment(String anew) {
    this.department=anew;
  }
  public String  getCard() {
    return card;
  }
  public void setCard(String anew) {
    this.card=anew;
  }
  public String  getMemo() {
    return memo;
  }
  public void setMemo(String anew) {
    this.memo=anew;
  }
  public boolean excute() throws Exception {
	   String Str="Select * From personnel where Id="+id;
    try {
	   DBConnect dbc  = new DBConnect(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
	   ResultSet rs = dbc.executeQuery(Str);
    if (rs.next()){
     id=rs.getInt("id"); 
     bh=rs.getString("bh"); 
     name=rs.getString("name"); 
     sex=rs.getString("sex"); 
     birthday=rs.getString("birthday"); 
     workday=rs.getString("workday"); 
     post=rs.getString("post"); 
     business=rs.getString("business"); 
     diploma=rs.getString("diploma"); 
     pay=rs.getString("pay"); 
     department=rs.getString("department"); 
     card=rs.getString("card"); 
     memo=rs.getString("memo"); 
	  }
    rs.close();
    dbc.close();
    return true;
    }
    catch (SQLException sqle){
	    return false;
    }
  } 
  public void Edit(HttpServletRequest request) throws Exception {
   id=StrFun.getInt(request,"id"); 
   bh=StrFun.getString(request,"bh"); 
   name=StrFun.getString(request,"name"); 
   sex=StrFun.getString(request,"sex"); 
   birthday=StrFun.getString(request,"birthday"); 
   workday=StrFun.getString(request,"workday"); 
   post=StrFun.getString(request,"post"); 
   business=StrFun.getString(request,"business"); 
   diploma=StrFun.getString(request,"diploma"); 
   pay=StrFun.getString(request,"pay"); 
   department=StrFun.getString(request,"department"); 
   card=StrFun.getString(request,"card"); 
   memo=StrFun.getString(request,"memo"); 
   String Str="Update personnel set bh='"+bh+"' ,name='"+name+"' ,sex='"+sex+"' ,birthday='"+birthday+"' ,workday='"+workday+"' ,post='"+post+"' ,business='"+business+"' ,diploma='"+diploma+"' ,pay='"+pay+"' ,department='"+department+"' ,card='"+card+"' ,memo='"+memo+"'  where id="+id;
   DBConnect dbc  = new DBConnect();
   dbc.executeUpdate(Str);
   dbc.close();
    }
  public void Add(HttpServletRequest request) throws Exception {
   bh=StrFun.getString(request,"bh"); 
   name=StrFun.getString(request,"name"); 
   sex=StrFun.getString(request,"sex"); 
   birthday=StrFun.getString(request,"birthday"); 
   workday=StrFun.getString(request,"workday"); 
   post=StrFun.getString(request,"post"); 
   business=StrFun.getString(request,"business"); 
   diploma=StrFun.getString(request,"diploma"); 
   pay=StrFun.getString(request,"pay"); 
   department=StrFun.getString(request,"department"); 
   card=StrFun.getString(request,"card"); 
   memo=StrFun.getString(request,"memo"); 
   String Str="Insert into personnel(bh,name,sex,birthday,workday,post,business,diploma,pay,department,card,memo) values('"+bh+"','"+name+"','"+sex+"','"+birthday+"','"+workday+"','"+post+"','"+business+"','"+diploma+"','"+pay+"','"+department+"','"+card+"','"+memo+"')";
   DBConnect dbc  = new DBConnect();
   dbc.executeUpdate(Str);
   dbc.close();
    }
  public void Del() throws Exception {
    String Str="Delete From personnel where Id="+id;
    DBConnect dbc  = new DBConnect();
    dbc.executeUpdate(Str);
    dbc.close();
   }

  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -