【文章內(nèi)容簡介】
理:1. 院系添加:功能是添加一個新的院系操作:輸入院系名稱——輸入院系的簡介圖 18代碼實現(xiàn):public int addDepartment(Department department) throws Exception { StringBuffer sql=new StringBuffer()。 (insert into department )。 (()。 (d_no,d_name,d_introduction,d_ext1)。 ())。 (values)。 ((?,?,?,?))。 //(())。 String arr[]={(),(),(),0}。 return ExecuteSql((), arr)。 }2. 院系一覽:功能是瀏覽學校所有院系操作:單擊院系一覽圖 19代碼實現(xiàn): public ListDepartment queryDepartments(int pageSize, int pageNo) throws Exception { ListDepartment list=new ArrayListDepartment()。 StringBuffer sql=new StringBuffer()。 (select top +pageSize+ * )。 (from department where id not in )。 ((select top +(pageNo1)*pageSize+ )。 ( id from department order by id asc))。 ( order by id asc)。//desc //(())。 ResultSet rs=null。 try { rs=ExecuteQuerySql(())。 while (()) { Department department=new Department()。 ((id))。 ((d_no))。 ((d_name))。 ((d_introduction))。 (department)。 } } catch (Exception e) { throw e。 }finally{ Close(rs)。 } return list。 }3. 專業(yè)添加:功能是添加新的專業(yè)操作:選擇所屬院系——輸入專業(yè)名字——輸入專業(yè)介紹代碼實現(xiàn): public int addProfessional(Professional professional) throws Exception { StringBuffer sql=new StringBuffer()。 (insert into professional )。 (()。 (p_no,p_name,p_introduction,d_no,d_ext1)。 ())。 (values)。 ((?,?,?,?,?))。 //(())。 String arr[]={(),(), (),(),0}。 return ExecuteSql((), arr)。 }4. 專業(yè)一覽:功能是瀏覽所有的專業(yè)操作:單擊專業(yè)一覽代碼實現(xiàn): public ListProfessional queryProfessionals(int pageSize, int pageNo) throws Exception { ListProfessional list=new ArrayListProfessional()。 StringBuffer sql=new StringBuffer()。 ( select top +pageSize+ )。 ( ,p_no,p_name,p_introduction,d_name )。 ( from professional as p,department as d )。 ( where = and not in )。 ((select top +(pageNo1)*pageSize+ )。 ( id from professional order by id asc))。 ( order by id asc)。//desc// select top 5 ,p_no,p_name,p_introduction,d_name// from professional as p,department as d // where = and not in // (select top 10 id from professional order by id asc) order by id asc //(())。 ResultSet rs=null。 try { rs=ExecuteQuerySql(())。 while (()) { Professional professional=new Professional()。 ((id))。 ((d_no))。 ((p_no))。 ((d_name))。 ((p_name))。 ((p_introduction))。 (professional)。 } } catch (Exception e) { throw e。 }finally{ Close(rs)。 } return list。 }圖 20課程管理::功能是添加新的班級操作:選擇所屬院系——所屬專業(yè)——所屬年級——臨時班級(是/否)——輸入班級名稱代碼實現(xiàn):public int addGradeClass(GradeClass gradeClass) throws Exception { StringBuffer sql=new StringBuffer()。 (insert into gradeclass )。 (()。 (g_no,g_name,g_flag,p_no,d_no,g_ext1)。 ())。 (values)。 ((?,?,?,?,?,?))。 String arr[]={(),(),()+, (),(),()}。 return ExecuteSql((), arr)。 }:功能是添加新的課程操作:選擇院系——選擇專業(yè)——選擇班級——輸入課程名——選擇年級——學期——選修(是/否)——輸入課時——輸入學分——輸入人數(shù)——選擇代課老師代碼實現(xiàn)public int addCourse(Course course) throws Exception { S