freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于java技術的訂單管理系統(tǒng)設計論文-資料下載頁

2025-07-27 05:23本頁面
  

【正文】 id = new String()。String name = new String()。float unitprice = 0。String sConnStr = jdbc:odbc:jsp。buylist myList = new buylist()。String sql = select name,unitprice from book where bookid=39。+bookid+39。%將圖書添加到購物車%try{bookid = (bookid)。}catch(Exception e){}(sConnStr)。ResultSet bookaddRs = (sql)。if(()){//從數(shù)據(jù)庫查詢中得到圖書信息 name = (name)。 unitprice = (unitprice)。} = name。 = bookid。 = unitprice。 = 1。boolean listFlag = true。//從session中取出已存在的購物車shopVector shop = (Vector)(shop)。if(shop == null){//如果購物車不存在,則創(chuàng)建新的購物車shop = new Vector()。}else{ for(int i=0。 i()。i++) { buylist list = (buylist)(i)。 if(()) { //如果該書已經(jīng)在購物車中,則把該書的數(shù)量加1 ++。 (list,i)。 listFlag = false。 } }}if(listFlag){//向購物車中添加圖書try{(myList)。}catch(Exception e){}}(shop,shop)。()。()。%用戶在購物的過程中可以隨時查看購物車中商品的情況,這就要求我們能把購物車中的信息還原成為圖書信息。被還原出來的圖書信息應包括圖書名稱、數(shù)量及單價,并計算出總價。用戶可以對購物車中的圖書進行數(shù)量上的修改或刪除,也可以放棄購買,清空購物車。點擊生成訂單按鈕轉(zhuǎn)到訂單生成頁面圖53下面是“查看購物車”的主要代碼: File:%Vector shop = (Vector)(shop)。if(shop == null){(購物車中沒有商品)。}if(shop != null){%%buylist myList = new buylist()。for(int i=0。 i()。 i++){ myList = (buylist)(i)。% tr td%=i+1%/font/td td%=%/td td¥%=%/td td%=%/td tdinput type=button value=刪除 onclick=openwin()/font/td /tr%}%下面是“刪除購物車中圖書”的主要代碼:File:%String bookid = new String()。String name = new String()。String sConnStr = jdbc:odbc:jsp。float unitprice=0。%%try{bookid = (bookid)。}catch(Exception e){}String sql = select name,unitprice from book where bookid=39。+bookid+39。(sConnStr)。ResultSet bookaddRs = (sql)。if(()){ name = (name)。 unitprice = (unitprice)。}buylist myList = new buylist()。Vector shop = (Vector)(shop)。for(int i=0。 i()。 i++){ myList = (buylist)(i)。 if((bookid)) { (myList)。 }}(shop,shop)。()。圖54填好訂單信息后,點擊提交訂單按鈕生成訂單圖55對于用戶和管理員來說,無論是圖書信息還是訂單信息,都有可能由于太多而造成在一頁無法全部顯示,或者全部顯示將造成瀏覽的困難,因此分頁顯示的實現(xiàn)變得尤為重要,這也是界面友好性的重要體現(xiàn)。分頁顯示時,通過上一頁和下一頁的鏈接來更換當前顯示頁面。圖56在分頁顯示的設計中,用到了一個自定義的類,它用來描述頁。該類的定義如下:package page。public class pageclass{ public int pageCount。 //記錄頁面數(shù)量 public int recordCount。 //記錄記錄的數(shù)量 public int pageId。 //當前頁面的編號 public int pageSize。 //每頁顯示的最大記錄數(shù) }在對數(shù)據(jù)庫進行查詢之后,我們把查詢的結果進行分頁,并將分頁信息保存到這個類的對象中。為了獲得分頁信息,我們對數(shù)據(jù)庫進行預查詢,即只查詢它的主鍵,例如對圖書進行分頁顯示時,我們的預查詢只查圖書編號。下面代碼將保存分頁信息:%pageclass myPage = new pageclass()。String sConnStr = jdbc:odbc:jsp。String searchStr = select bookid from book where +property+ +way+ 39。+key+39。 order by bookid desc。 = 0。 = 0。 = 6。 = 1。%%(sConnStr)。ResultSet searchRs = (searchStr)。while(()) { ++。 if(==) { ++。 ((bookid))。 =0。 } } if(!=0) {++。} if( == 0 amp。amp。 != 0) {+=(*)。} else{ +=()*。} ()。 (idList,idList)。 (myPage,myPage)。}%在保存了分頁信息之后,下面最主要的就是在分頁顯示時提取分頁信息,并且生成分頁的SQL查詢語句。我們曾把每頁的第一本書的編號保存在了Vector對象idList中,這樣我們在進行分頁顯示時,就不必對全部的數(shù)據(jù)記錄進行查詢了,只需從該頁的第一本書查起,搜索到每頁該顯示的記錄數(shù)那么多本結束。以下是生成查詢的SQL命令:if(pageId1) { try{getList=(String)(pageId2)。} catch(Exception e){(fault)。} getList=and bookid+39。+getList+39。 }String sql=select top ++ * from book where +property+ like 39。%+key+%39。+getList+ order by bookid desc。 ResultSet displayRs = (sql)。%當用戶要在網(wǎng)上實現(xiàn)購書的目的時,前提條件是要成為注冊用戶,而且在確認購買時必須完成登錄,因此用戶注冊/登錄是購書網(wǎng)站設計的必需模塊。該功能模塊主要涉及對用戶注冊信息數(shù)據(jù)庫的操作,在注冊新用戶時,通過向用戶注冊信息庫寫入用戶信息實現(xiàn)該功能;在用戶登錄時,通過查詢用戶提交的用戶名及密碼,驗證有效性。如果用戶忘記了登錄密碼,可以通過注冊時的填寫的提示問題進行找回密碼。填好用戶名、密碼后,點擊登陸按鈕登陸圖57登陸驗證成功后,顯示成功信息,并自動返回圖58登陸成功后,返回到用戶界面圖59登陸實現(xiàn)的主要代碼:File:%String userid = new String()。String password = new String()。String usertype = new String()。String sConnStr = jdbc:odbc:jsp。ResultSet jspRset = null。%%try{userid = (userid)。password = (password)。usertype = (usertype)。}catch(Exception e){}%%(sConnStr)。jspRset = (select * from user where userid=39。+userid+39。 and password=39。+password+39。 and usertype=39。+usertype+39。)。(isLog,new String(0))。if (!()){(用戶名或密碼錯誤,請重新輸入!)。}else{ (userid,(userid))。 (isLog,new String(1))。 (password,(password))。 (question,(question))。 (anwser,(anwser))。 (,())。 (name,(name))。 (sex,(sex))。 (phone,(phone))。 (city,(city))。 (address,(address))。 (zipcode,(zipcode))。 int ordercount = (ordercount)。 (ordercount,new Integer(ordercount))。 int count = (userlogcount)。 count++。 (userlogcount,new Integer(count))。 (update user set userlogcount=+count+ where userid = 39。+userid+39。)。 if((1)){ (isAdmin,new String(1))。 (管理員登陸成功!)。} else{ (isAdmin,new String(2))。 (用戶登陸成功!)。}}()。圖510注冊實現(xiàn)的主要代碼:File:%try{userid = (userid)。password = (password)。question = (question)。anwser = (anwser)。name = (name)。sex = (sex)。city = (city)。 = ()。phone = (phone)。address = (address)。zipcode = (zipcode)。isAdmin = (String)(isAdmin)。}catch(Exeption e){}%% String sConnStr = jdbc:odbc:jsp。(sConnStr)。String userCheck = select userid from user where userid = 39。+userid +39。ResultSet userCheckRs = (userCheck)。if(()){(用戶名已經(jīng)使用,請輸入其他用戶名!)。%%}else{String userInsert = Insert into user (userid,usertype,password,question,anwser,name,sex,city,,phone,address,zipcode) values(39。+userid+39。,39。+isAdmin+39。,39。+password+39。,39。+question+39。,39。+anwser+39。,39。+name+39。,39。+sex+39。,39。+city+39。,39。++39。,39。+phone+39。,39。+address+39。,39。+zipcode+39。)。ResultSet userInsertRs = (userInsert)。用戶登陸后可以查詢自己已有的訂單信息:用戶可以通過修改和刪除按鈕來對自己未審核的訂單進行管理點擊訂單編號可查看定單詳情圖511查看訂單實現(xiàn)的主要代碼:File:%try{userid = (String)(userid)。}catch(Exception e){}%%pageclass orderPage = new pageclass()。Vector idList = new Vector()。String getPage。try{getPage = (pageId).trim()。}catch(Exception e){getPage=1。}%%if((1)==0){ String property = new String()。 String sear
點擊復制文檔內(nèi)容
化學相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1