Exemple #1
0
        private void ShowAllInfo()
        {
            DataBaseOperateClass2 objDataBaseOperateClass2 = new DataBaseOperateClass2();

            string SqlString = "Select * From School";
            dataGridView1.DataSource = objDataBaseOperateClass2.ShowTable(SqlString);
        }
Exemple #2
0
        //返回结果:
        public DataTable SearchCourse(CourseModel objCourseModel)
        {
            string SqlString = "Select * from Course where CourseNum='" + objCourseModel.CourseNum + "'";

              DataBaseOperateClass2 objDataBaseOperateClass2=new DataBaseOperateClass2();

            DataTable objDataTable;

            return objDataTable = objDataTable = objDataBaseOperateClass2.ShowTable(SqlString);
        }
Exemple #3
0
        public DataTable SearchSchool(SchoolModel objSchoolMolel)
        {
            string SqlString = "Select SchNum AS 学校代码, SchName AS 校区 From School";

                    DataBaseOperateClass2 objDataBase = new DataBaseOperateClass2();

                    DataTable objDataTable;

                    return objDataTable = objDataBase.ShowTable(SqlString);
        }
Exemple #4
0
        public DataTable ScoreStuSearch(LoginUserModel objLoginUserModel)
        {
            string SqlStringStu="Select SelCourse.StuNum AS 学号,StuName AS 姓名 ,CourseName As 课程,SelCourse.Score AS 成绩 From SelCourse Join Student on Student.StuNum=SelCourse.StuNum join Course on Course.CourseNum=SelCourse.CourseNum Where SelCourse.StuNum='"+objLoginUserModel.UserId+"'";

                DataBaseOperateClass2 objDataBaseOperate2 = new DataBaseOperateClass2();

                DataTable objDataTable;

                return objDataTable = objDataBaseOperate2.ShowTable(SqlStringStu);
        }
Exemple #5
0
        public DataTable ScoreSearch(ClassModel objClassModel)
        {
            SqlString += " Where 班级='"+ objClassModel.ClaName+"'Or 学号='"+objClassModel.StuNum+"'";

                DataBaseOperateClass2 objDataBase = new DataBaseOperateClass2();

                DataTable objDataTable;

                return objDataTable = objDataBase.ShowTable(SqlString);
        }
Exemple #6
0
        public DataTable CheckStuSelectCourseResult(SelCourseModel objSelCourseModel)
        {
            string SqlString = "select Student.StuNum AS 学号,Class.ClaName AS 班级,StuName AS 姓名,Course.CourseName AS 所选课程,SelCourse.CourseNum AS 课程编号,Credit AS 学分 from Student join Class on Student.ClaNum=Class.ClaNum join SelCourse on Student.StuNum=SelCourse.StuNum join Course on SelCourse.CourseNum=Course.CourseNum Where SelCourse.StuNum=@StuNum";

                SqlParameter[] parms ={
                                        new SqlParameter("@StuNum",objSelCourseModel.StuNum)
                                      };

                DataBaseOperateClass2 objDataBase = new DataBaseOperateClass2();

                DataTable objDataTable;

                return objDataTable = objDataBase.ShowTable(SqlString, parms);
        }