Java课程设计——学生信息系统(团队)

团队名称、团队成员介绍

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|

posted @ 2017-06-22 20:39  我吃猫饼干  阅读(6125)  评论(0编辑  收藏  举报