毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

电子商务毕业论文 第10页

更新时间:2009-3-9:  来源:毕业论文

电子商务网站毕业设计
//long indentid = 0;
       // while (rs.next()) {
         // indentid = rs.getLong(1);
        //}
        //close();
        for (int i = 0; i < purchaselist.size(); i++) {
          allorder iList = (allorder) purchaselist.elementAt(i);
          sqlStr =
              "insert into allorder (orderId,cdNo,Amount) values (";
          sqlStr = sqlStr + orderId + ",'";
          sqlStr = sqlStr + iList.getcdNo() + "','";
          sqlStr = sqlStr + iList.getAmount() + "')";
          stmt.execute(sqlStr);
          sqlStr = "update cd set leav_number=leav_number - " +
              iList.getAmount() + " where id = " + iList.getcdNo();
          stmt.execute(sqlStr);
          //更新用户积分
          String priceString=TotalPrice.toString();
          int point=Integer.parseInt((priceString).substring(0,priceString.indexOf(".")));
          System.out.println("dddddd:"+point);
          op_user oper=new op_user();
          oper.updateUserPoint(""+userid,point);

        }
        return true;
      }
      catch (SQLException e) {
        System.out.print(e.getMessage());
        return false;
      }

    }
    /**
     * 查询指定用户id的所有订单
     * @param userid
     * @return
     */
    public boolean getOrder(long userid) {
      sqlStr = "select * from orders where userid = '" + userid +
          "' order by id desc";
      try {
        DataBase db = new DataBase();
                  db.connect();
                  stmt = db.conn.createStatement ();

        rs = stmt.executeQuery(sqlStr);
        allorder = new Vector();
        while (rs.next()) {
          order ind = new order();
          ind.setId(rs.getLong("id"));
          ind.setOrderId(rs.getString("orderId"));
          ind.setUserId(rs.getLong("userid"));
          ind.setSubmitTime(rs.getString("submitTime"));
          ind.setConsignmentTime(rs.getString("ConsignmentTime"));
          ind.setTotalPrice(rs.getFloat("TotalPrice"));
          ind.setContent(rs.getString("content"));
          ind.setIPAddress(rs.getString("IpAddress"));
          if (rs.getInt("IsPayoff") == 1)
            ind.setIsPayoff(false);
          else
            ind.setIsPayoff(true);
          if (rs.getInt("IsSales") == 1)
            ind.setIsSales(false);
          else
            ind.setIsSales(true);
          allorder.addElement(ind);
        }
        close();
        return true;
      }
      catch (SQLException e) {
        return false;
      }
    }
    /**
     * 查询指定订单编号的订单
     * @param iid
     * @return
     */
    public boolean getSinggleOrder(String order_id) {
      sqlStr = "select * from orders where orderId = '" + order_id +
          "' ";
      try {
        DataBase db = new DataBase();
                  db.connect();
                  stmt = db.conn.createStatement ();

        rs = stmt.executeQuery(sqlStr);
        allorder = new Vector();
        while (rs.next()) {
          order ind = new order();
          ind.setId(rs.getLong("id"));
          ind.setOrderId(rs.getString("orderId"));
          ind.setUserId(rs.getLong("userid"));
          ind.setSubmitTime(rs.getString("submitTime"));
          ind.setConsignmentTime(rs.getString("ConsignmentTime"));
          ind.setTotalPrice(rs.getFloat("TotalPrice"));
          ind.setContent(rs.getString("content"));
          ind.setIPAddress(rs.getString("IpAddress"));
          if (rs.getInt("IsPayoff") == 1)
            ind.setIsPayoff(false);
          else
            ind.setIsPayoff(true);
          if (rs.getInt("IsSales") == 1)
            ind.setIsSales(false);
          else
            ind.setIsSales(true);
          allorder.addElement(ind);
          System.out.print("allorder:"+allorder.size());
        }
        close();
        return true;
      }
      catch (SQLException e) {
        System.out.print(e.getMessage());
        return false;
      }
    }
    /**
     * 查询商店的所有订单数据
     * @return
     */
    public boolean getOrder() {
      sqlStr = "select count(*) from orders"; //取出记录数
      int rscount = pageSize;
      try {
        DataBase db = new DataBase();
                  db.connect();
                  stmt = db.conn.createStatement ();

        ResultSet rs1 = stmt.executeQuery(sqlStr);
        if (rs1.next())
          recordCount = rs1.getInt(1);
        rs1.close();
      }
      catch (SQLException e) {
        return false;
      }
      //设定有多少pageCount
      if (recordCount < 1)
        pageCount = 0;
      else
        pageCount = (int) (recordCount - 1) / pageSize + 1;
        //检查查看的页面数是否在范围内
      if (page < 1)
        page = 1;
      else if (page > pageCount)
        page = pageCount;

      rscount = (int) recordCount % pageSize; // 最后一页记录数

      //sql为倒序取值
      sqlStr = "select  * from orders ";
      if (page == 1) {
        sqlStr = sqlStr + " order by Id desc";
      }
      else {
        sqlStr = sqlStr + " order by Id desc  limit "+(recordCount - pageSize * page) +","+ (recordCount - pageSize * (page - 1));

      }

      try {
        DataBase db = new DataBase();
                  db.connect();
                  stmt = db.conn.createStatement ();

        rs = stmt.executeQuery(sqlStr);
        allorder = new Vector();
        while (rs.next()) {
          order ind = new order();
          ind.setId(rs.getLong("id"));
          ind.setOrderId(rs.getString("orderid"));
          ind.setUserId(rs.getLong("userid"));

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

电子商务毕业论文 第10页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。