c#net课程设计.docx
《c#net课程设计.docx》由会员分享,可在线阅读,更多相关《c#net课程设计.docx(14页珍藏版)》请在冰豆网上搜索。
![c#net课程设计.docx](https://file1.bdocx.com/fileroot1/2022-10/10/412007e8-0600-497a-b1a4-40d07cdbfde0/412007e8-0600-497a-b1a4-40d07cdbfde01.gif)
c#net课程设计
c#.net课程设计
C#.Net课程设计报告
课程题目:
学生成绩管理系统
姓名:
张阳辉
班级:
1230501
学号:
0117
专业:
计算机科学与技术
指导老师:
魏树权
时间:
2015年1月15日
一、课程设计的目的
本课程设计的目的是使学生能熟练掌握简单的简单Windows窗体应用程序的设计和的应用,希望通过本次课程设计锻炼学生使用C#语言解决实际问题的能力。
二、课程设计的要求
系统功能基本要求:
学生信息,学号、姓名、性别、专业、年级等;学生成绩信息,包括学号、课程编号、课程名称、分数等。
课程信息,包括课程编号、课程名称、任课教师等。
系统重点在于对学生成绩需设计多种查询方式以及设计成绩按分条件统计功能。
三、开发环境
系统开发平台:
Microsoft Visual Studio2010
系统开发语言:
C#
数据库管理软件:
SQL Server 2005
四、需求分析
(一)系统目标
(1)根据查询条件实现学生信息的查询
(2)学生选课信息查询、成绩信息的查询
(3)学生信息、课程信息、成绩信息的增加、删除、修改
(4)对基本信息完成增加、删除、修改时,需注意表与表之间的关联
(二)功能需求分析
本系统的功能需求分析如下:
(1)学生信息查询:
学生可以根据学号、姓名、专业进行查询。
(2)学生信息管理:
主要是用于学生信息更新、插入、删除。
(3)学生成绩录入:
用于学生成绩管理,录入学生成绩,也可以更新。
(三)性能需求分析
登录、用户界面需求:
简洁、易懂、易用、友好的用户界面。
五、总体设计
系统(E-R图)数据库概念结构设计
系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。
如下图学生信息表E-R图结构。
学生信息表E-R图
下图课程信息表E-R图结构
课程信息表E-R图
下图成绩信息表E-R图结构
成绩信息表E-R图
以下为数据库表
1.学生信息表
2.成绩信息表
3.课程信息表
六、附录(核心代码)
usingSystem;
using;
using;
using;
using;
using;
usingLogin_l
{
publicpartialclassLogin:
Form
{
privateSqlConnectionsqlconn;
privateSqlCommandsqlcomm;
privateSqlDataAdaptersqldataadapt;
privateSqlDataReadersqldatareader;
privateDataSetds;
privatestaticintcurrent=0;
publicLogin()
{
sqlconn=newSqlConnection();
ds=newDataSet();
="DataSource=.;InitialCatalog=Student;UserID=1001;Password=123456";
InitializeComponent();
}
privatevoidForm1_Load(objectsender,EventArgse)
{
Youcanmove,orremoveit,asneeded.="用户名:
";
="密码:
";
="成绩管理系统";
}
privatevoidbtnOK_Click(objectsender,EventArgse)
{
Form2d=newForm2();
stringuserName=;
stringpassword=;
();
stringselstr="select*fromuser_info";
sqldataadapt=newSqlDataAdapter(selstr,sqlconn);
(ds);
=[0].Rows[current][0].ToString();
=[0].Rows[current][1].ToString();
();
current++;
if(userName=="1001"&&password=="123456")
{
("欢迎登录成绩管理系统!
","登录成功|",,;
();
();
}
}
privatevoidbtnCancel_Click(objectsender,EventArgse)
{
="";
="";
();
}
privatevoidlblAbout_Click(objectsender,EventArgse)
{
Aboutmef=newAboutme();
();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
();
}
}
}
usingSystem;
using;
using;
using;
using;
using;
usingLogin_l
{
publicpartialclassForm2:
Form
{
publicForm2()
{
InitializeComponent();
}
privatevoidForm2_Load(objectsender,EventArgse)
{
Youcanmove,orremoveit,asneeded.}
privatevoidbutton1_Click(objectsender,EventArgse)
{
Form3k=newForm3();
();
();
}
privatevoidbutton2_Click(objectsender,EventArgse)
{
Form4j=newForm4();
();
();
}
privatevoidbutton3_Click(objectsender,EventArgse)
{
Form5l=newForm5();
();
();
}
}
}
usingSystem;
using;
using;
using;
using;
using;
usingLogin_l
{
publicpartialclassForm3:
Form
{
privateSqlDataAdapterda=newSqlDataAdapter();
privateDataSetds=newDataSet("Student");
publicForm3()
{
InitializeComponent();
ShowStudent();
}
privatevoidShowStudent()
{
stringconnString=@"DataSource=JDPRYP3VASY3VPX;InitialCatalog=Student;IntegratedSecurity=True";
stringsql="selectstu_idas学号,stu_nameas姓名,stu_sexas性别,stu_birthas生日,class_nameas班级,stu_telas联系电话,stu_addras地址,enroll_dateas入学时间,commentas备注fromstudent_info";
SqlConnectionconn=newSqlConnection(connString);
();
SqlCommandcomm=newSqlCommand(sql,conn);
=comm;
SqlCommandBuilderbuilder=newSqlCommandBuilder(da);
(ds,"student_info");Youcanmove,orremoveit,asneeded.
ShowStudent();
更新模块代码设计
privatevoidbutton3_Click(objectsender,EventArgse)oString();oString();oString();alue+"','"+txtBj.Text+"','"+txtTel.Text+"','"+txtAddr.Text+"','"++"','"+txtBz.Text+"')";
SqlCommandda=newSqlCommand(sql,conn);
Youcanmove,orremoveit,asneeded.
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
stringconnString=@"DataSource=JDPRYP3VASY3VPX;InitialCatalog=Student;IntegratedSecurity=True";
SqlConnectionconn=newSqlConnection(connString);
stringsql="select*fromcourse_infowherecourse_id='"++"'";
SqlDataAdapterda=newSqlDataAdapter(sql,conn);
DataSetds=newDataSet();
(ds,"course_info");
=["course_info"];
}
privatevoidbutton2_Click(objectsender,EventArgse)
{
(1000);
Form5q=newForm5();
();
}
}
}
usingSystem;
using;
using;
using;
using;
using;
using;
namespaceLogin_l
{
publicpartialclassForm5:
Form
{
publicForm5()
{
InitializeComponent();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
stringconnString=@"DataSource=JDPRYP3VASY3VPX;InitialCatalog=Student;IntegratedSecurity=True";
SqlConnectionconn=newSqlConnection(connString);
stringsql="select*fromscore_infowherestuden