当前位置:首考文秘网>范文大全 > 公文范文 > 南财教务管理系统学生版(通用2篇)

南财教务管理系统学生版(通用2篇)

时间:2022-04-20 13:20:03 公文范文 来源:网友投稿

系统:是指部分组成的整体系统:2016年上映的澳大利亚电影, 以下是为大家整理的关于南财教务管理系统学生版2篇 , 供大家参考选择。

南财教务管理系统学生版2篇

南财教务管理系统学生版篇1

教务管理系统学生操作手册

发布时间:2012-02-15 06:52  来源:教务处  作者:刘晓木点击量:567        

一、登录系统

打开IE浏览器,输入WEB服务器地址或从教务处主页登录“正方教务管理系统”,进入用户登录界面。输入学号及口令(默认为身份证号),选择“学生”角色,按“登录”。(请各位同学不要忘记关闭所有开启的窗口,以防他人进入,造成不良后果!)

二、学生网上选课

网上选课内容包括:学生选课、选体育课、重修或补修选课。

2.1学生选课

点击“网上选课”->“学生选课”进入选课系统。

1.选择选课项目

学生选课项目包括:快速选课、本专业选课、选修课程、跨专业选课、特殊课程、选体课。

(1)本专业选课:指本专业的专业选修课程。

点击“本专业选课”按钮,系统仅显示本专业的选修课程上课信息,学生根据实际情况选择对应的课程,定是否要预订教材后按“选定”即可。

(2)选修课程:指校公选课。

点击“选修课程”按钮,系统弹出学科选择窗口,显示具体学科及上课时间,选中某一学科按“选定”,系统根据选择情况列出该学科该上课时间的所有课程。关闭弹出窗口即可进行下一步选课。

 

学生根据实际情况选择课程。

点击课程名称,系统弹出该课程上课信息,学生可根据实际确定是否预订教材后按“选定”即可,若误选可按“删除”退选。

按“关闭”按钮,即可看到该课程选中状况(在“选否”下显示“已选”)。

点击“已选课程”可查阅所有已选中课程情况。

按“查看课表”可查阅本学期个人课表,也可先查课表再选课,以免冲突。

(3)跨专业选课:学生选其他专业课程。

选课方式基本同本专业选课,选具体课程前多了个选某学院中的某专业、某年级的所有课程。

(4)选体育课:选择体育项目。

点击“选体育课”按钮登录体育选课系统。

选择一项体育项目,系统列出该项目所有上课信息,学生可根据实际情况选择上课时间及教师,按“选定课程”即可。若误选按“删除”退选。

2.2重修或补修选课

点击“网上选课”->“重修或补修选课”进入重修或补修选课系统。

1.点击“查询课程”按钮,点击下拉按钮,选择重修课程科目。

2.点击“我要报名”按钮。弹出一个提示框,显示该门课程已有几人报名。

3.点击“确定”按钮,完成该门课程的重修报名操作。此时,“报名结果”中显示已选重修科目,若误选,按“删除”按钮。

4.重修多门课程时,重复以上操作步骤。

三.活动报名

1.网上报名

点击“活动报名”-> “网上报名”。

2.在需要报的报名名称前复选框中打勾(若报名名称属相同的报名类型,只可报其中一项,若报名名称属不同的报名类型,可多项报名);

3.认真核对源信息身份证号,并填写身份证号;

4.点击“确定”按钮,完成网上报名操作。

   

四.修改密码

为防止登录信息泄密,请各位同学尽快更改原始密码,点击“信息维护”->“密码修改”菜单,修改自己的原始密码和登陆名。

五.信息查询

信息查询内容包括:专业推荐课表查询、学生个人课表、学生考试查询、成绩查询、等级考试查询、培养计划查询、教室查询、学生选课情况查询。

5.1专业推荐课表查询

点击“信息查询”-> “专业推荐课表查询”可查询各专业推荐课表。

5.2学生个人课表

点击“信息查询”-> “学生个人课表查询”可查询全校每位学生的上课情况。

5.3学生考试查询

点击“信息查询”-> “学生考试查询”可查询学生各科考试时间、考试地点等信息。

5.4成绩查询

点击“信息查询”-> “成绩查询”可查询学生学期成绩、学年成绩、在校学习成绩信息,及至今未通过的课程信息、学分获得情况。

(1)选择学年、学期,点击按学期查询,显示相应学年学期的成绩信息

(2)点击按学年查询,显示相应学年的成绩信息

(3)点击在校学习成绩查询,显示该生在校期间已学课程的成绩信息。

5.5等级考试查询

点击“信息查询”-> “等级考试查询”可查询学生等级考试信息。

5.6培养计划查询

点击“信息查询”-> “培养计划查询”可查询全校各专业的培养计划。

5.7教室查询

点击“信息查询”-> “教室查询”可查询全校教室使用情况及教室使用申请。

1.选择学年学期,输入教室名称,点击“按教室查询使用情况”可查询使用情况;

2.选择时间段、星期几、节次,点击“按时间段查询空教室”查询时间段内的空教室;

3.选择某一空教室,点击后面的“教室预约”,填入借用单位及电话、预约人电话及用途即可向教务处预约教室,并可打印预约单;

再点击“预约教室审核结果”可查询审批结果。

5.8学生选课情况查询

点击“信息查询”-> “学生选课情况查询”可查询学生选课情况信息。

六.系统维护

点击“系统维护”->“退出系统”菜单,即可退出系统。 

南财教务管理系统学生版篇2

教务管理系统学生端设计

设计任务和设计要求

学生登录学生选课系统后可进行如下操作:

(1)查看备选课程及该课程的信息。

(2)查看希望教授该课程的教师的信息。

(3)选择希望选修的课程,并从候选的教师中选择两个自己认同的教师(如只有一个候选教师则只能选择一个),相当于给教师投票,该投票结果最终决定该课程的任课教师。

(4)删除误选的课程。

选课的规则如下:

(1)每个学生最多能选5门课,至少选2门课。

(2)每门课选修的人数有限,如果选修的人数超过了限制的人数,先报名的学生有上课的资格。

(3)学生选课时可以选择课程,同时选择2名候选的任课教师。

(4)每名教师最多可以教授3门课。

内容摘要

教务管理系统是一个基于桌面的系统,供管理员、教师和学生选课使用。管理员可以管理教师和学生选课的相关信息;教师可以开设课程、管理学生的选课信息以及对学生评分;学生则可以选修课程、查看成绩等。通过查询选课信息以开设自己的课程;学生则可以在一定范围内自由选修课程,查看授课老师的相关教学信息等。其中,选课活动是推进学分制建设的重要环节,也是教务管理的难点之一。选课工作顺利与否直接关系到教学秩序的稳定。因此开发一个完整的选课管理模式是其中一个至关重要的环节

本系统是一个在Microsoft Visual Studio C#环境下通过访问ADO.NET来实现数据库的连接的,由于编者知识有限,仅运行实现了该系统的学生端设计的部分功能。具体设计如下。

第一章 设计概述……………………………………… 4

第二章 总体设计……………………………………… 5

2.1 系统功能简介………………………………… 5

2.2 需求分析……………………………………… 6

2.2.1 数据需求………………………………… 6

2.2.2 事务需求………………………………… 6

第三章 详细设计……………………………………… 7

3.1 E-R模型设计……………………………………7

3.2 数据库设计………………………………………7

3.2.1 创建数据库…………………………………8

3.2.2 创建数据表…………………………………9

3.2.3 数据连接……………………………………11

3.3 程序设计与实现…………………………………12

第四章 总结………………………………………………44

参考文献………………………………………………… 45

第一章 设计概述

教务管理系统学生端的设计目标是方便学生用户使用。通过学生端应用程序,学生可以登录进入系统并进行一系列相关操作。本设计包括系统的各模块或单元程序的设计、具体的算法、相关的程序实现图以及相关的代码。

第二章总体设计

2.1 系统功能简介

本系统主要功能模块如下:

(1)系统管理

学生登录:学生用户通过登录窗口进入系统。

学生注销:学生用户完成操作后可以注销自己的登录行为。

退出系统:所有操作完成后直接退出系统。

(2)学籍管理

(3)课程管理

所有课程列表:显示所有教师开设的课程。

我的课程列表:显示当前用户所选的全部课程。

添加选课:选修教师开设的课程。

删除选课:删除已经选择的课程。

