📄 puserinfo.java
字号:
package thizlinux.linuxhr;import java.sql.*;import java.text.*;public class puserinfo { private String uid=""; private String name=""; private String gender=""; private String birthday=""; private String height=""; private String nation=""; private String hukou=""; private String idtype=""; private String idnum=""; private String martialstatus=""; private String health=""; private String salary=""; private String currency=""; private String yearsofwork=""; private String residency=""; private String hometel=""; private String worktel=""; private String mobile=""; private String email=""; private String address=""; private String postcode=""; private String school=""; private String major=""; private String degree=""; private String language=""; private int institute=0; private String error=""; private boolean status=true; public void setError(String value){ this.error=value; } public String getError(){ return this.error; } public void setInstitute(int value){ this.institute=value; } public int getInstitute(){ return this.institute; } public void setSchool(String value){ this.school=value; } public String getSchool(){ return this.school; } public void setMajor(String value){ this.major=value; } public String getMajor(){ return this.major; } public void setDegree(String value){ this.degree=value; } public String getDegree(){ return this.degree; } public void setLanguage(String value){ this.language=value; } public String getLanguage(){ return this.language; } public void setUid(String value){ this.uid=value; } public String getUid(){ return this.uid; } public void setName(String value){ this.name=value; } public String getName(){ return this.name; } public void setGender(String value){ this.gender=value; } public String getGender(){ return this.gender; } public void setBirthday(String value){ this.birthday=value; } public String getBirthday(){ return this.birthday; } public void setNation(String value){ this.nation=value; } public String getNation(){ return this.nation; } public void setHeight(String value){ this.height=value; } public String getHeight(){ return this.height; } public void setHukou(String value){ this.hukou=value; } public String getHukou(){ return this.hukou; } public void setIdtype(String value){ this.idtype=value; } public String getIdtype(){ return this.idtype; } public void setIdnum(String value){ this.idnum=value; } public String getIdnum(){ return this.idnum; } public void setMartialstatus(String value){ this.martialstatus=value; } public String getMartialstatus(){ return this.martialstatus; } public void setHealth(String value){ this.health=value; } public String getHealth(){ return this.health; } public void setSalary(String value){ this.salary=value; } public String getSalary(){ return this.salary; } public void setCurrency(String value){ this.currency=value; } public String getCurrency(){ return this.currency; } public void setYearsofwork(String value){ this.yearsofwork=value; } public String getYearsofwork(){ return this.yearsofwork; } public void setResidency(String value){ this.residency=value; } public String getResidency(){ return this.residency; } public void setHometel(String value){ this.hometel=value; } public String getHometel(){ return this.hometel; } public void setWorktel(String value){ this.worktel=value; } public String getWorktel(){ return this.worktel; } public void setMobile(String value){ this.mobile=value; } public String getMobile(){ return this.mobile; } public void setEmail(String value){ this.email=value; } public String getEmail(){ return this.email; } public void setAddress(String value){ this.address=value; } public String getAddress(){ return this.address; } public void setPostcode(String value){ this.postcode=value; } public String getPostcode(){ return this.postcode; } public void refresh(){ DBconnect dbconn =new DBconnect(); ResultSet rs=null; String sql=""; try{ sql="select name,gender,birthday,height,nation,hukou,"+ "idtype,idnum,martialstatus,health,salary,currency,yearsofwork,residency,"+ "hometel,worktel,mobile,email,address,postcode,school,major,degree,language from tbl_puserinfo "+ "where uid='" +this.uid+"'"; rs=dbconn.executeQuery(sql); if(rs.next()){ this.name=pub.datachange(rs.getString("name")); this.gender=pub.datachange(rs.getString("gender")); this.birthday=pub.datachange(rs.getString("birthday")); this.height=pub.datachange(rs.getString("height")); this.nation=pub.datachange(rs.getString("nation")); this.hukou=pub.datachange(rs.getString("hukou")); this.idtype=pub.datachange(rs.getString("idtype")); this.idnum=pub.datachange(rs.getString("idnum")); this.martialstatus=pub.datachange(rs.getString("martialstatus")); this.health=pub.datachange(rs.getString("health")); this.salary=pub.datachange(rs.getString("salary")); this.currency=pub.datachange(rs.getString("currency")); this.yearsofwork=pub.datachange(rs.getString("yearsofwork")); this.residency=pub.datachange(rs.getString("residency")); this.hometel=pub.datachange(rs.getString("hometel")); this.worktel=pub.datachange(rs.getString("worktel")); this.mobile=pub.datachange(rs.getString("mobile")); this.email=pub.datachange(rs.getString("email")); this.address=pub.datachange(rs.getString("address")); this.postcode=pub.datachange(rs.getString("postcode")); this.school=pub.datachange(rs.getString("school")); this.major=pub.datachange(rs.getString("major")); this.degree=pub.datachange(rs.getString("degree")); this.language=pub.datachange(rs.getString("language")); } }catch(Exception e){ System.out.println(e+",sql="+sql); status=false; }finally{ try{ if(rs!=null)rs.close(); if(dbconn!=null)dbconn.close(); }catch(Exception e){ System.out.println(e); } } } public boolean update(){ status=true; if(name==null||name.equalsIgnoreCase("")) { return false; } DBconnect dbconn =new DBconnect(); String sql=""; try{ sql = "delete from tbl_puserinfo where uid='" + this.uid + "'"; dbconn.executeUpdate(sql); sql="insert into tbl_puserinfo(uid,name,gender,birthday,height,nation,hukou,"+ "idtype,idnum,martialstatus,health,salary,currency,yearsofwork,residency,"+ "hometel,worktel,mobile,email,address,postcode,school,major,degree,institute,language) "+ "values('" +this.uid+"',"+ "'"+this.name+"',"+ "'"+this.gender+"',"+ "'"+this.birthday+"',"+ "'"+this.height+"',"+ "'"+this.nation+"',"+ "'"+this.hukou+"',"+ "'"+this.idtype+"',"+ "'"+this.idnum+"',"+ "'"+this.martialstatus+"',"+ "'"+this.health+"',"+ "'"+this.salary+"',"+ "'"+this.currency+"',"+ "'"+this.yearsofwork+"',"+ "'"+this.residency+"',"+ "'"+this.hometel+"',"+ "'"+this.worktel+"',"+ "'"+this.mobile+"',"+ "'"+this.email+"',"+ "'"+this.address+"',"+ "'"+this.postcode+"',"+ "'"+this.school+"',"+ "'"+this.major+"',"+ "'"+this.degree+"',"+ ""+this.institute+","+ "'"+this.language+"')"; dbconn.executeUpdate(sql); reset(); }catch(Exception e){ System.out.println(e+",sql="+sql); status=false; }finally{ try{ if(dbconn!=null)dbconn.close(); }catch(Exception e){ System.out.println(e); } } return status; } public void reset(){ uid=""; name=""; gender=""; birthday=""; height=""; nation=""; hukou=""; idtype=""; idnum=""; martialstatus=""; health=""; salary=""; currency=""; yearsofwork=""; residency=""; hometel=""; worktel=""; mobile=""; email=""; address=""; postcode=""; school=""; major=""; degree=""; language=""; institute=0; error=""; } public boolean remove(String userid){ status=true; DBconnect dbconn =new DBconnect(); String sql=""; try{ sql = "delete from tbl_puserinfo where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_pworkexp where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_pedu where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_ptrain where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_plang where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_pskill where uid='" + userid + "'"; dbconn.executeUpdate(sql); sql = "delete from tbl_pproj where uid='" + userid + "'"; dbconn.executeUpdate(sql); }catch(Exception e){ System.out.println(e+",sql="+sql); status=false; }finally{ try{ if(dbconn!=null)dbconn.close(); }catch(Exception e){ System.out.println(e); } } return status; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -