学生管理系统文档说明书.docx

上传人:b****1 文档编号:2634349 上传时间:2023-05-04 格式:DOCX 页数:29 大小:119.52KB
下载 相关 举报
学生管理系统文档说明书.docx_第1页
第1页 / 共29页
学生管理系统文档说明书.docx_第2页
第2页 / 共29页
学生管理系统文档说明书.docx_第3页
第3页 / 共29页
学生管理系统文档说明书.docx_第4页
第4页 / 共29页
学生管理系统文档说明书.docx_第5页
第5页 / 共29页
学生管理系统文档说明书.docx_第6页
第6页 / 共29页
学生管理系统文档说明书.docx_第7页
第7页 / 共29页
学生管理系统文档说明书.docx_第8页
第8页 / 共29页
学生管理系统文档说明书.docx_第9页
第9页 / 共29页
学生管理系统文档说明书.docx_第10页
第10页 / 共29页
学生管理系统文档说明书.docx_第11页
第11页 / 共29页
学生管理系统文档说明书.docx_第12页
第12页 / 共29页
学生管理系统文档说明书.docx_第13页
第13页 / 共29页
学生管理系统文档说明书.docx_第14页
第14页 / 共29页
学生管理系统文档说明书.docx_第15页
第15页 / 共29页
学生管理系统文档说明书.docx_第16页
第16页 / 共29页
学生管理系统文档说明书.docx_第17页
第17页 / 共29页
学生管理系统文档说明书.docx_第18页
第18页 / 共29页
学生管理系统文档说明书.docx_第19页
第19页 / 共29页
学生管理系统文档说明书.docx_第20页
第20页 / 共29页
亲,该文档总共29页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

学生管理系统文档说明书.docx

《学生管理系统文档说明书.docx》由会员分享,可在线阅读,更多相关《学生管理系统文档说明书.docx(29页珍藏版)》请在冰点文库上搜索。

学生管理系统文档说明书.docx

学生管理系统文档说明书

 

《基于Linux下的学生信息管理系统课程设计》

课题名称:

学生信息管理系统

专业:

2011级计算机科学与技术

组长:

003陈金灼

组员:

028蓝宇特031李星037林鑫炜054吴金财

指导老师:

林晖

日期:

2014年10月25日

一、课程序设计目的及意义

1、用Linux实现编程。

2、深入学习了基本的java语言和Linux基本操作。

3、学习在Linux下调试与运行程序的过程以及有关代码的理解与应用。

4、设计学生管理系统方便管理员管理学生信息。

5、设计任务及要求

6、明确课程要求,复习和查阅相关知识。

7、分工完成课程设计内容,思路要清晰、正确。

8、加深对java语言和Linux基本操作的学习。

二、实现过程

1.概要设计

由于学生信息的冗长与繁琐,所以它的管理问题带来的麻烦和不方便也随之而来,所以开发一个合适学校的、便于管理学生信息的管理系统是十分必要的。

学生信息管理系统是对学生的基本信息进行管理,主要包括显示、查询、添加和删除学生的基本信息,方便管理人员对学生基本信息进行查询,排序等操作,从而实现学生信息管理的自动化与计算机化。

本课题将实现一个简化的学生信息管理系统。

2.程序的整体设计

(1)学生基本信息的录入和保存

在链表中的适当位置插入一个学生信息节点,一次添加一条学生信息(添加内容包含学号、姓名、年龄),如果添加的学号已经在文件中存在,则不能添加到文件中去,应显示错误提示语;如果添加成功,则显示成功提示语。

添加操作完毕后,应该询问用户是否继续执行此操作。

如果用户不继续,则退回到程序初始界面。

(2)显示学生信息

此功能是显示一个学生信息节点中的信息,并在屏幕上显示出来。

(3)按学号查找学生信息

按学号查询学生信息,要求显示文件中与用户输入的学号相匹配的学生信息,要求显示学号、姓名、年龄等字段,如果文件中没有学生信息,则显示提示语。

查询操作完毕后,应该询问用户是否继续执行此操作。

如果用户不继续,则退回到程序初始界面。

(4)按姓名查找学生信息

按姓名查询学生信息,要求显示文件中与用户输入的学号相匹配的学生信息,要求显示学号、姓名、年龄等字段,如果文件中没有学生信息,则显示提示语。

查询操作完毕后,应该询问用户是否继续执行此操作。

如果用户不继续,则退回到程序初始界面。

(5)添加学生信息

添加学生信息中的某一项信息,一次更新一条学生信息(更新内容包含学号、姓名、年龄等字段值),如果更新的学号在文件中不存在,则不能更新,应该显示错误提示语;如果更新成功,则显示成功提示语。

更新操作完毕后,应该询问用户是否继续执行此操作。

如果用户不继续,则退回到程序初始界面。

(6)删除学生信息

进入该项功能界面后,删除学生信息,一次删除一条学生信息。

(7)退出系统,结束任务。

三、程序部分源代码注释及

(1)代码:

packagecom.example.studentmanagersystem;

importjava.io.BufferedReader;

importjava.io.ByteArrayOutputStream;

importjava.io.IOException;

importjava.io.InputStream;

importjava.io.InputStreamReader;

importjava.util.ArrayList;

importjava.util.List;

importorg.json.JSONArray;

importorg.json.JSONException;

importorg.json.JSONObject;

importandroid.app.ActionBar;

importandroid.app.Activity;

importandroid.app.AlertDialog;

importandroid.app.AlertDialog.Builder;

importandroid.content.ContentValues;

importandroid.content.Intent;

importandroid.database.Cursor;

importandroid.database.sqlite.SQLiteDatabase;

importandroid.graphics.Bitmap;

importandroid.graphics.BitmapFactory;

importandroid.graphics.Bitmap.CompressFormat;

importandroid.graphics.drawable.BitmapDrawable;

import.Uri;

importandroid.os.Bundle;

importandroid.view.LayoutInflater;

importandroid.view.Menu;

importandroid.view.MenuInflater;

importandroid.view.MenuItem;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.view.ViewGroup;

importandroid.widget.AdapterView;

importandroid.widget.AdapterView.OnItemClickListener;

importandroid.widget.ArrayAdapter;

importandroid.widget.AutoCompleteTextView;

importandroid.widget.BaseAdapter;

importandroid.widget.Button;

importandroid.widget.CheckBox;

importandroid.widget.CompoundButton;

importandroid.widget.Toast;

importandroid.widget.CompoundButton.OnCheckedChangeListener;

importandroid.widget.EditText;

importandroid.widget.ImageView;

importandroid.widget.ListView;

importandroid.widget.TextView;

importcom.example.studentmanagersystem.helper.MySqlHelper;

importcom.example.studentmanagersystem.pojo.Student;

