//查询所用试卷 //不需要参数 public DataSet QueryAllPaper() { DataBase DB = new DataBase(); string strsql = "SELECT *,CASE Papermr.PaperState WHEN 1 THEN '可用' ELSE '不可用' END AS state FROM Papermr,Coursemr where Papermr.CourseID=Coursemr.ID"; return DB.GetStrDataSet(strsql); }
//查询所有用户考试的试卷 public DataSet QueryUserPaperList() { DataBase DB = new DataBase(); string strsql = "SELECT distinct Usersmr.UserID,Usersmr.UserName,Usersmr.DepartmentId, Departmentmr.DepartmentId,Departmentmr.DepartmentName,UserAnswermr.UserID,UserAnswermr.PaperID,UserAnswermr.ExamTime,UserAnswermr.state,Papermr.PaperName FROM Usersmr,Departmentmr,UserAnswermr,Papermr where Usersmr.DepartmentId=Departmentmr.DepartmentId and Usersmr.UserID=UserAnswermr.UserID and UserAnswermr.PaperID=Papermr.PaperID order by UserAnswermr.ExamTime desc"; return DB.GetStrDataSet(strsql); }
//查询所用考试科目 //不需要带参数 public DataSet QueryCourse() { DataBase DB = new DataBase(); string strsql = "select * from Coursemr"; return DB.GetStrDataSet(strsql); }
//查询用户 //查询所用用户 //不需要参数 public DataSet QueryUsers() { DataBase DB = new DataBase(); string strsql = "SELECT Usersmr.UserID, Usersmr.UserName,Departmentmr.DepartmentName,Rolemr.RoleName FROM Usersmr,Departmentmr,Rolemr WHERE Usersmr.DepartmentId=Departmentmr.DepartmentId AND Usersmr.RoleId=Rolemr.RoleId"; //return DB.GetDataSet("Proc_UsersList"); return DB.GetStrDataSet(strsql); }
//查询所用成绩 //不需要参数 public DataSet QueryScore() { DataBase DB = new DataBase(); string strsql = "SELECT Usersmr.UserID, Usersmr.UserName,Scoremr.ID,Scoremr.Score,Scoremr.ExamTime,Scoremr.JudgeTime, Papermr.PaperID,Papermr.PaperName FROM Usersmr,Scoremr,Papermr where Usersmr.UserID=Scoremr.UserID and Scoremr.PaperID=Papermr.PaperID"; //return DB.GetDataSet("Proc_ScoreList"); return DB.GetStrDataSet(strsql); }
public DataSet QueryDepartment() { DataBase DB = new DataBase(); string sqlstr = "SELECT DepartmentId,DepartmentName FROM Departmentmr"; return DB.GetStrDataSet(sqlstr); }
//��ѯ���н�ɫ //����Ҫ���� public DataSet QueryRole() { DataBase DB = new DataBase(); string sqlstr = "SELECT Rolemr.RoleId,Rolemr.RoleName FROM Rolemr"; return DB.GetStrDataSet(sqlstr); }