2.2 需求分析

2.2.1 数据需求

事务需求根据系统的需求,首先将要记录的信息分类,要记录的信息如下。

(1)学生信息:包括学生学号、姓名、性别、年龄、专业等。

(2)课程信息:包括课程编号、课程名、授课教师、开课地点、时间及学分等。

(3)学生选课:包括学生学号、课程编号、学分及选修号等。

2.2.2 事务需求

该系统采用三层结构,其中位于表现层的是Student项目;

位于数据访问层的则是DataAccess项目;位于数据存储层的则是数据库Student,如图(1)所示。

(1)学生端系统结构图

第三章 详细设计

3.1 E-R模型设计

具体实体相关属性在前面已给出,该系统的E-R图如

图(2)所示。

(2)E-R图

3.2 数据库设计

3.2.1 创建数据库

使用SQL Server 作为数据库,其中数据库

Student,该数据库中有如下数据表

student:保存学生信息。

course:保存教师开设课程信息。

stuCourse:保存学生选课信息。

建立数据库 Student及相关数据表:

CREATE DATABASE Student

GO

USE Student

GO

CREATE TABLE [dbo].[student]

( [stuID] [varchar] (50) NOT NULL

[stuPassword] [varchar](50) NOT NULL

[stuName] [varchar](50) NOT NULL

[stuMajor] [varchar](50) NOT NULL ,

[stuSex] [varchar] (2) NOT NULL ,

[stuBirthday] [datetime] NOT NULL

) ON [PRIMARY]

GO

CREATE TABLE [dbo].[course]

([courseID] [int] NOT NULL ,

[courseName] [varchar] (50) NOT NULL ,

[courseTime] [datetime] NOT NULL ,

[courseCredit] [int] NOT NULL ,

[courseTeacher] [varchar] (16) NULL ,

[courseAddress] [varchar] (50) NOT NULL

) ON [PRIMARY]

GO

CREATE TABLE [dbo].[stuCourse]

([scID] [int] NOT NULL ,

[stuID] [varchar] (50)NOT NULL,,

[courseID] [int] NOT NULL ,

[scScore] [int] NOT NULL

) ON [PRIMARY]

3.2.2 创建数据表

student 表:

course表:

stuCouse表:

3.2.3 数据连接

本系使用ADO.NET访问数据库,因为每个数据提供程序都包含自己特有的Connection对象。

SQL Server.NET数据提供程序的SqlConnection对象是在System.Data.SqlClient命名空间中定义的,它包含在System.Data DLL程序集中。一般使用SqlConnection类的方法如下:

System.Data.Sqlclient.SqlConnection conn

= new System.Data.Sqlclient.SqlConnection( );

具体实例操作如下一节所述。

3.3 程序设计与实现

具体程序代码如下:

using System;

using System.Collections.Generic;

using System.Windows.Forms;

namespace SchoolMIS.UI.Student

{

static class Program

{

///

/// 应用程序的主入口点。

///

[STAThread]

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new MainForms());

}

}

}

using System;

using System.Collections.Generic;

using System.Text;

namespace SchoolMIS.UI.Student

{

class GlobalInfo

{

private static bool isLogin = false;

private static string stuName;

private static string stuID;

public static bool IsLogin

{

get

{

return isLogin;

}

set

{

isLogin = value;

}

}

public static string StuName

{

get

{

return stuName;

}

set

{

stuName = value;

}

}

public static string StuID

{

get

{

return stuID;

}

set

{

stuID = value;

}

}

}

}

主界面:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace SchoolMIS.UI.Student

