📄 student.cs
字号:
using System;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using DataAccess;
using Forms;
namespace BusinessRule
{
/// <summary>
/// Student 的摘要说明。
/// 1. 新建一个学生实例时,才用默认构造方法
/// 2. 实例化一个已经存在的学生,需要学生编号作为参数
/// </summary>
public class Student //学生类
{
private int stuID = 0; //学员编号
private string stuName = null; //姓名
private bool stuSex = true; //性别
private string stuOrigin = null; //籍贯
private string stuNation = null; //民族
private string stuTelephone = null; //联系电话
private string stuAddress = null; //地址
private string stuPostcode = null; //邮编
private string stuGrade1 = null;
private string stuGrade2 = null;
private string stuGrade3 = null; //各期班级编号
private bool stuAt_School = true; //是否在校
private string stuRemark = null; //备注
private ArrayList studentFS = null; //学员期末考试信息
private ArrayList studentExam = null; //学员平时考试信息
public Student()
{
//默认构造方法
}
public Student(int stuID)
{
this.stuID = stuID;
//获得学生基本数据信息
SqlDataReader myRd = jimmy.GetStudentInfoByStuID(stuID);
myRd.Read();
this.stuName = myRd["stuName"].ToString();
this.stuSex = (bool)myRd["stuSex"];
this.stuOrigin = myRd["stuOrigin"].ToString();
this.stuNation = myRd["stuNation"].ToString();
this.stuTelephone = myRd["stuTelephone"].ToString();
this.stuAddress = myRd["stuAddress"].ToString();
this.stuPostcode = myRd["stuPostcode"].ToString();
this.stuGrade1 = ((myRd["stuGrade1"].ToString()).Equals("0000"))? "暂无" : myRd["stuGrade1"].ToString();
this.stuGrade2 = ((myRd["stuGrade2"].ToString()).Equals("0000"))? "暂无" : myRd["stuGrade2"].ToString();
this.stuGrade3 = ((myRd["stuGrade3"].ToString()).Equals("0000"))? "暂无" : myRd["stuGrade3"].ToString();
this.stuAt_School = (bool)myRd["stuAt_School"];
this.stuRemark = myRd["stuRemark"].ToString();
}
#region 为成员变量建立属性
//学员编号 只读属性
public int StuID
{
get
{
return this.stuID;
}
}
//姓名 读/写属性
public string StuName
{
get
{
return this.stuName;
}
set
{
this.stuName = value;
}
}
//性别 读/写属性
public bool StuSex
{
get
{
return this.stuSex;
}
set
{
this.stuSex = value;
}
}
//籍贯 读/写属性
public string StuOrigin
{
get
{
return this.stuOrigin;
}
set
{
this.stuOrigin = value;
}
}
//民族 读/写属性
public string StuNation
{
get
{
return this.stuNation;
}
set
{
this.stuNation = value;
}
}
//联系电话 读/写属性
public string StuTelephone
{
get
{
return this.stuTelephone;
}
set
{
this.stuTelephone = value;
}
}
//地址 读/写属性
public string StuAddress
{
get
{
return this.stuAddress;
}
set
{
this.stuAddress = value;
}
}
//邮编 读/写属性
public string StuPostcode
{
get
{
return this.stuPostcode;
}
set
{
this.stuPostcode = value;
}
}
//一期班级编号 读/写属性
public string StuGrade1
{
get
{
return this.stuGrade1;
}
set
{
this.stuGrade1 = value;
}
}
//二期班级编号 读/写属性
public string StuGrade2
{
get
{
return this.stuGrade2;
}
set
{
this.stuGrade2 = value;
}
}
//三期班级编号 读/写属性
public string StuGrade3
{
get
{
return this.stuGrade3;
}
set
{
this.stuGrade3 = value;
}
}
//是否在校 读/写属性
public bool StuAt_School
{
get
{
return this.stuAt_School;
}
set
{
this.stuAt_School = value;
}
}
//备注 读/写属性
public string StuRemark
{
get
{
return this.stuRemark;
}
set
{
this.stuRemark = value;
}
}
//学员期末考试信息 读/写属性
public ArrayList StudentFS
{
get
{
return this.studentFS;
}
set
{
this.studentFS = value;
}
}
//学员平时考试信息
public ArrayList StudentExam
{
get
{
return this.studentExam;
}
set
{
this.studentExam = value;
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -