classexam.cs

来自「学生类:Student 教师类:Teacher 主任:AdminTeache」· CS 代码 · 共 57 行

CS
57
字号
using System;
using DataAccess;
using Forms;
using System.Data;
using System.Data.SqlClient;

namespace BusinessRule
{
	/// <summary>
	/// ClassExam 的摘要说明。
	/// 1.	储存一次班级考试的信息,
	///		成员变量包括班级综合考试信息和存有该班所有学生本次考试信息的数据表
	///	2.	添加一次新的考试时,可以调用默认构造方法
	///	3.	实例化一个已经存在的考试实例时,传入一条DataRow,存有班级考试信息表中本次考试的信息	
	///	4.	成员变量studentsExamInfo数据表中储存学生考试信息表中所有关于本次考试的信息 
	/// </summary>
	public class ClassExam
	{
		private int examID;			//考试编号
		private string claID;		//班级编号
		private string teaID;		//任课教师编号
		private bool Type;			//考试类型
		private string examDate;	//考试日期
		private int NotAttend;		//未参加人数
		private int Pass;			//通过率
		private float Average;		//平均分
		private float MaxScore;		//最高分
		private float MinScore;		//最低分
		private string Remark;		//备注
		private DataTable studentsExamInfo;	//学生考试信息数据表


		public ClassExam()
		{
			//默认构造方法
		}

		public ClassExam(DataRow dr)
		{
			this.examID = (int)dr["examID"];
			this.claID = (string)dr["claID"];
			this.teaID = (string)dr["teaID"];
			this.Type = (bool)dr["Type"];
			string date = dr["examDate"].ToString();
			string[] examDate = date.Split(new char[] {' '});
			this.examDate = examDate[0];
			this.NotAttend = (int)dr["NotAttend"];
			this.Pass = (int)dr["Pass"];
			this.Average = float.Parse(dr["Average"].ToString());
			this.MaxScore = float.Parse(dr["MaxScore"].ToString());
			this.MinScore = float.Parse(dr["MinScore"].ToString());
			this.Remark = (string)dr["Remark"];
			this.studentsExamInfo = jimmy.GetStuExamInfoByExamID(this.examID);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?