{

public partial class MainForms : Form

{

public MainForms()

{

InitializeComponent();

}

private void mainMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)

{

}

private void stuLogin_Click(object sender, EventArgs e)

{

LoginForm frmLogin = new LoginForm();

frmLogin.ShowDialog();

if (GlobalInfo.IsLogin)

{

this.ChangeMenuState();

}

}

private void ChangeMenuState()

{

//改变菜单的时使能状态

this.menuCourse.Enabled = !this.menuCourse.Enabled;

this.stuLogin.Enabled = !this.stuLogin.Enabled;

this.stuLogout.Enabled = !this.stuLogout.Enabled;

}

private void stuLogout_Click(object sender, EventArgs e)

{

GlobalInfo.StuID = String.Empty;

GlobalInfo.StuName = String.Empty;

GlobalInfo.IsLogin = false;

MessageBox.Show("成功退出本系统", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

this.ChangeMenuState();

}

private void stuExit_Click(object sender, EventArgs e)

{

Application.Exit();

}

private void courseAll_Click(object sender, EventArgs e)

{

AllCourseForm allCourseForm = new AllCourseForm();

allCourseForm.MdiParent = this;

allCourseForm.Show();

}

private void courseSelected_Click(object sender, EventArgs e)

{

SelectedCourseForm selectedCourseForm = new SelectedCourseForm();

selectedCourseForm.MdiParent = this;

selectedCourseForm.Show();

}

}

}

程序实现如图:

首先进入登录界面:

登录系统:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using SchoolMIS.DataAccess.Student.SQLServer;

namespace SchoolMIS.UI.Student

