学生成绩管理系统运行说明附代码.docx
《学生成绩管理系统运行说明附代码.docx》由会员分享,可在线阅读,更多相关《学生成绩管理系统运行说明附代码.docx(16页珍藏版)》请在冰豆网上搜索。
学生成绩管理系统运行说明附代码
金融信息系统设计
课程设计
运
行
说
明
题目:
学生成绩管理系统
班级:
XXXXXXXX
指导教师:
XXXX
小组成员:
XXXXXX
XXXXXX
1.Program.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Windows.Forms;
namespaceGradeMIS
{
staticclassProgram
{
///
///应用程序的主入口点。
///
[STAThread]
staticvoidMain()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(newMain());
}
}
}
2.Main.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.Sql;
usingSystem.Data.SqlClient;
namespaceGradeMIS
{
publicpartialclassMain:
Form
{
publicMain()
{
InitializeComponent();
}
privatevoidMain_Load(objectsender,EventArgse)
{
Loginlogin=newLogin();
login.ShowDialog();
//用户卡片
//调用Login.cs中的name变量,并赋给cuname的text值
this.cuname.Text=Login.name;
//调用Login.cs中的rank变量,并赋给cuiden的text值
this.cuiden.Text=Login.rank;
//调用Login.cs中的num变量,并赋给cuID的text值
this.cuID.Text=Login.num;
this.label6.Text=System.DateTime.Now.ToString("yy-MM-ddhh:
mm");
}
//菜单栏“学生管理”选项
privatevoid查看学生信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
StuInfosInfo=newStuInfo();
sInfo.Show();
}
privatevoid添加学生信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid更新学生信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid删除学生信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
//菜单栏“教师管理”选项
privatevoid查看教师信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
TeacInofotInfo=newTeacInofo();
tInfo.Show();
}
privatevoid添加教师信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid更新教师信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid删除教师信息ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
//菜单栏“成绩管理”选项
privatevoid成绩查询ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid申请查分ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid成绩录入ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid修改成绩ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
//菜单栏“帮助”选项
privatevoid技术支持ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid关于系统ToolStripMenuItem_Click(objectsender,EventArgse)
{
Deve();
}
privatevoid联系我们ToolStripMenuItem_Click(objectsender,EventArgse)
{
Toucht=newTouch();
t.Show();
}
//弹出“开发中”窗口
staticvoidDeve()
{
Developingd=newDeveloping();
d.Show();
}
}
}
3.Login.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.Sql;
usingSystem.Data.SqlClient;
namespaceGradeMIS
{
publicpartialclassLogin:
Form
{
staticpublicstringnum,name,rank;//
publicLogin()
{
InitializeComponent();
}
//“取消按钮”——退出应用程序
privatevoidcancelbtn_Click(objectsender,EventArgse)
{
Application.Exit();
}
//“登录按钮”——验证用户身份、账号和密码均正确后方成功登录
privatevoidloginbtn_Click(objectsender,EventArgse)
{
//连接数据库
stringsql="DataSource=.;InitialCatalog=GradeDB;PersistSecurityInfo=True;UserID=sa;Password=123456";
SqlConnectionconn=newSqlConnection(sql);
conn.Open();
//学生身份登录验证
if(student.Checked)
{
stringcstr="select*fromUserswhereType='学生'andID='"+txt1.Text+"'andPWD='"+txt2.Text+"'";
SqlCommandcomm=newSqlCommand(cstr,conn);
SqlDataReaderdr=comm.ExecuteReader();
if(dr.Read())
{
//将对象的编号赋给变量num,以便在Main.cs中显示当前用户编号
num=dr[0].ToString();
//将对象的名字赋给变量name,以便在Main.cs中显示当前用户姓名
name=dr[1].ToString();
//将对象的身份类型赋给变量rank,以便在Main.cs中显示用户身份
rank=dr[3].ToString();
this.Close();
}
else
{
MessageBox.Show("用户名或密码错误,请重新输入!
");
txt1.Text="";//清空账户
txt2.Text="";//清空密码
}
}
//教师身份登录验证
if(teacher.Checked)
{
stringcstr="select*fromUserswhereType='教师'andID='"+txt1.Text+"'andPWD='"+txt2.Text+"'";
SqlCommandcomm=newSqlCommand(cstr,conn);
SqlDataReaderdr=comm.ExecuteReader();
if(dr.Read())
{
num=dr[0].ToString();
name=dr[1].ToString();
rank=dr[3].ToString();
this.Close();
}
else
{
MessageBox.Show("用户名或密码错误,请重新输入!
");
txt1.Text="";
txt2.Text="";
}
}
//管理员身份登录验证
if(admin.Checked)
{
stringcstr="selectcount(*)fromUserswhereType='管理员'andID='"+txt1.Text+"'andPWD='"+txt2.Text+"'";
SqlCommandcomm=newSqlCommand(cstr,conn);
SqlDataReaderdr=comm.ExecuteReader();
if(dr.Read())
{
num=dr[0].ToString();
name="郭涛";
rank="管理员";
this.Close();
}
else
{
MessageBox.Show("用户名或密码错误,请重新输入!
");
txt1.Text="";
txt2.Text="";
}
}
conn.Close();
conn.Dispose();
}
}
}
4.StuInfo.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.Sql;
usingSystem.Data.SqlClient;
namespaceGradeMIS
{
publicpartialclassStuInfo:
Form
{
publicStuInfo()
{
InitializeComponent();
}
privatevoidStuInfo_Load(objectsender,EventArgse)
{
//TODO:
这行代码将数据加载到表“stuInfoDataSet.Student”中。
您可以根据需要移动或移除它。
this.studentTableAdapter.Fill(this.stuInfoDataSet.Student);
}
}
}
5.TeacInfo.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceGradeMIS
{
publicpartialclassTeacInofo:
Form
{
publicTeacInofo()
{
InitializeComponent();
}
privatevoidTeacInofo_Load(objectsender,EventArgse)
{
//TODO:
这行代码将数据加载到表“teacDataSet.Course”中。
您可以根据需要移动或移除它。
this.courseTableAdapter.Fill(this.teacDataSet.Course);
}
}
}
6.Touch.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceGradeMIS
{
publicpartialclassTouch:
Form
{
publicTouch()
{
InitializeComponent();
}
}
}
7.Developing.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
namespaceGradeMIS
{
publicpartialclassDeveloping:
Form
{
publicDeveloping()
{
InitializeComponent();
}
}
}
8.运行说明
8.1登录界面
启动程序,主界面加载时弹出登录界面,由身份、账号及密码三部分组成。
如下图所示。
8.2主界面
完成身份验证以确保是系统用户后,进入主界面。
主界面可显示当前用户的姓名、身份、编号及管理时间。
如下图所示。
8.3学生管理相应界面
在菜单栏中单击【学生管理】,显示有选项【查看学生信息】、【添加学生信息】、【更新学生信息】和【删除学生信息】。
如下图所示。
单击【查看学生信息】,弹出教师基本信息窗口。
如下图所示。
8.4教师管理相应界面
在菜单栏中单击【教师管理】,显示有选项【查看教师信息】、【添加教师信息】、【更新教师信息】和【删除教师信息】。
如下图所示。
单击【查看教师信息】,弹出教师基本信息窗口。
如下图所示。
8.5成绩管理相应界面
在菜单栏中单击【成绩管理】,显示有选项【成绩查询】、【申请查分】、【成绩录入】、【修改成绩】和【分析与统计】。
如下图所示。
8.6帮助界面
在菜单栏中单击【帮助】,显示有选项【技术支持】、【关于系统】和【联系我们】。
如下图所示。
单击【联系我们】,弹出联系窗口。
如下图所示。
8.7Other界面
由于其它功能模块还在开发中,若选中未开发完的菜单栏选项,会弹出道歉窗口。
如下图所示。