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

正文內(nèi)容

基于jsp的網(wǎng)上購物商場系統(tǒng)的設計與開發(fā)畢業(yè)論文-資料下載頁

2025-06-27 22:35本頁面
  

【正文】 tbd=new Tb_goodsDAO()。 ListTbgoodsInfo tbgoodses=()。 (tbgoodses,tbgoodses)。 //(user,tbgoodses)。 ()。 }4. 商品詳情頁面核心代碼://獲得一件商品的詳細信息public TbgoodsInfo getMessage(String no){ String sql = select * from tb_goods where goods_no=+no。 TbgoodsInfo g=null。 try{ conn = ()。 st=(sql)。 rs=()。 while(()){ g=new TbgoodsInfo()。 ((1))。 ((2))。 ((3))。 ((4))。 ((5))。 ((6))。 ((7))。 } }catch(SQLException e){ ()。 }finally{ (rs, st, conn)。 } return g。 }protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { (utf8)。 (text/html。charset=utf8)。 GoodDao gd = new GoodDao()。 //獲取前一個頁面的商品id //int id=((id).toString())。 String id=(id)。 (id)。 TbgoodsInfo g = (id)。 /*HttpSession session=()。 (g, g)。 String name = ()。 float price =(float) ()。 int kind = ()。 String path = ()。 float weight = (float) ()。 int kucun = ()。*/ //數(shù)據(jù)可共享 用application ServletContext application=()。 (g, g)。 ()。 }}://向購物車增加商品public void addgoods_mark(Shopping_card cartItem){ String sql=null。 sql=insert into shopping_card + (u_id,goods_no,goods_count) + values(?,?,?)。 try{ conn = ()。 st=(sql)。 (1, ().getId())。 (2, ().getGoods_no())。 (3, ())。 ()。 }catch(SQLException e){ (增加的商品id已經(jīng)存在,所以只加數(shù)量)。Sql= sql=update shopping_card set goods_count=goods_count++()+where u_id=+().getGoods_no()。 try { conn= ()。 st=(sql)。 ()。 } catch (SQLException e1) { // TODO Autogenerated catch block ()。 } /*try{ conn = ()。 st=(sql)。 ()。 }catch(SQLException e){ ()。 }finally{ (rs, st, conn)。 }*/ }finally{ (rs, st, conn)。 } }//查看購物車public ArrayListShopping_card seek(User u){ //創(chuàng)建一個購物項集合,來存放購物車的信息; ArrayListShopping_card cartses=new ArrayListShopping_card()。 String sql = select * from shopping_card where u_id=?。 try{ conn = ()。 st=(sql)。 (1, ())。 rs=()。 while(()){ Shopping_card cartItem=new Shopping_card()。 int u_id=(1)。 String goods_no=(2)。 int counts=(3)。 GoodDao gd=new GoodDao()。 ((goods_no))。 (u)。 (counts)。 (cartItem)。 } }catch(SQLException e){ ()。 }finally{ (rs, st, conn)。 } return cartses。 }//刪除購物車的商品public void deleteCartItem(User u , TbgoodsInfo g){ String sql = delete from shopping_card where u_id=? and goods_no=?。 try{ conn = ()。 st=(sql)。 (1, ())。 (2, ())。 ()。 }catch(SQLException e){ ()。 }finally{ (rs, st, conn)。 } }public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { (utf8)。 (text/html。charset=utf8)。 HttpSession session=()。 User u=(User)(user)。 if(u==null){ (用戶沒登陸,不能加購物車或購買)。 ()。 }else{ (())。 String op=(op)。 GoodDao gd=new GoodDao()。 String goodsid=(id)。 if((add)){ int count=((textnum))。 String addName=(cartItem)。 String buyName=(buy)。 (goodsid+\t+count)。 TbgoodsInfo g=(goodsid)。 //搭建購物項信息,錄入數(shù)據(jù)庫中 Shopping_card cartItem=new Shopping_card()。 (g)。 (u)。 (count)。 Shopping_cardDAO scd =new Shopping_cardDAO()。 (cartItem)。 //再從數(shù)據(jù)庫中得到該用戶所有的添加到購物車里的購物項信息顯示出來 ArrayListShopping_card carts=(u)。 float total_count=0。 for (Shopping_card sc : carts) { total_count+=()。 } (total,total_count)。 (cartses,carts)。 ()。 } if((delete)){ Shopping_cardDAO scd =new Shopping_cardDAO()。 TbgoodsInfo g=(goodsid)。 (u, g)。 ArrayListShopping_card carts=(u)。 float total_count=0。 for (Shopping_card sc : carts) { total_count+=()。 } (total,total_count)。 ()。 } } }: public boolean addOrder(MyCarBo mcb,String userId){ boolean b=true。 try{ ct=new ConnDB().getConn()。 ps=(insert into orders(userid,totalPrice)values(?,?))。 (1,userId)。 (2, ())。 int a=()。 if(a==1){ //取出order最后一條orderid就是剛剛添加的訂單 ps=(select max(orderid) from orders)。 rs=()。 int orderId=0。 if(()){ orderId=(1)。 } ArrayList al=()。 Statement sm=()。 for(int i=0。i()。i++){ GoodsBean gb=(GoodsBean)(1)。 ps=(insert into orderdetail values(?,?,?))。 (1,orderId)。 (2,())。 (3,(())+)。 } }else { b=false。 } }catch(Exception e){ ()。 }finally{ //關閉資源 ()。 } return b。 }:Public void addgoods() throws Exception { String sql=insert intogoods((goodsname,goodstype,price,goodssum,goodsinfo)values(?,?,?,?,?))。 try { PreparedStatement pstmt=(reg)。 (1, ())。 (2, ())。 (2, ())。 (2, ())。 (2, ())。 ()。 } catch(Exception e) { ()。 throw e。 }}
點擊復制文檔內(nèi)容
范文總結相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1