{

public partial class LoginForm : Form

{

public LoginForm()

{

InitializeComponent();

}

private void btnOK_Click(object sender, EventArgs e)

{

if (this.txtStuNum.Text.Trim() == "")

{

MessageBox.Show("请输入您的学号", "错误提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);

}

else if (this.txtStuPassword.Text.Trim() == "")

{

MessageBox.Show("请输入您的密码", "错误提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);

}

else

{

StudentDB stuDbAccess = new StudentDB();

string stuName = stuDbAccess.Login(txtStuNum.Text.Trim(), txtStuPassword.Text.Trim());

if (stuName != String.Empty)

{

GlobalInfo.StuName = stuName;

GlobalInfo.StuID = this.txtStuNum.Text;

GlobalInfo.IsLogin = true;

this.Dispose();

}

else

{

MessageBox.Show("用户名或者密码错误,请重新输入。", "错误提示:");

}

}

}

private void btnCancel_Click(object sender, EventArgs e)

{

this.txtStuNum.Text = "";

this.txtStuPassword .Text ="";

}

private void LoginForm_Load(object sender, EventArgs e)

{

}

}

}

所有课程:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

using SchoolMIS.DataAccess.Student.SQLServer;

namespace SchoolMIS.UI.Student

{

public partial class AllCourseForm : Form

{

BindingSource bsAllCourse;

public AllCourseForm()

{

InitializeComponent();

}

int n=0;

public int N

{

get { return n; }

set { n = value; }

}

public void InitialData()

{

CourseDB courseDB = new CourseDB();

DataSet courseDataSet = courseDB.GetAllCourse();

bsAllCourse = new BindingSource();

bsAllCourse.DataSource = courseDataSet.Tables["course"];

this.dgvAllCourse.DataSource = bsAllCourse;

this.txtCourseAddress.DataBindings.Add(new Binding("Text", bsAllCourse, "上课地点"));

this.txtCourseCredit.DataBindings.Add(new Binding("Text", bsAllCourse, "学分"));

this.txtCourseID.DataBindings.Add(new Binding("Text", bsAllCourse, "编号"));

this.txtCourseName.DataBindings.Add(new Binding("Text", bsAllCourse, "名称"));

this.txtCourseTime.DataBindings.Add(new Binding("Text", bsAllCourse, "上课时间"));

this.txtTeacherName.DataBindings.Add(new Binding("Text", bsAllCourse, "教师"));

this.ChangeButtonState();

if (this.bsAllCourse.Position == -1)

{

this.btnChoose.Enabled = false;

}

}

private void ChangeButtonState()

{

if (this.bsAllCourse.Position == this.bsAllCourse.Count - 1)

{

this.btnNext.Enabled = false;

}

else

{

this.btnNext.Enabled = true;

}

if (this.bsAllCourse.Position == 0)

{

this.btnPre.Enabled = false;

}

else

{

this.btnPre.Enabled = true;

}

}

private void AllCourseForm_Load(object sender, EventArgs e)

{

InitialData();

}

private void btnPre_Click(object sender, EventArgs e)

{

this.bsAllCourse.MovePrevious();

this.ChangeButtonState();

}

private void btnNext_Click(object sender, EventArgs e)

{

this.bsAllCourse.MoveNext();

this.ChangeButtonState();

}

private int GetCourseID(int rowIndex)

{

return (int)((DataTable)bsAllCourse.DataSource).Rows[rowIndex][0];

}

private void btnChoose_Click(object sender, EventArgs e)

{

CourseDB courseDB = new CourseDB();

bool addResult = courseDB.AddSelectedCourse(GlobalInfo.StuID, GetCourseID(bsAllCourse.Position));

if (addResult)

{

MessageBox.Show("您已经成功选择该课程,请注意学习!");

}

else

{

MessageBox.Show("操作失败,请稍后重试!");

}

}

private void refreshDataSource()

{

CourseDB courseDB = new CourseDB();

DataSet courseDataSet = courseDB.GetSelectedCourse(GlobalInfo.StuID);

bsAllCourse.DataSource = courseDataSet.Tables["course"];

}

}

}

登录过程中,会出现以下几个界面:

如图:

选修课程:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

using SchoolMIS.DataAccess.Student.SQLServer;

namespace SchoolMIS.UI.Student

{

public partial class SelectedCourseForm : Form

{

BindingSource bsAllCourse;

public SelectedCourseForm()

{

InitializeComponent();

}

private void SelectedCourseForm_Load(object sender, EventArgs e)

{

InitialData();

}

private void InitialData()

{

CourseDB courseDB = new CourseDB();

DataSet courseDataSet = courseDB.GetSelectedCourse(GlobalInfo.StuID);

bsAllCourse = new BindingSource();

bsAllCourse.DataSource = courseDataSet.Tables["course"];

this.dgvAllCourse.DataSource = bsAllCourse;

}

private void ChangeButtonState()

{

if (this.bsAllCourse.Position == -1)

{

this.btnUnChoose.Enabled = false;

this.btnNext.Enabled = false;

this.btnPre.Enabled = false;

}

if (this.bsAllCourse.Position == this.bsAllCourse.Count - 1)

{

this.btnNext.Enabled = false;

}

else

{

this.btnNext.Enabled = true;

}

if (this.bsAllCourse.Position == 0)

{

this.btnPre.Enabled = false;

}

else

{

this.btnPre.Enabled = true;

}

}

private void btnPre_Click(object sender, EventArgs e)

{

this.bsAllCourse.MovePrevious();

this.ChangeButtonState();

}

private void btnNext_Click(object sender, EventArgs e)

{

this.bsAllCourse.MoveNext();

this.ChangeButtonState();

}

private void btnUnChoose_Click(object sender, EventArgs e)

{

CourseDB courseDB = new CourseDB();

bool deleteResult = courseDB.DeleteSelectedCourse(Convert.ToInt32(this.txtCourseID.Text));

if (deleteResult)

{

MessageBox.Show("您已经成功放弃了该课程!");

}

else

{

MessageBox.Show("操作失败,请稍后重试!");

}

this.ChangeButtonState();

}

private void txtCourseID_TextChanged(object sender, EventArgs e)

{

}

private void dgvAllCourse_CellContentClick(object sender, DataGridViewCellEventArgs e)

{

}

private void txtCourseName_TextChanged(object sender, EventArgs e)

{

}

private void txtCourseTime_TextChanged(object sender, EventArgs e)

{

}

private void txtCourseAddress_TextChanged(object sender, EventArgs e)

{

}

private void txtTeacherName_TextChanged(object sender, EventArgs e)

{

}

private void txtCourseCredit_TextChanged(object sender, EventArgs e)

{

}

}

}

进入所有课程能够界面:

具体操作情况如图:

退出课程界面后:

进入选课列表:

数据库连接:

using System;

using System.Collections.Generic;

using System.Text;

namespace SchoolMIS.DataAccess.Student.SQLServer

{

class Constants

{

//数据库链接字符

public static readonly string ConnString = @"server=(local);user id=sa;password=1234;Initial Catalog=Student;";

//验证学生登录

public static readonly string StuLogin = @"select stuName from student

where stuID=@stuID and stuPassword=@stuPassword";

public static readonly string GetAllCourse = @"SELECT courseID AS 编号,

courseName AS 名称,

courseTime AS 上课时间 ,

courseAddress AS 上课地点,

courseCredit AS 学分,

courseTeacher AS 教师

FROM course";

public static readonly string AddSelectedCourse = @"INSERT INTO stuCourse(stuID,courseID) VALUES(@stuNum,@courseID)";

public static readonly string IsSelectedCourse = @"SELECT COUNT(scID) FROM stuCourse WHERE stuID=@stuNum AND courseID=@courseID";

public static readonly string GetSelectedCourse = @"SELECT stuCourse.scID AS 选课编号,

courseName AS 名称,

courseTime AS 上课时间,

courseAddress AS 上课地点,

courseCredit AS 学分,

courseTeacher AS 教师

FROM course,stuCourse

WHERE stuCourse.stuID=@stuNum AND course.courseID=stuCourse.courseID";

public static readonly string DeleteSelectedCourse = @"DELETE FROM stuCourse WHERE scID=@scID";

}

}

课程信息:

using System;

using System.Collections.Generic;

using System.Text;

using System.Data;

using System.Data.SqlClient;

namespace SchoolMIS.DataAccess.Student.SQLServer

{

public class CourseDB

{

public DataSet GetAllCourse()

{ //建立数据库连接对象

SqlConnection conn = new SqlConnection(Constants.ConnString);

//建立数据库命令对象

SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.GetAllCourse;

cmd.CommandType = CommandType.Text;

SqlDataAdapter dataAdapter = new SqlDataAdapter();

dataAdapter.SelectCommand = cmd;

DataSet allCourse = new DataSet();

try

{

dataAdapter.Fill(allCourse, "course");

return allCourse;

}

catch (SqlException ex)

{

return null;

}

finally

{

if (conn.State == ConnectionState.Open)

{

conn.Close();

}

}

}

public bool AddSelectedCourse(string stuID, int courseID)

{

if (this.IsSelectedCourse(stuID, courseID))

{

return true;

}

else

{

SqlConnection conn = new SqlConnection(Constants.ConnString);

SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.AddSelectedCourse;

cmd.CommandType = CommandType.Text;

SqlParameter paramStuNum = new SqlParameter("@stuID", stuID);

cmd.Parameters.Add(paramStuNum);

SqlParameter paramCourseID = new SqlParameter("@courseID", courseID);

cmd.Parameters.Add(paramCourseID);

try

{

conn.Open();

cmd.ExecuteNonQuery();

conn.Close();

return true;

}

catch (SqlException ex)

{

return false;

}

finally

{

if (conn.State == ConnectionState.Open)

{

conn.Close();

}

}

}

}

public DataSet GetSelectedCourse(string stuNum)

{

SqlConnection conn = new SqlConnection(Constants .ConnString );

SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.GetSelectedCourse;

cmd.CommandType = CommandType.Text;

SqlParameter paramStuNum = new SqlParameter("@stuNum", stuNum);

cmd.Parameters.Add(paramStuNum);

SqlDataAdapter dataAdapter = new SqlDataAdapter();

dataAdapter.SelectCommand = cmd;

DataSet selectedCourse = new DataSet();

try

{

dataAdapter.Fill(selectedCourse, "course");

return selectedCourse;

}

catch

{

return null;

}

finally

{

if (conn.State == ConnectionState.Open)

{

conn.Close();

}

}

}

public bool DeleteSelectedCourse(int scID)

{

SqlConnection conn = new SqlConnection(Constants.ConnString);

SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.DeleteSelectedCourse;

cmd.CommandType = CommandType.Text;

SqlParameter paramSCID = new SqlParameter("@scID", scID );

cmd.Parameters.Add(paramSCID);

try

{

conn.Open();

cmd.ExecuteNonQuery();

conn.Close();

return true;

}

catch (SqlException ex)

{

return false;

}

finally

{

if (conn.State == ConnectionState.Open)

{

conn.Close();

}

}

}

public bool IsSelectedCourse(string stuNum, int courseID)

{

SqlConnection conn=new SqlConnection (Constants.ConnString );

SqlCommand cmd=new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.IsSelectedCourse;

cmd.CommandType = CommandType.Text;

SqlParameter paramStuNum = new SqlParameter("@stuNum", stuNum);

cmd.Parameters.Add(paramStuNum);

SqlParameter paramCourseID = new SqlParameter("@courseID", courseID);

cmd.Parameters.Add(paramCourseID);

try

{

conn.Open ();

int result=(int)cmd.ExecuteScalar ();

conn.Close ();

if(result ==1)

{

return true ;

}

else

{

return false ;

}

}

catch (SqlException ex)

{

return false ;

}

finally

{

if(conn.State ==ConnectionState.Open )

{

conn.Close ();

}

}

}

}

}

学生信息:

using System;

using System.Collections.Generic;

using System.Text;

using System.Data;

using System.Data.SqlClient;

namespace SchoolMIS.DataAccess.Student.SQLServer

{

public class StudentDB

{

public string Login(string stuID, string stuPsw)

{

//建立数据库链接对象

SqlConnection conn = new SqlConnection(Constants.ConnString);

//建立数据库命令对象

SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;

cmd.CommandText = Constants.StuLogin;

cmd.CommandType = CommandType.Text;

//添加参数给数据命令

SqlParameter prmStuNum = new SqlParameter("@stuID", stuID);

SqlParameter prmStuPassword = new SqlParameter("@stuPassword", stuPsw);

cmd.Parameters.Add(prmStuNum);

cmd.Parameters.Add(prmStuPassword);

try

{

conn.Open();

object stuName = cmd.ExecuteScalar();

if (stuName != null)

{

return stuName.ToString();

}

else

{

return String.Empty;

}

}

catch (SqlException ex)

{

return String.Empty;

}

finally

{

//确保数据库连接被关闭

if (conn.State == ConnectionState.Open)

{

conn.Close();

}

}

}

}

}

//------------------------------------------------------------------------------

//

// 此代码由工具生成。

// 运行库版本:2.0.50727.832

//

// 对此文件的更改可能会导致不正确的行为,并且如果

// 重新生成代码,这些更改将会丢失。

//

//------------------------------------------------------------------------------

namespace SchoolMIS.DataAccess.Properties {

[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]

internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

public static Settings Default {

get {

return defaultInstance;

}

}

[global::System.Configuration.ApplicationScopedSettingAttribute()]

[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]

[global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Student.mdf;Integrated " +

"Security=True;User Instance=True")]

public string StudentConnectionString {

get {

return ((string)(this["StudentConnectionString"]));

}

}

}

}

