📄 student.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using BusinessEntity;
using PersistenceLayer;
/// <summary>
/// Student 的摘要说明
/// </summary>
///
namespace Student{
public partial class Student
{
public Student()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public DataTable GetReportInfo()//成功
{
//返回所有的报告信息
//至少要有报告的名称和博士学术报告申请编号ApplyReportID两个字段
//ReportID
// ReportName
RetrieveCriteria rc = new RetrieveCriteria(typeof(ReportInfoEntity));
rc.AddSelect(ReportInfoEntity.__REPORTID);
rc.AddSelect(ReportInfoEntity.__REPORTNAME);
DataTable ReportTable = rc.AsDataTable();
if (ReportTable.Rows.Count > 0)
{
return ReportTable;
}
return null;
}
/*
public SqlDataReader GetJoinActivStu(int id)
{
//id为该报告的id
//根据博士学术报告申请编号 ApplyReportID(id)返回
博士学术报告申请编号 ApplyReportID
学术报告名称 ReportName
报告人 ReportSpeaker
报告内容 ReportConent
备注 Remark
//return null;
}
*/
public static DataRow GetSingleReportInfo(int id)//成功
{
//根据学术报告申请编号ReportID(id)返回
//该报告的详细信息;DataRow中必须包含以下几项
/*
* ReportID
ReportName
ReportSpeaker
ReportDate
ReportReplace
ReportConent
ReportType
Remark
* */
string sql = "select * from ReportInfo where ReportID=" + id.ToString();
DataTable ReportTable=Query.ProcessSql(sql,"GradMIS_Data");
if (ReportTable.Rows.Count > 0)
{
DataRow ReportRow = ReportTable.Rows[0];
return ReportRow;
}
return null;
}
public static DataTable GetIndividualReportInfo( string StuID)//失败
{
//通过学生的学号将学生参加过的所有学术报告,以datatable的形式返回;
//StuID:学生的学号;
//DataTable中必须要有以下字段
/*
* ReportID
ReportName
ReportSpeaker
ReportDate
ReportReplace
ReportConent
ReportType
* ReportInfo.Remark;
* JoinReportStu.Remark;
* */
string Sql = "select ReportInfo.ReportID,ReportName,ReportSpeaker,ReportDate,ReportReplace,ReportConent,ReportType,ReportInfo.Remark as ReportRemark,JoinReportStu.Remark as JoinReportRemark from ReportInfo,JoinReportStu where JoinReportStu.StuID='"+StuID+"' and JoinReportStu.ReportID=ReportInfo.ReportID ";
DataTable StudentTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (StudentTable.Rows.Count > 0)
{
return StudentTable;
}
return null;
}
public static DataTable GetActivityInfo()//成功
{
//该函数返回所有活动记录
//所返回的DataTable中必须有以下几个字段
/*
* ActivityID int not null,
ActivityName char(10) null,
*/
RetrieveCriteria rc = new RetrieveCriteria(typeof(ActivityInfoEntity));
rc.AddSelect(ActivityInfoEntity.__ACTIVITYID);
rc.AddSelect(ActivityInfoEntity.__ACTIVITYNAME);
DataTable ActivityTable = rc.AsDataTable();
if (ActivityTable.Rows.Count > 0)
{
return ActivityTable;
}
return null;
}
public static DataRow GetSingleActivityinfo(int ActivityID )//成功
{
//ActivityID是活动的ID
//该函数返回该id下的详细信息
//DataRow中必须包含以下几个字段
/*
* ActivityID int not null,
ActivityName char(10) null,
ActivityDate datetime null,
ActivityContent char(10) null,
ActivityPlace char(10) null,
ActivityOutlay char(10) null,
ActivityType char(10) null,
Remark REMARK null,
*/
RetrieveCriteria rc = new RetrieveCriteria(typeof(ActivityInfoEntity));
Condition c = rc.GetNewCondition();
c.AddEqualTo(ActivityInfoEntity.__ACTIVITYID, ActivityID);
DataTable ActivityTable = rc.AsDataTable();
if (ActivityTable.Rows.Count > 0)
{
DataRow ActivityRow = ActivityTable.Rows[0];
return ActivityRow;
}
return null;
}
public static DataTable GetIndividualActivityInfo(string StuID)//失败
{//学生已经参加过的活动的所有信息;
//通过学生的学号将学生参加过的所有学术报告,以datatable的形式返回;
//StuID:学生的学号;
//DataTable中必须要有以下字段
/*
* ActivityID int not null,
ActivityName char(10) null,
* */
// string Sql = "select ActivityInfo.ActivityID,ActivityName,ActivityDate,ActivityContent,ActivityPlace,ActivityOutlay,ActivityType,ActivityInfo.Remark as ActivityRemark,JoinActivStu.Remark as JoinRemark from ActivityInfo,JoinActivStu where ActivityInfo.ActivityID=JoinActivStu.ActivityID and JoinActivStu.StuID='" + StuID +"'";
string Sql = "select ActivityInfo.ActivityID,ActivityName from ActivityInfo,JoinActivStu where ActivityInfo.ActivityID=JoinActivStu.ActivityID and JoinActivStu.StuID='" + StuID + "'";
DataTable JoinActivStuTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (JoinActivStuTable.Rows.Count > 0)
{
return JoinActivStuTable;
}
return null;
}
public static DataRow GetIndividualActivitySingleInfo(string StuID, int ActivityID)
{
//获得单条有关该学生参加过的活动的记"
string Sql="select ActivityInfo.ActivityID,ActivityName,ActivityDate,ActivityContent,ActivityPlace,ActivityOutlay,ActivityType,ActivityInfo.Remark as ActivityRemark,JoinActivStu.Remark as JoinRemark from ActivityInfo,JoinActivStu where ActivityInfo.ActivityID=JoinActivStu.ActivityID and JoinActivStu.StuID='"+StuID+"'and ActivityInfo.ActivityID="+ActivityID.ToString();
DataTable JoinActivStuTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (JoinActivStuTable.Rows.Count > 0)
{
return JoinActivStuTable.Rows[0];
}
return null;
}
public static DataTable GetExcellInfoValid()//成功
{
//获取有效的争先评优信息表的列清单
//返回的DataTable中必须有下面的三项
/*
* 争先评优编号 ExcellenceInfoID
争先评优名称 ExcellenceName
* 争先评优下载文件名 FileName;
备注 Remark
* */
RetrieveCriteria rc = new RetrieveCriteria(typeof(ExcellInfoEntity));
Condition c = rc.GetNewCondition();
c.AddEqualTo(ExcellInfoEntity.__ENABLE, 1);
rc.AddSelect(ExcellInfoEntity.__EXCELLENCEINFOID);
rc.AddSelect(ExcellInfoEntity.__EXCELLENCENAME);
rc.AddSelect(ExcellInfoEntity.__FILENAME);
rc.AddSelect(ExcellInfoEntity.__REMARK);
DataTable ExcellTable = rc.AsDataTable();
if (ExcellTable.Rows.Count > 0)
{
return ExcellTable;
}
return null;
}
public static DataTable GetExcellInfoInvalid()//成功;
{
//返回所有无效的争先评优信息表的列清单
//返回的DataTable中必须有下面的三项
/*
* 争先评优编号 ExcellenceInfoID
争先评优名称 ExcellenceName
备注 Remark
* */
RetrieveCriteria rc = new RetrieveCriteria(typeof(ExcellInfoEntity));
Condition c = rc.GetNewCondition();
c.AddEqualTo(ExcellInfoEntity.__ENABLE, 0);
rc.AddSelect(ExcellInfoEntity.__EXCELLENCEINFOID);
rc.AddSelect(ExcellInfoEntity.__EXCELLENCENAME);
rc.AddSelect(ExcellInfoEntity.__FILENAME);
rc.AddSelect(ExcellInfoEntity.__REMARK);
DataTable ExcellTable = rc.AsDataTable();
if (ExcellTable.Rows.Count > 0)
{
return ExcellTable;
}
return null;
}
public static bool SetExcellApp(string StuID, int ExcellenceInfoID, string ExcellenceResume,string FileName)//成功
{
/*如果成功返回true,否则返回false
*
* 学号 StuID
争先评优编号 ExcellenceInfoID
争先评优个人简历 ExcellenceResume
* 争先评优个人简历FileName
将这些项写到数据库中。
* */
//return false;//提交申请失败
//return true;//提交申请成功
ExcellAppEntity ExcellApp = new ExcellAppEntity();
ExcellApp.StuID = StuID;
ExcellApp.ExcellenceInfoID = ExcellenceInfoID;
ExcellApp.ExcellenceResume = ExcellenceResume;
ExcellApp.FileName = FileName;
try
{
ExcellApp.Save();
return true;
}
catch
{
return false;
}
}
public static DataTable GetExcellAppCheckedSuccess(string StuID)//成功
{
//获取已经评定通过的争先评优;
/*
* 争先评优编号 ExcellenceInfoID
* 争先评优名称 ExcellenceName
评定时间 GetExcellDate
争先是否评优审核 ExceIsChecked
备注 Remark
* */
string Sql = "select ExcellInfo.ExcellenceInfoID,ExcellenceName,GetExcellDate,IsChecked,ExcellApp.Remark,ExcellInfo.Remark from ExcellInfo,ExcellApp where ExcellInfo.ExcellenceInfoID=ExcellApp.ExcellenceInfoID and ExcellApp.StuID='" + StuID + " 'and ExcellApp.IsChecked=1";
DataTable ExcellAppCheckedTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (ExcellAppCheckedTable.Rows.Count > 0)
{
return ExcellAppCheckedTable;
}
return null;
}
public static DataTable GetExcellAppCheckedFailure(string StuID)//成功
{
//获取已经评定争先评优失败的结果;
/*
* 争先评优编号 ExcellenceInfoID
* 争先评优名称 ExcellenceName
评定时间 GetExcellDate
争先是否评优审核 ExceIsChecked
备注 Remark
* */
string Sql = "select ExcellInfo.ExcellenceInfoID,ExcellenceName,GetExcellDate,IsChecked,ExcellApp.Remark,ExcellInfo.Remark from ExcellInfo,ExcellApp where ExcellInfo.ExcellenceInfoID=ExcellApp.ExcellenceInfoID and ExcellApp.StuID='" + StuID + " 'and ExcellApp.IsChecked=2";
DataTable ExcellAppCheckedTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (ExcellAppCheckedTable.Rows.Count > 0)
{
return ExcellAppCheckedTable;
}
return null;
}
public static DataTable GetExcellAppCheckedDoing(string StuID)//成功
{
//获取正在进行争先评优的记录;
/*
* 争先评优编号 ExcellenceInfoID
* 争先评优名称 ExcellenceName
评定时间 GetExcellDate
争先是否评优审核 ExceIsChecked
备注 Remark
* */
string Sql = "select ExcellInfo.ExcellenceInfoID,ExcellenceName,GetExcellDate,IsChecked,ExcellApp.Remark,ExcellInfo.Remark from ExcellInfo,ExcellApp where ExcellInfo.ExcellenceInfoID=ExcellApp.ExcellenceInfoID and ExcellApp.StuID='" + StuID+ " 'and ExcellApp.IsChecked=0";
DataTable ExcellAppCheckedDoingTable = Query.ProcessSql(Sql, "GradMIS_Data");
if (ExcellAppCheckedDoingTable.Rows.Count > 0)
{
return ExcellAppCheckedDoingTable;
}
return null;
}
public static string GetExcellInfoName(int ExcellenceInfoID)//成功
{
//根据争先评优编号返回争先评优名称
/*
* 争先评优编号 ExcellenceInfoID
争先评优名称 ExcellenceName
* */
//return "按时的";
string ExcellInfoName;
RetrieveCriteria rc = new RetrieveCriteria(typeof(ExcellInfoEntity));
Condition c = rc.GetNewCondition();
c.AddEqualTo(ExcellInfoEntity.__EXCELLENCEINFOID, ExcellenceInfoID);
//rc.AddSelect(ExcellInfoEntity.__EXCELLENCENAME);
ExcellInfoEntity ExcellInfo = (ExcellInfoEntity)rc.AsEntity();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -