團隊名稱、團隊成員介紹
1.1 團隊名稱
1.2 團隊成員
李曉冬 網絡1514 201521123113 組長
龔廈彬 網絡1514 201521123115 組員
2.項目git地址
https://git.oschina.net/lxdong/javakechengsheji.git
3.項目git提交記錄截圖(要體現出每個人的提交記錄、提交說明),老師將點擊進去重點考核。
4.項目功能架構圖與主要功能流程圖
5.項目運行截圖
界面
密碼輸入錯誤時
查詢信息
增添信息
修改信息
刪除信息
6.項目關鍵代碼
界面
private void LoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoginActionPerformed
String user = Username.getText().trim();
@SuppressWarnings("deprecation")
String pass = Password.getText();
if(user.length() == 0){
JOptionPane.showMessageDialog(null, "用戶名不能為空");
}
else if(pass.length() == 0){
JOptionPane.showMessageDialog(null, "密碼不能為空");
}
else if(user.equals("admin")&&pass.equals("123456")){
AdminFrame L1 = new AdminFrame();
L1.setVisible(true);
this.setVisible(false);
}
else if(user.equals("113")&&pass.equals("123456")){
StuFrame L = new StuFrame();
L.setVisible(true);
this.setVisible(false);
}
else{
JOptionPane.showMessageDialog(null, "登錄失敗 請重新登錄");
Username.setText("");
Password.setText("");
}
查詢
private void SearchButActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoginActionPerformed
String[][] strs = Search.serach(Searchname.getText(),Searchstuno.getText());
if(strs[0][0]==null){
JOptionPane.showMessageDialog(null, "查無此人");
Searchname.setText("");
Searchstuno.setText("");
}
else{
new SInfor(strs).setVisible(true);
this.setVisible(false);
}
添加
private void InsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
String[] str = bir.getText().split("-");
String birthday = "" ;
for (int i = 0; i < str.length; i++) {
birthday += str[i];
}
String istuno = stuno.getText().trim();
String iname = name.getText().trim();
String igender = gender.getText().trim();
String ibirthdate = bir.getText().trim();
String ipoutlook = po.getText().trim();
String iaddress = add.getText().trim();
String iphone = tel.getText().trim();
String idormitory = dn.getText().trim();
if(istuno.length()==0)
JOptionPane.showMessageDialog(null, "學號不能為空!");
else if(Search.isNumer(istuno)==false)
JOptionPane.showMessageDialog(null, "學號格式有誤,請重新輸入");
else if(iname.length()==0)
JOptionPane.showMessageDialog(null, "姓名不能為空!");
else if(igender.length()==0)
JOptionPane.showMessageDialog(null, "性別不能為空!");
else if(igender.length()>1){
JOptionPane.showMessageDialog(null, "性別格式有誤,請輸入m/f");
}
else if (ibirthdate.length()==0){
JOptionPane.showMessageDialog(null, "生日不能為空!");
}
else if((bir.getText().length()!=0&&Search.isNumer(birthday)==false)||bir.getText().length()!=10){
JOptionPane.showMessageDialog(null, "生日格式有誤,請輸xxxx-xx-xx格式");
bir.setText("");
} else if(Integer.parseInt(str[1])>12){
JOptionPane.showMessageDialog(null, "月份輸入有誤");
bir.setText("");
}
else if(Integer.parseInt(str[2])>31){
JOptionPane.showMessageDialog(null, "日期輸入有誤");
bir.setText("");
}
else if(Search.isNumer(iphone)==false){
JOptionPane.showMessageDialog(null, "電話號碼格式有誤!");
tel.setText("");
}
else{
InsertDB.Insert(istuno, iname, igender, birthday, ipoutlook, iaddress, iphone, idormitory);
stuno.setText("");name.setText("");gender.setText("");bir.setText("");
po.setText("");add.setText("");tel.setText("");dn.setText("");
}
}
修改
private void modifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifyActionPerformed
String[] str = bir.getText().split("-");
String birthday = "" ;
for (int i = 0; i < str.length; i++) {
birthday += str[i];
}
if(stuno.getText().length()==0)
JOptionPane.showMessageDialog(null, "學號不能為空!");
else if(Search.isNumer(stuno.getText())==false)
JOptionPane.showMessageDialog(null, "學號格式有誤,請重新輸入");
else if(name.getText().length()==0)
JOptionPane.showMessageDialog(null, "姓名不能為空!");
else if(gender.getText().length()==0)
JOptionPane.showMessageDialog(null, "性別不能為空!");
else if(gender.getText().length()>1){
JOptionPane.showMessageDialog(null, "性別格式有誤,請輸入m/f");
gender.setText("");
}
else if (bir.getText().length()==0){
JOptionPane.showMessageDialog(null, "生日不能為空!");
}
else if((bir.getText().length()!=0&&Search.isNumer(birthday)==false)||bir.getText().length()!=10){
JOptionPane.showMessageDialog(null, "生日格式有誤,請輸xxxx-xx-xx格式");
bir.setText("");
}else if(Integer.parseInt(str[1])>12){
JOptionPane.showMessageDialog(null, "月份輸入有誤");
bir.setText("");
}
else if(Integer.parseInt(str[2])>31){
JOptionPane.showMessageDialog(null, "日期輸入有誤");
bir.setText("");
}
else if(Search.isNumer(phone.getText())==false){
JOptionPane.showMessageDialog(null, "電話號碼格式有誤!");
phone.setText("");
} else{
int yes =JOptionPane.showConfirmDialog(this, "確認修改?", "提示",JOptionPane.YES_NO_OPTION);
if(yes==JOptionPane.YES_OPTION){
Modify.modify(stuno.getText(), name.getText(), gender.getText(),birthday,
poutlook.getText(), address.getText(), phone.getText(), dormitory.getText());
}
else{
}
}
}
刪除
private void deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteActionPerformed
int yes =JOptionPane.showConfirmDialog(this, "確認刪除?", "提示",JOptionPane.YES_NO_OPTION);
if(yes==JOptionPane.YES_OPTION){
Delete.delete(getstuno1.getText());
}
else{
}
}
7.尚待改進或者新的想法
- 登錄界面不夠完善,只能有兩個賬號登錄。——改進想法:可以實現自行注冊用戶,管理員可以給用戶分配權限。
- 插入操作只能一條一條插入,尚不能實現批量插入。——改進想法:可以批量插入,或者導入表格插入。
- 操作界面不夠完善。
8.團隊成員任務分配,團隊成員課程設計博客鏈接(以表格形式呈現),標明組長。
| 成員 | 任務 | 博客鏈接 |
| -------- | -----: | :----: |
| 李曉冬(組長)| 登錄界面,插入操作,刪除操作| http://www.cnblogs.com/leexd/p/7077083.html|
| 龔廈彬| GUI設計,查詢操作,修改操作 |http://www.cnblogs.com/handsome321/p/7067041.html|