package com.mwq.frame.personnel;
// Download by http://www.codefans.net
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.net.URL;
import java.sql.Date;
import java.util.Enumeration;
import java.util.Iterator;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder;
import javax.swing.filechooser.FileFilter;
import com.mwq.frame.common.DeptTreeDialog;
import com.mwq.hibernate.Dao;
import com.mwq.hibernate.HibernateSessionFactory;
import com.mwq.hibernate.mapping.TbAccessionForm;
import com.mwq.hibernate.mapping.TbDept;
import com.mwq.hibernate.mapping.TbDuty;
import com.mwq.hibernate.mapping.TbDutyInfo;
import com.mwq.hibernate.mapping.TbNation;
import com.mwq.hibernate.mapping.TbNativePlace;
import com.mwq.hibernate.mapping.TbPersonalInfo;
import com.mwq.hibernate.mapping.TbRecord;
import com.mwq.tool.Today;
public class RecordOperatePanel extends JPanel {
private JTextField deptTextField;
private JComboBox accessionFormComboBox;
private JComboBox dutyComboBox;
private ButtonGroup partyMemberButtonGroup = new ButtonGroup();
private ButtonGroup marriagedButtonGroup = new ButtonGroup();
private ButtonGroup sexButtonGroup = new ButtonGroup();
private JComboBox schoolageComboBox;
private JComboBox nativePlaceComboBox;
private JComboBox nationComboBox;
private JTextField accumulationFundNOTextField;
private JTextField annuitySafetyNOTextField;
private JTextField pactEndDateTextField;
private JTextField dimissionReasonTextField;
private JTextField compoSafetyNOTextField;
private JTextField doleSafetyNOTextField;
private JTextField medicareSafetyNOTextField;
private JTextField societySafetyNOTextField;
private JTextField pactAgeTextField;
private JTextField bankNOTextField;
private JTextField pactStartDateTextField;
private JTextField dimissionDateTextField;
private JTextField bankNameTextField;
private JTextField firstPactDateTextField;
private JTextField accessionDateTextField;
private JTextField homeAddressTextField;
private JTextField onesStrongSuitTextField;
private JTextField likeTextField;
private JTextField homePostalcodeTextField;
private JTextField partyMemberDateTextField;
private JTextField graduateSchoolTextField;
private JTextField graduateDateTextField;
private JTextField secondSpecialtyTextField;
private JTextField secondSchoolageTextField;
private JTextField computerTextField;
private JTextField emailTextField;
private JTextField qqTextField;
private JTextField telephoneTextField;
private JTextField handsetTextField;
private JTextField addressTextField;
private JTextField postalcodeTextField;
private JTextField gradeTextField;
private JTextField specialtyTextField;
private JTextField foreignLanguageTextField;
private JTextField idCardTextField;
private JTextField partyMemberTextField;
private JTextField birthdayTextField;
private JTextField nameTextField;
private JTextField recordNoTextField;
private JLabel photoLabel;
private Dao dao = Dao.getInstance();
public static TbRecord UPDATE_RECORD = null;
/**
* Create the panel
*/
public RecordOperatePanel(final JPanel rightPanel) {
super();
setLayout(new BorderLayout());
final JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(Color.WHITE);
add(buttonPanel, BorderLayout.NORTH);
final JButton saveButton = new JButton();
saveButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// 获取档案信息
TbRecord record = null;
if (UPDATE_RECORD == null) {
record = new TbRecord();
} else {
record = (TbRecord) dao.queryRecordByNum(recordNoTextField
.getText());
}
record.setRecordNumber(recordNoTextField.getText());
record.setName(nameTextField.getText());
Enumeration<AbstractButton> sexElements = sexButtonGroup
.getElements();
while (sexElements.hasMoreElements()) {
AbstractButton button = sexElements.nextElement();
if (button.isSelected()) {
record.setSex(button.getText());
break;
}
}
TbNation nation = (TbNation) dao
.queryNationByName(nationComboBox.getSelectedItem()
.toString());
record.setTbNation(nation);
TbNativePlace nativePlace = (TbNativePlace) dao
.queryNativePlaceByName(nativePlaceComboBox
.getSelectedItem().toString());
record.setTbNativePlace(nativePlace);
record.setIdCard(idCardTextField.getText());
record.setSchoolAge(schoolageComboBox.getSelectedItem()
.toString());
record.setSpecialty(specialtyTextField.getText());
Enumeration<AbstractButton> partyMembers = partyMemberButtonGroup
.getElements();
while (partyMembers.hasMoreElements()) {
AbstractButton button = partyMembers.nextElement();
if (button.isSelected()) {
record.setPartyMember(button.getText().trim());
break;
}
}
record.setForeignLanguage(foreignLanguageTextField.getText());
record.setGrade(gradeTextField.getText());
Enumeration<AbstractButton> marriagedElements = marriagedButtonGroup
.getElements();
while (marriagedElements.hasMoreElements()) {
AbstractButton button = marriagedElements.nextElement();
if (button.isSelected()) {
record.setMarriaged(button.getText());
break;
}
}
record.setPostalcode(postalcodeTextField.getText());
record.setAddress(addressTextField.getText());
// 验证档案信息
Method[] methods = record.getClass().getMethods();
String recordMethodNames[] = { "name", "sex", "tbNation",
"tbNativePlace;", "idCard", " schoolAge", " specialty",
" partyMember", " foreignLanguage", " grade",
"marriaged", " postalcode", "address" };
for (int i = 0; i < methods.length; i++) {
String methodName = methods[i].getName();
if (methodName.startsWith("get")) {
for (int m = 0; m < recordMethodNames.length; m++) {
if (methodName.substring(3).toLowerCase().equals(
recordMethodNames[m].toLowerCase())) {
Object object = null;
try {
object = methods[i].invoke(record, null);
} catch (Exception e) {
e.printStackTrace();
}
if (object == null) {
System.out.println(methods[i].getName()
+ "=" + object);
JOptionPane.showMessageDialog(null,
"除照片外,[档案信息]栏的其他项均不允许为空!", "友情提示",
JOptionPane.WARNING_MESSAGE);
return;
}
}
}
}
}
String myBirthday = birthdayTextField.getText();
if (myBirthday.equals("YYYY-MM-DD")) {
JOptionPane.showMessageDialog(null, "请输入出生日期!", "友情提示",
JOptionPane.WARNING_MESSAGE);
return;
} else {
try {
Date birthday = Date.valueOf(myBirthday);
record.setBirthday(birthday);
} catch (Runtime
没有合适的资源?快使用搜索试试~ 我知道了~
基于java的开发源码-企业人事管理系统源码.zip
共84个文件
java:44个
xml:18个
jpg:12个
0 下载量 147 浏览量
2024-02-29
21:07:25
上传
评论
收藏 907KB ZIP 举报
温馨提示
基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip 基于java的开发源码-企业人事管理系统源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于java的开发源码-企业人事管理系统源码.zip (84个子文件)
codefans.net
企业人事管理系统_03
数据库建模
复件 PersonnelManage.pdm 126KB
复件 PersonnelManage.pdb 126KB
readme.doc 730KB
Database
personnel_manage.dmp 22KB
PersonnelManage
.classpath 397B
src
img
rewAndPun.JPG 3KB
tree.JPG 5KB
logo.JPG 4KB
stat.JPG 3KB
back.JPG 35KB
timecard.JPG 3KB
password.JPG 3KB
data.JPG 3KB
exit.JPG 2KB
excel.JPG 2KB
record.JPG 2KB
calculator.JPG 3KB
personnel_photo
hibernate.cfg.xml 3KB
office
new.doc 19KB
new.xls 14KB
com
mwq
tool
Today.java 655B
mwing
MTable.java 578B
PersonnelManage.java 1KB
hibernate
HibernateSessionFactory.java 1KB
mapping
TbRewardsAndPunishment.hbm.xml 2KB
TbPersonalInfo.java 3KB
TbManager.hbm.xml 973B
TbBringUpContent.hbm.xml 2KB
TbReckoningList.java 756B
TbPersonalInfo.hbm.xml 2KB
TbNation.java 554B
TbBringUpOntent.java 771B
TbRewardsAndPunishment.java 2KB
TbTimecard.java 2KB
TbNativePlace.java 525B
TbManager.java 982B
TbDutyInfo.hbm.xml 3KB
TbNation.hbm.xml 544B
TbReckoningList.hbm.xml 819B
TbReckoning.java 1KB
TbAccountItem.java 2KB
TbDutyInfo.java 4KB
TbReckoningInfo.hbm.xml 899B
TbRecord.hbm.xml 5KB
TbDuty.hbm.xml 537B
TbBringUpContent.java 2KB
TbTimecard.hbm.xml 2KB
TbAccessionForm.java 1KB
TbAccountItem.hbm.xml 925B
TbDuty.java 2KB
TbDept.java 1KB
TbReckoning.hbm.xml 1KB
TbBringUpOntent.hbm.xml 799B
TbNativePlace.hbm.xml 555B
TbRecord.java 7KB
TbReckoningInfo.java 923B
TbAccessionForm.hbm.xml 559B
TbDept.hbm.xml 999B
Dao.java 5KB
BaseDao.java 3KB
frame
personnel
BringUpOperatePanel.java 17KB
TimecardPanel.java 17KB
RewardsAndPunishmentPanel.java 20KB
BringUpSelectedPanel.java 3KB
RecordOperatePanel.java 68KB
RecordSelectedPanel.java 3KB
treatement
ReportFormsPanel.java 16KB
PersonnelSetPanel.java 13KB
AddAccountItemDialog.java 4KB
CreateCriterionSetDialog.java 4KB
CriterionSetPanel.java 22KB
user
UpdatePasswordDialog.java 6KB
AddUserPanel.java 7KB
common
DeptAndPersonnelDialog.java 3KB
DeptAndPersonnelPanel.java 6KB
DeptTreeDialog.java 3KB
system
AddAccountItemDialog.java 7KB
DataPanel.java 12KB
FrameworkPanel.java 10KB
IndexFrame.java 18KB
LandFrame.java 7KB
.myhibernatedata 436B
.project 725B
.fatjar 489B
共 84 条
- 1
资源评论
快乐无限出发
- 粉丝: 1206
- 资源: 7390
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功