publicclassStudentInformationManagerActivityextendsActivity{

privateintop_imageid[]={R.drawable.addstudent_image,

R.drawable.deletestudent_image,R.drawable.refreshstudent_image,

R.drawable.user_image,R.drawable.sms_all};

privateStringstr[]={"新增","删除","刷新","管理用户","短信群发"};

privateListViewlistView;

privateViewvisView;

privatebooleanflag=true;

privateMySqlHelpermySqlHelper;

privateSQLiteDatabasedb;

privateListstudents=newArrayList();

privateListViewstu_listview;

privateCheckBoxcheckboxsum;

privatebooleanchboxall=false;

privateArrayListcbs=newArrayList();

privateStringupdateName;

privateAutoCompleteTextViewserach_edit;

privateListlists=newArrayList();

privateActionBaractionBar;

privateJSONArrayjsonArray;

privateImageViewstu_headimage;

@Override

protectedvoidonCreate(BundlesavedInstanceState){

//TODOAuto-generatedmethodstub

super.onCreate(savedInstanceState);

setContentView(R.layout.studentinfomationmaneger);

mySqlHelper=newMySqlHelper(StudentInformationManagerActivity.this,

"student_inf.db",null,1);

db=mySqlHelper.getWritableDatabase();

actionBar=getActionBar();

actionBar.setDisplayShowHomeEnabled(false);

actionBar.setHomeButtonEnabled(false);

actionBar.setDisplayShowTitleEnabled(false);

checkboxsum=(CheckBox)findViewById(R.id.checkboxsum);

checkboxsum.setOnCheckedChangeListener(newOnCheckedChangeListener(){

@Override

publicvoidonCheckedChanged(CompoundButtonarg0,booleanarg1){

//TODOAuto-generatedmethodstub

chboxall=arg1;

stu_adapter.notifyDataSetChanged();

}

});

stu_listview=(ListView)findViewById(R.id.stu_listview);

stu_listview.setAdapter(stu_adapter);

stu_listview.setOnItemClickListener(newOnItemClickListener(){

@Override

publicvoidonItemClick(AdapterView

>arg0,Viewarg1,intarg2,

longarg3){

//TODOAuto-generatedmethodstub

showInformation(arg2);

System.out.println(arg2);

}

});

}

publicvoidaddStudent(){

Intentintent=newIntent(StudentInformationManagerActivity.this,

AddStudentActivity.class);

startActivity(intent);

}

publicvoiddelStudent(){

for(Studentstudent:

students){

System.out.println(student.isChecked());

if(student.isChecked()){

Cursorcursor=db.rawQuery("deletefromstudentwhereid='"

+student.getId()+"'",null);

cursor.moveToNext();

}

}

//Cursorcursor=

//db.rawQuery("deletefromstudentwhereid='"+id+"'",null);

//cursor.moveToNext();

onResume();

//chboxall=false;

}

privatevoidsms_all(){

Cursorcursor=db.rawQuery("selectphonefromstudent",null);

Stringstr_sms="";

while(cursor.moveToNext()){

str_sms=str_sms+cursor.getString(0)+",";

}

Intentintent1=newIntent(Intent.ACTION_SENDTO,Uri.parse("smsto:

"

+str_sms));

startActivity(intent1);

}

publicvoidshowInformation(finalinttemp){

Builderbuilder=newBuilder(StudentInformationManagerActivity.this);

LayoutInflaterinflater=LayoutInflater

.from(StudentInformationManagerActivity.this);

Viewview=inflater.inflate(R.layout.showstudentinf,null);

finalAlertDialogdialog=builder.setTitle("学生详细信息").setView(view)

.create();

Buttonsxiugai=(Button)view.findViewById(R.id.sxiugai);

Buttonsok=(Button)view.findViewById(R.id.sok);

Buttonscancel=(Button)view.findViewById(R.id.scancel);

finalEditTextsname=(EditText)view.findViewById(R.id.sname);

finalEditTextssex=(EditText)view.findViewById(R.id.ssex);

finalEditTextsmingzu=(EditText)view.findViewById(R.id.smingzu);

finalEditTextsid=(EditText)view.findViewById(R.id.sid);

finalEditTextsbir=(EditText)view.findViewById(R.id.sbir);

finalEditTextsphone=(EditText)view.findViewById(R.id.sphone);

finalEditTextsmore=(EditText)view.findViewById(R.id.smore);

stu_headimage=(ImageView)view

.findViewById(R.id.stu_headimage);

ImageViewcallstu=(ImageView)view.findViewById(R.id.callstu);

ImageViewsmsstu=(ImageView)view.findViewById(R.id.smsstu);

sname.setText(students.get(temp).getName().toString());

ssex.setText(students.get(temp).getSex().toString());

smingzu.setText(students.get(temp).getMingZu().toString());

sid.setText(students.get(temp).getId().toString());

sbir.setText(students.get(temp).getBirthday().toString());

sphone.setText(students.get(temp).getPhone().toString());

smore.setText(students.get(temp).getMore().toString());

Cursorcursor=db.rawQuery(

"select*fromstudentwhereid='"

+students.get(temp).getId().toString()+"'",null);

//知道只有一条记录直接moveToNext

cursor.moveToNext();

//cursor.getColumnIndex("image")获取列的索引

byte[]imageBytes=cursor.getBlob(cursor.getColumnIndex("image"));

Bitmapbitmap=BitmapFactory.decodeByteArray(imageBytes,0,

imageBytes.length);

stu_headimage.setImageBitmap(bitmap);

dialog.show();

updateName=students.get(temp).getName().toString();

stu_headimage.setOnClickListener(newOnClickListener(){

@Override

publicvoidonClick(Viewarg0){

//TODOAuto-generatedmethodstub

chooseImage();

}

});

sxiugai.setOnClickListener(newOnClickListener(){

@Override

publicvoidonClick(Viewarg0){

//TODOAuto-generatedmethodstub

sname.setEnabled(true);

ssex.setEnabled(true);

smingzu.setEnabled(true);

sid.setEnabled(true);

sbir.setEnabled(true);

sphone.setEnabled(true);

smore.setEnabled(true);

}

});

sok.setOnClickListener(newOnClickListener(){

@Override

publicvoidonClick(Viewv){

//TODOAuto-generatedmethodstub

Bitmapbitmap=((BitmapDrawable)stu_headimage.getDrawable()).getBitmap();

ByteArrayOutputStreambyteOut=newByteArrayOutputStream();

//压缩bitmap到ByteArrayOutputStream

press(CompressFormat.PNG,100,byteOut);

//Cursorcursor=db.rawQuery("updatestudentsetname='"

//+sname.getText().toString()+"',sex='"

//+ssex.getText().toString()+"',mingzu='"

//+smingzu.getText().toString()+"',id='"

//+sid.getText().toString()+"',birthday='"

//+sbir.getText().toString()+"',phone='"

//+sphone.getText().toString()+"',more='"

//+smore.getText().toString()+"',image='"

//+byteOut.toByteArray()+"'wherename='"

//+updateName+"'",null);

ContentValuesvalues=newContentValues();

values.put("name",sname.getText().toString());

values.put("sex",ssex.getText().toString());

values.put("mingzu",smingzu.getText().toString());

values.put("id",sid.getText().toString());

values.put("birthday",sbir.getText().toString()

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 职业教育 > 中职中专

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2