具体退出界面在上图中皆有体现。

以上即为本系统的详细设计过程。

第四章 总结

本次实习任务为利用所学的计算机知识开发出一套完整的管理系统。实习期间让我学会了很多,当然也发现了自己的许多不足。

该系统利用了C#语言的相关知识,简单的设计了一个学生选课所需的管理系统。在设计的过程中,由于编者现有知识掌握的有限以及时间的仓促,所以整个系统看上去一目了然,比较简单。但在设计的过程中也掌握了许多,特别是在探究算法时,必须具备一定的逻辑知识等。

然而与上学期课程设计比较,本次设计中,运用C#结合SQL Server 2000开发的系统,减少了代码的入录,实现了一些只用C#编写不能实现的功能。若只用C#编写程序对一些数据资料都应输入到相应的代码中,若数据资料稍一多,使代码文件看起来繁琐,某些代码重复使用,重复书写,工作量大。而通过SQL Server 2000创建数据库,建立数据资料,运用代码C#与数据库建立连接。SqlDataAdapter 作为数据适配器可以将数据从数据库中取出来,放到DataSet以供程序调用;SqlCommand 和SqlDataReader 可以执行简单的查询和读取数据。这样建立的系统资料更加完备充实。浏览也方便,修改资料也方便。

结合这次设计,我会在以后的学习过程中更加认真学好每一门计算机语言,认真钻研其中的开发理论知识,相信在不久的将来,我会将该系统完善成一个很好的应用软件!

参考文献

[1] 郭常圳. C#网络应用开发例学有实践. 清华大学出版社. 2006

[2] 邵鹏鸣. VisualC#程序设计基础教程. 清华大学出版社. 2005

[3] 王晟 邓远辉. VisualC++.NET数据开发经典案例解析. 清华大学出版社.2006

推荐访问:管理系统 教务 通用

版权所有:首考文秘网 2015-2024 未经授权禁止复制或建立镜像[首考文秘网]所有资源完全免费共享

Powered by 首考文秘网 © All Rights Reserved.。备案号:冀ICP备15026071号-91