内容发布更新时间 : 2024/12/22 14:21:25星期一 下面是文章的全部内容请认真阅读。
6.2系统界面
1 系统的主界面
图6-2 系统主界面
部分设计代码如下: namespace 教务管理系统 {
public MainForm() {
InitializeComponent(); }
protected override void Dispose( bool disposing ) {
if( disposing ) {
if (components != null) {
components.Dispose(); } }
base.Dispose( disposing ); }
private bool checkChildFrmExist(string childFrmName) {
foreach(Form childFrm in this.MdiChildren) {
if(childFrm.Name == childFrmName) {
if(childFrm.WindowState == FormWindowState.Minimized)
childFrm.WindowState = FormWindowState.Normal; childFrm.Activate(); return true; } }
return false; }
private void menuItem2_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
ClassInfo newFrm=new ClassInfo(); newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem3_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
StudentInfo newFrm=new StudentInfo(); newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem4_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
CourseInfo newFrm=new CourseInfo(); newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem6_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
}
}
CourseElect newFrm=new CourseElect(); newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem7_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
CurriculumSchedule newFrm=new CurriculumSchedule(\ newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem8_Click(object sender, System.EventArgs e) {
if (this.checkChildFrmExist(\ {
return; }
ScoreInput newFrm=new ScoreInput(); newFrm.MdiParent = this; newFrm.Show(); }
private void menuItem11_Click(object sender, System.EventArgs e) {
this.Close(); }
2学生选课界面界面
图6-3 学生选课界面
部分程序代码如下:
private void CourseElect_Load(object sender, System.EventArgs e) {
dataGrid1.DataSource=this.electTable;
string strConn=\Security=SSPI;database=eisbook;\
SqlConnection cn=new SqlConnection(strConn); cn.Open();
string sql=\课序号,a.课程编号,b.课程名称,b.教师,b.开课系别,\
+\上课地点,a.上课时间天,a.上课时间节,b.拼音码\ +\课程表a,课程信息b\
+\本学期课程='Y')and(a.课程编号=b.课程编号)\ SqlDataAdapter da2=new SqlDataAdapter(sql,cn); da2.Fill(this.courseTable);
this.dv=courseTable.DefaultView; dataGrid2.DataSource=dv; }
private void ShowInfo()// {
string strConn=\Security=SSPI;database=eisbook;\
SqlConnection cn=new SqlConnection(strConn); cn.Open();
SqlCommand cmd=cn.CreateCommand();
cmd.CommandText=\姓名,b.班级名称,a.学籍编号from 学生信息a,班级信息b \
+\班级编号=b.班级编号)and(学号='\
SqlDataReader dr=cmd.ExecuteReader();