目录
功能预览
一、项目介绍
管理员身份功能介绍: 1:用户登录:用户通过账号信息进行软件的登录 2:课程管理:对课程信息进行管理 3:学生管理:对学生信息进行管理 4:成绩管理:添加每一门课程的学生成绩信息 5:通知管理:添加考试通知信息 用户功能介绍: 1:登录模块:使用管理员添加的学生信息的账号进行登录 2:成绩查看:查看自己的成绩信息,以及自己的成绩排名信息 3:通知信息:查看发布的通知信息 4:个人信息:用户可以浏览个人信息,以及对密码进行修改;
二、运行环境
1:软件使用Android stuido进行开发;
2:使用sqlite本地数据库进行数据的存储;3:需要jdk1.7以上
4:使用雷电模拟器或者Androidstuio自带的模拟器进行运行
三、部分代码
1:添加成绩信息
public class CreatScoreActivity extends BaseActivity {// 标题private TextView mTvTitle;// 返回private ImageView mIvBack;private Button mSubmit;private TextView bookTitle;private EditText bookType;private TextView courseWeek;private List<User> mlistData = new ArrayList<User>();private DialogListMsg dialogListMsg;private ChoiceTypeAdapter listaAdapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_create_score);initWidget();initData();}@Overridepublic void onClick(View v) {switch (v.getId()) {case R.id.mIvBack:finish();break;case R.id.courseWeek:dialogListMsg.Show();break;case R.id.mSubmit:Score message=new Score();message.setScoreCourseId(course.getId());message.setScoreCourseName(course.getCourseName());message.setScoreStuId(mlistData.get(posIndex).getId());message.setScoreStuName(mlistData.get(posIndex).getUserName());message.setScoreInfor(bookType.getText().toString());message.save();CustomToast.showToast(this, "添加成功");new Handler().postDelayed(new Runnable() {@Overridepublic void run() {finish();}}, 1000);break;}}@Overridepublic void initWidget() {bookTitle =(TextView) findViewById(R.id.bookTitle);bookType = (EditText) findViewById(R.id.bookType);courseWeek = (TextView) findViewById(R.id.courseWeek);courseWeek.setOnClickListener(this);mSubmit = (Button) findViewById(R.id.mSubmit);mIvBack = (ImageView) findViewById(R.id.mIvBack);mTvTitle = (TextView) findViewById(R.id.mTvTitle);mTvTitle.setText("添加学生成绩信息");mIvBack.setVisibility(View.VISIBLE);mIvBack.setOnClickListener(this);mSubmit.setOnClickListener(this);}private int posIndex;Course course;@Overridepublic void initData() {course = (Course)this.getIntent().getSerializableExtra("msg");bookTitle.setText(course.getCourseName());dialogListMsg = new DialogListMsg(this);dialogListMsg.setTitle().setText("请选择学生信息");listaAdapter = new ChoiceTypeAdapter(this);mlistData = User.listAll(User.class);listaAdapter.setData(mlistData);dialogListMsg.show_listview().setAdapter(listaAdapter);dialogListMsg.show_listview().setOnItemClickListener(new AdapterView.OnItemClickListener() {@Overridepublic void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {posIndex = i;courseWeek.setText(mlistData.get(posIndex).getUserName());dialogListMsg.Close();}});dialogListMsg.submit_no().setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {dialogListMsg.Close();}});}}
2:添加课程信息
public class CreatCourseActivity extends BaseActivity {// 标题private TextView mTvTitle;// 返回private ImageView mIvBack;private Button mSubmit;private EditText bookTitle;private EditText bookType;private TextView courseWeek;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_create_course);initWidget();initData();}@Overridepublic void onClick(View v) {switch (v.getId()) {case R.id.mIvBack:finish();break;case R.id.courseWeek:SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");// 设置日期格式TimeSelector timeSelector = new TimeSelector(this, new TimeSelector.ResultHandler() {@Overridepublic void handle(String time) {courseWeek.setText(time);}}, df.format(new Date()), "2030-12-01 23:59");timeSelector.setMode(TimeSelector.MODE.YMDHM);//显示 年月日时分(默认);timeSelector.show();break;case R.id.mSubmit:Course message=new Course();message.setCourseName(bookTitle.getText().toString());message.setCourseAddress(bookType.getText().toString());message.setCourseWeek(courseWeek.getText().toString());message.save();CustomToast.showToast(this, "添加成功");new Handler().postDelayed(new Runnable() {@Overridepublic void run() {finish();}}, 1000);break;}}@Overridepublic void initWidget() {bookTitle =(EditText) findViewById(R.id.bookTitle);bookType = (EditText) findViewById(R.id.bookType);courseWeek = (TextView) findViewById(R.id.courseWeek);courseWeek.setOnClickListener(this);mSubmit = (Button) findViewById(R.id.mSubmit);mIvBack = (ImageView) findViewById(R.id.mIvBack);mTvTitle = (TextView) findViewById(R.id.mTvTitle);mTvTitle.setText("添加课程");mIvBack.setVisibility(View.VISIBLE);mIvBack.setOnClickListener(this);mSubmit.setOnClickListener(this);}@Overridepublic void initData() {bookTitle.setText("计算机基础");bookType.setText("一号楼1001室");}}
3:查看课程信息
public class LookScoreActivity extends BaseActivity { private int choiceType = 1; // title private TextView mTvTitle; // 返回 private ImageView mIvBack; private TextView paiming; private TextView metName; private TextView metPswd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lookscore); initWidget(); initData(); } @Override public void initWidget() { metName = (TextView) findViewById(R.id.metName); paiming = (TextView) findViewById(R.id.paiming); metPswd = (TextView) findViewById(R.id.metPswd); mIvBack = (ImageView) findViewById(R.id.mIvBack); mTvTitle = (TextView) findViewById(R.id.mTvTitle); mTvTitle.setText("查看成绩信息"); mIvBack.setVisibility(View.VISIBLE); mIvBack.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.mIvBack: LookScoreActivity.this.finish(); break; } } private List<Score> list_result = new ArrayList<Score>(); Course course; @Override public void initData() { course = (Course)this.getIntent().getSerializableExtra("msg"); list_result = Score.findWithQuery(Score.class, "Select * from Score where scoreCourseId = " + course.getId()+" order by scoreInfor desc "); for(int i=0;i<list_result.size();i++){ if((list_result.get(i).getScoreStuId()+"").equals(MemberUserUtils.getUid(this))){ paiming.setText("第"+(i+1)+"名"); metName.setText(list_result.get(i).getScoreCourseName()); metPswd.setText(list_result.get(i).getScoreInfor()+"分"); } } }}