文章目录
- (43)Check_in
- (44)DaoData
- (45)Department
- (46)Duty
- (47)Employee
- (48)Grade
- (49)Money
- (50) Paper
- (51)RecruitPlan
- (52)SetPaper
- (53)User
- (54)EmployeeFile
- (55)FillComboBox
- (56)PaperTest
- 注:代码量>1万。
(43)Check_in
package com.employee.model;public class Check_in {private int jobNum;private String name;private String type;private String date;public int getJobNum() {return jobNum;}public void setJobNum(int jobNum) {this.jobNum = jobNum;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getType() {return type;}public void setType(String type) {this.type = type;}public String getDate() {return date;}public void setDate(String date) {this.date = date;}}
(44)DaoData
package com.employee.model;public class DaoData {private String url="jdbc:mysql://localhost:3306/employeeManage?useUnicode=true&characterEncoding=utf-8";private String DRAVER="com.mysql.jdbc.Driver";private String name="root";private String password="root";public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}public String getDRAVER() {return DRAVER;}public void setDRAVER(String dRAVER) {DRAVER = dRAVER;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}}
(45)Department
package com.employee.model;public class Department {private int nameMark;private String name;private String establishPerson;public int getNameMark() {return nameMark;}public void setNameMark(int nameMark) {this.nameMark = nameMark;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getEstablishPerson() {return establishPerson;}public void setEstablishPerson(String establishPerson) {this.establishPerson = establishPerson;}}
(46)Duty
package com.employee.model;public class Duty {private int dutyNum;private String dutyName;private String department;public int getDutyNum() {return dutyNum;}public void setDutyNum(int dutyNum) {this.dutyNum = dutyNum;}public String getDutyName() {return dutyName;}public void setDutyName(String dutyName) {this.dutyName = dutyName;}public String getDepartment() {return department;}public void setDepartment(String department) {this.department = department;}}
(47)Employee
package com.employee.model;public class Employee {private String department;public String getDepartment() {return department;}public void setDepartment(String department) {this.department = department;}private int id;public int getId() {return id;}public void setId(int id) {this.id = id;}private double jobNum;private String name;private String sex;private int age;private String birthDay; private String address;private String race;private String marriage;private String politicState;private double phoneNum;private double id_card;private String collage;private String major;private String cultureStandard;private String jobTime;private Double creditNum;private String profesion;private String status;private String signTime;private String registrant;private String imagePath;private String curriculum; public String getImagePath() {return imagePath;}public void setImagePath(String imagePath) {this.imagePath = imagePath;}public String getCurriculum() {return curriculum;}public void setCurriculum(String curriculum) {this.curriculum = curriculum;}public double getJobNum() {return jobNum;}public void setJobNum(double jobNum) {this.jobNum = jobNum;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSex() {return sex;}public void setSex(String sex) {this.sex = sex;}public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String getBirthDay() {return birthDay;}public void setBirthDay(String birthDay) {this.birthDay = birthDay;}public String getAddress() {return address;}public void setAddress(String address) {this.address = address;}public String getRace() {return race;}public void setRace(String race) {this.race = race;}public String getMarriage() {return marriage;}public void setMarriage(String marriage) {this.marriage = marriage;}public String getPoliticState() {return politicState;}public void setPoliticState(String politicState) {this.politicState = politicState;}public void setPhoneNum(int phoneNum) {this.phoneNum = phoneNum;}public double getPhoneNum() {return phoneNum;}public void setPhoneNum(double phoneNum) {this.phoneNum = phoneNum;}public double getId_card() {return id_card;}public void setId_card(double id_card) {this.id_card = id_card;}public void setId_card(int id_card) {this.id_card = id_card;}public String getCollage() {return collage;}public void setCollage(String collage) {this.collage = collage;}public String getMajor() {return major;}public void setMajor(String major) {this.major = major;}public String getCultureStandard() {return cultureStandard;}public void setCultureStandard(String cultureStandard) {this.cultureStandard = cultureStandard;}public String getJobTime() {return jobTime;}public void setJobTime(String jobTime) {this.jobTime = jobTime;}public Double getCreditNum() {return creditNum;}public void setCreditNum(Double creditNum) {this.creditNum = creditNum;}public String getProfesion() {return profesion;}public void setProfesion(String profesion) {this.profesion = profesion;}public String getStatus() {return status;}public void setStatus(String status) {this.status = status;}public String getSignTime() {return signTime;}public void setSignTime(String signTime) {this.signTime = signTime;}public String getRegistrant() {return registrant;}public void setRegistrant(String registrant) {this.registrant = registrant;}}
(48)Grade
package com.employee.model;public class Grade {private int id;private int jobNum;private String name;private int score;public int getId() {return id;}public void setId(int id) {this.id = id;}public int getJobNum() {return jobNum;}public void setJobNum(int jobNum) {this.jobNum = jobNum;}public String getName() {return name;}public void setName(String name) {this.name = name;}public int getScore() {return score;}public void setScore(int score) {this.score = score;}}
(49)Money
package com.employee.model;public class Money {private double jobNum;private String name;public double getJobNum() {return jobNum;}public void setJobNum(double jobNum) {this.jobNum = jobNum;}public String getName() {return name;}public void setName(String name) {this.name = name;}public float getSalary() {return salary;}public void setSalary(float salary) {this.salary = salary;}public float getGradeMoney() {return gradeMoney;}public void setGradeMoney(float gradeMoney) {this.gradeMoney = gradeMoney;}public float getEffectMoney() {return effectMoney;}public void setEffectMoney(float effectMoney) {this.effectMoney = effectMoney;}public float getCheckAdd() {return checkAdd;}public void setCheckAdd(float checkAdd) {this.checkAdd = checkAdd;}public float getCheckDec() {return checkDec;}public void setCheckDec(float checkDec) {this.checkDec = checkDec;}public float getCultureMoney() {return cultureMoney;}public void setCultureMoney(float cultureMoney) {this.cultureMoney = cultureMoney;}private float salary;private float gradeMoney;private float effectMoney;private float checkAdd;private float checkDec;private float cultureMoney;}
(50) Paper
package com.employee.model;public class Paper {private int id;public int getId() {return id;}public void setId(int id) {this.id = id;}public String getTopic() {return topic;}public void setTopic(String topic) {this.topic = topic;}public String getA() {return a;}public void setA(String a) {this.a = a;}public String getB() {return b;}public void setB(String b) {this.b = b;}public String getC() {return c;}public void setC(String c) {this.c = c;}public String getD() {return d;}public void setD(String d) {this.d = d;}public String getAnswer() {return answer;}public void setAnswer(String answer) {this.answer = answer;}private String topic;private String a;private String b;private String c;private String d;private String answer;}
(51)RecruitPlan
package com.employee.model;public class RecruitPlan {private String dutyName;private String partName;private String dliploma;private int num;private String process;public String getDutyName() {return dutyName;}public void setDutyName(String dutyName) {this.dutyName = dutyName;}public String getPartName() {return partName;}public void setPartName(String partName) {this.partName = partName;}public String getDliploma() {return dliploma;}public void setDliploma(String dliploma) {this.dliploma = dliploma;}public int getNum() {return num;}public void setNum(int num) {this.num = num;}public String getProcess() {return process;}public void setProcess(String process) {this.process = process;}}
(52)SetPaper
package com.employee.model;public class SetPaper {private int id;public int getId() {return id;}public void setId(int id) {this.id = id;}private int paperNum;private int paperTime;public int getPaperNum() {return paperNum;}public void setPaperNum(int paperNum) {this.paperNum = paperNum;}public int getPaperTime() {return paperTime;}public void setPaperTime(int paperTime) {this.paperTime = paperTime;}}
(53)User
package com.employee.model;public class User {private int account;private String name;private String password;private double phone;public int getAccount() {return account;}public void setAccount(int account) {this.account = account;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public double getPhone() {return phone;}public void setPhone(double phone) {this.phone = phone;}}
(54)EmployeeFile
package com.employee.operate;import java.sql.ResultSet;
import java.sql.SQLException;import javax.swing.ImageIcon;
import javax.swing.JOptionPane;import com.employee.dao.Dao;
import com.employee.frame.EmployeeInfoF;
import com.employee.frame.EmployeeInfoF2;
import com.employee.frame.EmployeeInfoFShow;
import com.employee.model.Employee;public class EmployeeFile {public static String imagePath;public static void showD(int index) {String sql="select * from employeeFileTemp where id=?";Employee emp=new Employee();emp.setId(index);try {ResultSet rs=Dao.searchAppli(emp, sql);while(rs.next()) {EmployeeInfoFShow.comboType.setSelectedItem(rs.getString("profesion"));EmployeeInfoFShow.nameField.setText(rs.getString("name"));EmployeeInfoFShow.ageField.setText(String.valueOf(rs.getInt("age")));EmployeeInfoFShow.birthDayField.setText(String.valueOf(rs.getString("birthDay")));EmployeeInfoFShow.addressField.setText(rs.getString("address"));EmployeeInfoFShow.comborace.setSelectedItem(rs.getString("race"));EmployeeInfoFShow.phoneNumField.setText(String.valueOf(rs.getDouble("phoneNum")));EmployeeInfoFShow.collageField.setText(rs.getString("collage"));EmployeeInfoFShow.majorField.setText(rs.getString("major"));EmployeeInfoFShow.jobTimeField.setText(rs.getString("jobTime"));EmployeeInfoFShow.id_cardField.setText(String.valueOf(rs.getDouble("id_Card")));EmployeeInfoFShow.creditNumField.setText(String.valueOf(rs.getString("creditNum")));EmployeeInfoFShow.textArea.setText((rs.getString("curriculum")));EmployeeInfoFShow. image.setIcon(new ImageIcon(rs.getString("imagePath")));EmployeeFile.imagePath=rs.getString("imagePath");if(rs.getString("sex").equals("男")) {EmployeeInfoFShow.manBtn.setSelected(true);}else {EmployeeInfoFShow.femalBtn.setSelected(true);}if(rs.getString("marriage").equals("是")) {EmployeeInfoFShow.yesBtn.setSelected(true);}else {EmployeeInfoFShow.noBtn.setSelected(true);}}} catch (SQLException e) {e.printStackTrace();}}public static void showEmpAData(int index) {String sql="select * from employeeFile where id=?";Employee emp=new Employee();emp.setId(index);try {ResultSet rs=Dao.searchAppli(emp, sql);while(rs.next()) {EmployeeInfoF.jobNumField.setText(String.valueOf(rs.getInt("jobNum")));EmployeeInfoF.nameField.setText(rs.getString("name"));if(rs.getString("sex").equals("男")) {EmployeeInfoF.manBtn.setSelected(true);}else {EmployeeInfoF.femalBtn.setSelected(true);}EmployeeInfoF.ageField.setText(String.valueOf(rs.getInt("age")));EmployeeInfoF.birthDayField.setText(String.valueOf(rs.getString("birthDay")));EmployeeInfoF.addressField.setText(rs.getString("address"));EmployeeInfoF.raceField.setSelectedItem(rs.getString("race"));if(rs.getString("marriage").equals("是")) {EmployeeInfoF.yesBtn.setSelected(true);}else {EmployeeInfoF.noBtn.setSelected(true);}EmployeeInfoF.politcCombo.setSelectedItem(rs.getString("politicStatus"));EmployeeInfoF.phoneField.setText(String.valueOf(rs.getDouble("phoneNum")));EmployeeInfoF.id_cardField.setText(String.valueOf(rs.getDouble("id_Card")));EmployeeInfoF.collageField.setText(rs.getString("collage"));EmployeeInfoF.majorField.setText(rs.getString("major"));EmployeeInfoF.cultureCombo.setSelectedItem(rs.getString("cultureStandard"));EmployeeInfoF.jobTime.setText(rs.getString("jobTime"));EmployeeInfoF.creditNumField.setText(String.valueOf(rs.getString("creditNum")));EmployeeInfoF.profesionCombo.setSelectedItem(rs.getString("profesion"));EmployeeInfoF.statusCombo.setSelectedItem(rs.getString("status"));EmployeeInfoF.signTimeField.setText(rs.getString("signTime"));EmployeeInfoF.regesField.setText(rs.getString("registrant"));EmployeeInfoF.imagePath.setIcon(new ImageIcon(rs.getString("imagePath")));EmployeeInfoF.textArea.setText(rs.getString("curriculum"));EmployeeInfoF.departCombo.setSelectedItem(rs.getString("department"));}} catch (SQLException e) {e.printStackTrace();}}}
(55)FillComboBox
package com.employee.operate;import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;import javax.swing.JComboBox;import com.employee.dao.Dao;
import com.employee.frame.AddDutyDialog;public class FillComboBox {public static void fillPartBox(JComboBox comboBox) {List<String>list=new LinkedList<>();String sql="select * from department";try {ResultSet rs=Dao.allData(sql);while(rs.next()) {list.add(rs.getString("name"));}} catch (SQLException e) {e.printStackTrace();}for(int i=0;i<list.size();i++) {comboBox.addItem(list.get(i));}}public static void fillDutyBox(JComboBox comboBox) {List<String>list=new LinkedList<>();String sql="select * from duty";try {ResultSet rs=Dao.allData(sql);while(rs.next()) {list.add(rs.getString("dutyName"));}} catch (SQLException e) {e.printStackTrace();}for(int i=0;i<list.size();i++) {comboBox.addItem(list.get(i));}}}
(56)PaperTest
package com.employee.operate;import java.sql.ResultSet;
import java.sql.SQLException;import com.employee.dao.Dao;
import com.employee.frame.testPaper;
import com.employee.model.Paper;public class PaperTest {public static void fillPaper(Paper paper) {String sql="select * from paper where id=?";try {ResultSet rs=Dao.searchPaper(paper, sql);while(rs.next()) {testPaper.topicField.setText(rs.getString("topic"));testPaper.aField.setText(rs.getString("A"));testPaper.bField.setText(rs.getString("B"));testPaper.cField.setText(rs.getString("C"));testPaper.dField.setText(rs.getString("D"));}} catch (SQLException e) {e.printStackTrace();}}}
注:代码量>1万。