下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
Withthedevelopmentoftheenrollingnumber,thedatafordailyregistryisincreasing,too.Andalwaysweshouldgotoclassroomtoenroll.Althoughthismethoddirectly,butresultinblindnessofthecourseenrollmentandregistrydataprocessingoftheheavy.Inordertoreducetheworkregistry,andbettereachstudenttochoosetheirownfavoritesubjects.Thissystemisspecialfortheon-linecoursechoosingtodesignbothfromtheaspectofthestudentandtheteacher.Thestudentcanchoosethecourseindependentlyandtheteachercanmanagetheinformationoftheannouncingcourse,also.ThispapergivesthebasicdesignideaoftheBrowser/ServerstructurebasedonlinecourseelectsystembyyzingthecharacteristicoftheBrowser/Serverstructureandcombiningwiththeactualpublicelectivecoursesconditionsofourschool.Itintroducesthefunctionmoduleanddatabasedesignbriefly,followedbyadiscussionondatabaseaccessingtechnologyandtheactivepagetechnologyofthecourseelectsystembasedonASP.NETandSQLServer2000.Byusingthissystem,studentscanelectcoursesonlineefficiently.ThisBrowser/ServerstructuresystemisdevelopedunderVS.NETtforminWindowsXPoperatingsystem,usingC#asASP.NETdevelopmentlanguageandSQLServer2000asthedatabase.Thissystemisofhighersecurityandbetterperformance.Thecharacterstring,whichisusedtoconnectingtothedatabase,canbemodifiedatanytimeinthefile“web.config”.Thestringisencodedandencrypted,increasingflexibilityofthesystemandsecurityofthedatabase.Incode,makinguseofstoredprocedureandminimizingthedatabaseopeningtimetoimproveperformanceofthesystem.Thispaperincludesthesystemysis,themaindesigning,thedatabasedesigning,thefunctiondesigningand,beforethis,somebasicknowledgeandpresentdevelopmentoftheprogramsmentionedabove. 第一章引 第二章系統(tǒng)分析與總體設(shè) 第三章數(shù)據(jù)庫設(shè)計與實 第四章公共類與公共頁面設(shè) WEB.CONFIG頁面設(shè) 數(shù)據(jù)庫連接操作類—DB 工具類MYUTILITY 第五章系統(tǒng)說明 第6章總 參考文 第一課題研究的目ASP.NET的頁和SQLServer大型的數(shù)據(jù)庫課題研究的意、來人們使用傳統(tǒng)人工的方式管理文件,這種管理方式存在著許多缺點,如:效率低、作為計算機應(yīng)用的一部分,使用計算機對選課信息進行管理,有著手工管理所無法比擬的優(yōu)點.例如:索迅速、找方便、靠性高、量大、性、長成本ASP.NET 第二統(tǒng)系統(tǒng)分1。通用操2。用戶所具有功話,E-mail系統(tǒng)總體設(shè)用戶登用戶登 模用戶登錄驗證模塊驗證用戶名和,并根據(jù)不同的用戶類型,跳轉(zhuǎn)到對應(yīng)的頁面課程的上間地點友好的界面和操作。評分模塊用于教師用戶給選修該教師開設(shè)的課程模第三章數(shù)據(jù)庫設(shè)計與實數(shù)據(jù)庫系統(tǒng)分NM選上課地點時 選上課地點時屬M屬1E—R前導(dǎo)課程開課教師前導(dǎo)課程開課教師 編上上數(shù)據(jù)庫邏輯設(shè)E—R圖轉(zhuǎn)換為關(guān)系模型的過程,即將所有實體和關(guān)系轉(zhuǎn)換成教學(xué)樓(ID,教學(xué)樓名稱)教室(教室ID,教學(xué)樓ID,教室名稱課程時間地點(課程編號,開始,結(jié)束,上間,上課教室ID)數(shù)據(jù)庫物理實庫軟件實現(xiàn)這樣的結(jié)構(gòu)。本系統(tǒng)中數(shù)據(jù)庫采用SQLServer2000作為數(shù)據(jù)庫首先我們在SQLServer2000的“企業(yè)管理器”創(chuàng)建一個數(shù)據(jù)庫,我們命名“SC3-1:3-SC8個表:Student,Teacher,Course,SC,CourseTime,Building,RoomAdmin,每個表與邏輯設(shè)計中一種3-Teacher表。Teacher表用來教師的個人信息,用學(xué)校分配給教師的教師編號作3-3:3-Course表。Course表用來課程信息,Course表以課程編號為主鍵,設(shè)置課程編1(1。表中開課教師Id為外鍵,所有“TIdTeacher表中的“TId”值。設(shè)置外鍵關(guān)系可3-4:3-SC表。SC表用于學(xué)生的選課信息,在SC表中學(xué)號和課程編號是主鍵,同3-CourseTime表。CourseTime表用來存放課程的上間和上課地點信息,其中課程3-6:3-Building表。Building表用來存放教學(xué)樓信息,Building表中教學(xué)樓編號為主鍵,自13-7:3-3-3-第四章公共類與公共頁面設(shè)Web.config頁面設(shè)g文件是用來保存的很多全局設(shè)置,代碼是通過usingConfiguration,在Web.Config文件中添加數(shù)據(jù)庫連接字ADO.NET中用一個字符串來表示一個數(shù)據(jù)庫,Web.Config<?xmlversion="1.0"encoding="utf-8"<!--動態(tài)調(diào)試編譯compilationdebug="true"ASPXfalsecompilationdebug="true"(.pdb--
調(diào)試ASP.NET文件的文檔。<!--自定義錯誤信息設(shè)置customErrorsmode="On"或"RemoteOnly"以啟用自定義錯誤信息,或設(shè)置為"Off"以禁用自定義錯誤信息。error>"On""Off"ASP.NET"RemoteOnly"Web--<!--驗 驗證策略??赡艿哪J绞?Windows""Forms""Passport"--
"None"不執(zhí)行驗證"Windows"IIS根據(jù)應(yīng)用程序的設(shè)置執(zhí)行驗(基本、簡要或集成Windows)。在IIS中必須禁用"Forms"(Web在您的應(yīng)用程序中驗證他們的。用戶憑據(jù)標(biāo)記在中。"Passport"驗證是通過的集中驗證服務(wù)執(zhí)行的, <authenticationmode="Windows"--
<!--應(yīng)用程序資源。通配符:"*"表示任何人,"?"表示 <allowusers="*"<!-- --<!--應(yīng)用程序級別記設(shè) traceenabled="true"可以啟用應(yīng)用程序記錄。如在每一頁的底部顯示信息。否則,可以通過瀏覽Web應(yīng)用程序 中的"trace.axd"頁來查看應(yīng)用程 --<!--會話狀態(tài)設(shè)置--
默認(rèn)情況下,ASP.NET使用來標(biāo)識哪些請求屬于特定的會話。如果不可用,則可以通過將會話標(biāo)識符添加到URL來會話。 ,請設(shè)置sessionState sqlConnectionString="datasource=;Trusted_Connection=yes"<!--全球化
<addvalue="datasource=(local);initialcatalog=sc;persistsecurityinfo=True;userid=sa;pwd=sa;packetsize=4096"/><!- 選間-- value="2005-06-0100:00:00/2005-06-1500:00:00"/> value="E:\\選課系統(tǒng)\\time.txt"Initialcatalog:Persistsecurityinfo:表示數(shù)據(jù)庫登錄驗證模式。SQLServerWindows驗證兩種模式。一般選用前一種,故這里Persistsecurityinfo的值署TrueUserid:表示登錄數(shù)據(jù)庫的用戶名。Packetsize4096數(shù)據(jù)庫連接操作類—Db在ASP.NET中通過ADO.NET技術(shù)對數(shù)據(jù)庫進行操作。ADO.NET中有許多很方便的類可用SqlConnectionSqlDataAdapter類、mandDataSet數(shù)據(jù)庫操作做了簡單的封裝—Db類。在Db類中有三個靜態(tài)函數(shù)ExecuteSelectSql、ExecuteSqlExecuteInsertSql,ExecuteSelectSql函數(shù)用來執(zhí)行查詢操作,identityinsert通過ADO.NET執(zhí)行SQL語句從而對數(shù)據(jù)庫一般順先通過SqlConnectionOpen函數(shù)連接到數(shù)據(jù)庫,然后再通過mandSQLSqlConnectionClose//////<paramname="sqlSelect">select<returns>selectpublicstaticDataSetExecuteSelectSql(stringsqlSelect{SqlConnectionconn=newSqlConnection(connString);SqlDataAdaptersda=newSqlDataAdapter(sqlSelect,conn);DataSetds=newDataSet();{}catch(SqlException{thrownew}return}publicstaticintExecuteSql(stringsql{introws=-SqlConnectionconn=newSqlConnection(connString);mandcmd=new {}
rows=catch(SqlException{thrownew}{}return}工具類MyUtility在的編寫過程中經(jīng)常會有很多公共函數(shù)調(diào)用,把它們都寫在一個工具類里:MyUtility類,每個函數(shù)作為工具類的一個靜態(tài)成員函數(shù)。其中包括MD5靜態(tài)成員函數(shù)以及AlertpublicstaticstringMD5(string{stringresult= returnresult;}Alert靜態(tài)成員函數(shù)的功能是顯示一個提示框,在的運行過程中,經(jīng)常需要publicstaticstringAlert(string{return"<script}為-2publicstaticstringBack(int{ }錯誤信息類和錯誤顯示頁錯誤,為了便于統(tǒng)一,本系統(tǒng)定義的錯誤信息類和錯誤顯示頁面。在錯誤信息類URL登錄頁法運用了ASP.NET的內(nèi)置對象Session記錄用戶登錄信息,同樣也可以在里隨時判斷第五統(tǒng)系統(tǒng)界面說5-{stringuser=txtUser.Text.Trim();stringinputkey=txtKey.Text.Trim();stringkey="";stringsql="";DataSetds;switch(type){ //驗證教師代 //驗證管理員代}}5-”在列表中可以點課程名稱,如“計算機應(yīng)用基礎(chǔ),查看課程詳細(xì)信息;點教師姓”stringsql"selectCourse.*,TNamefromCourse,TeacherwhereCTypelike必修andCourse.TIdlikeTeacher.TId";//查詢處所有必修課程信息DataSetds=Db.ExecuteSelectSql(sql);if(ds!=null&&ds.Tables.Count>0{dgCourse.DataSource=ds.Tables[0];dgCourse.DataBind();//DataGrid中}5-單擊“選修課程”,查看所有選修課程列表,在列表中給出了比必修課程的stringsql="selectx.*,TName,(selectCNamefromCourseasywherey.CId=x.CPreCId)asamefromCourseasx,Teacherwherex.CTypelike'選修'andx.TIdlikeTeacher.TId";DataSetds=Db.ExecuteSelectSql(sql);if(ds!=null&&ds.Tables.Count>0{dgCourse.DataSource=ds.Tables[0];for(inti=0;i<ds.Tables[0].Rows.Count;i++{sql="selectcount(*)fromSCwhereCId="+ds.Tables[0].Rows[i]["CId"].ToString();DataSetds1=Db.ExecuteSelectSql(sql);if(ds1!=null&&ds1.Tables.Count>0&&ds1.Tables[0].Rows.Count>0 }}boollocked=bool.Parse(Session["Locked"].ToString());if(!locked){}{}
lbLock.Text選課信息已被鎖定!";dgCourse.Columns[9].Visible=false;5- ”三門課程后,點擊“已選課程查看已經(jīng)選擇的課程列表,在列表中除了可以看到與上”stringsql="selectcount(*)fromSCwhereSIdlike'"+Session["Id"].ToString()+"'";DataSetds=Db.ExecuteSelectSql(sql);intif(ds!=null&&ds.Tables.Count>0&&ds.Tables[0].Rows.Count>0{nCourse=}if(nCourse<2{}{
sql"selectCIdfromCoursewhereCType必修'";DataSetds2=Db.ExecuteSelectSql(sql);if(ds2!=null&&ds2.Tables.Count>0{for(inti=0;i<ds2.Tables[0].Rows.Count;i++{stringcid=sql="insertintoSC(SId,CId,Score)values('"+Session["Id"].ToString()+"',"+cid+",0)";}}sql="updateStudentsetSLocked=1whereSIdlike'"+Session["Id"].ToString()+"'";if(Db.ExecuteSql(sql)==1){lbLock.Text="選課信息已被鎖定!";Session["Locked"]="true";}}系統(tǒng)管理說 示開始時間,第二行表示結(jié)束時間。如圖5-5:5-DateTimedtStart,dtEnd;{dtStart=DateTime.Parse(txttimeStart.Text);dtEnd=DateTime.Parse(txtTimeEnd.Text);}{}StreamWritersw=newStreamWriter("",false);lbTime.Text="選間為:"+dtStart.ToString()+"到//更新選間段顯
5-{stringsql="insertintoTeacher(TId,TKey,TName){if(Db.ExecuteSql(sql)==1{sql="select*fromDataSetds1=Db.ExecuteSelectSql(sql);if(ds1!=null&&ds1.Tables.Count>0){}}{
(在!}}{")
(}}AdminRoom.Aspx5-7:
5-{if(txtBuilding.Text.Trim()==""{}stringsql="insertintoBuilding(BuildingName)values('"+txtBuilding.Text.Trim()+"')";}教師管理說息在Teache.Aspx這里可修和添教師個信如圖5-stringsql="select*fromTeacherwhereTIdlike'"+lbTId.Text.Trim()+"'";DataSetds=Db.ExecuteSelectSql(sql); ds.Tables[0].Rows.Count>0){txtTName.Text=ds.Tables[0].Rows[0]["TName"].ToString();txtTAge.Text=ds.Tables[0].Rows[0]["TAge"].ToString();txtTPhone.Textds.Tables[0].Rows[0]["TPhone"].ToString();txtTMail.Text=ds.Tables[0].Rows[0]["TMail"].ToString();if(ds.Tables[0].Rows[0]["T"].ToString()=="男")ddlT.SelectedIndex=0;ddlT.SelectedIndex=}stringsql="updateTeachersetTName='"+txtTName.Text.Trim()+"',TAge="+txtTAge.Text.Trim()+",T='"+ddlT.SelectedItem.Text+"',TPhone='"+txtTPhone.Text.Trim()+"',TMail="'whereTId='"+Session["Id"].ToString()+"'";if(Db.ExecuteSql(sql)==1)修改代碼如下if(txtKey.Text.Trim()!=txtKeyConfirm.Text.Trim(){}stringsql="updateTeachersetTKey='"+MyUtility.MD5(txtKey.Text.Trim())+"'whereTId=if(Db.ExecuteSql(sql)==1)5-11:5-從數(shù)據(jù)庫所有課程編號和課程名稱代碼如下:stringsql= amefromDataSetds=Db.ExecuteSelectSql(sql);if(
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 妊娠期代謝組學(xué)與母嬰健康管理
- 妊娠合并地貧指南中的并發(fā)癥防治策略
- 妊娠合并前置胎盤的胎兒鏡手術(shù)策略
- 大數(shù)據(jù)支持下社區(qū)慢病干預(yù)的個性化方案
- 科目一考試規(guī)律及答案
- 多組學(xué)整合優(yōu)化腫瘤個體化治療策略
- 多組學(xué)標(biāo)志物驅(qū)動耳科疾病精準(zhǔn)分型新策略
- 2025年大學(xué)風(fēng)景園林(園林工程技術(shù))試題及答案
- 2025年高職口腔修復(fù)工藝(固定義齒制作)試題及答案
- 2026年機械設(shè)計綜合(多零件設(shè)計)試題及答案
- 智慧產(chǎn)業(yè)園倉儲項目可行性研究報告-商業(yè)計劃書
- 財務(wù)部門的年度目標(biāo)與計劃
- 消防管道拆除合同協(xié)議
- 四川省森林資源規(guī)劃設(shè)計調(diào)查技術(shù)細(xì)則
- 銀行外包服務(wù)管理應(yīng)急預(yù)案
- DB13T 5885-2024地表基質(zhì)調(diào)查規(guī)范(1∶50 000)
- 2025年度演出合同知識產(chǎn)權(quán)保護范本
- 青少年交通安全法規(guī)
- 區(qū)塊鏈智能合約開發(fā)實戰(zhàn)教程
- 2025年校長考試題庫及答案
- 口腔進修申請書
評論
0/150
提交評論