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

电子商务毕业论文 第14页

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

CD在线商店销售系统设计
 public void setPageSize(int newpsize) {
                pageSize = newpsize;
        }
        public int getPageCount() {    //页面总数
                return pageCount;
        }
        public void setPageCount(int newpcount) {
                pageCount = newpcount;
        }
        public long getRecordCount() {
                return recordCount;
        }
        public void setRecordCount(long newrcount) {
                recordCount= newrcount;
        }
  public op_cd() {
       }
}
op_cdclass.java
package cdshop.run;
/**
 * <p>Title: </p>
 */
import java.util.*;
import cdshop.util.*;
import cdshop.cd.*;
import java.sql.*;
import java.lang.String;
import javax.servlet.http.HttpServletRequest;

public class op_cdclass extends DataBase{
  public op_cdclass() {
  }
  private cdclass cdclass = new cdclass(); //新的CD分类
  private javax.servlet.http.HttpServletRequest request; //建立页面请求
  private Vector classlist;  //CD类别向量数组
  public Vector getClasslist() {
        return classlist;
          }
  public String getcdClassSql() {
                  sqlStr = "select id,classname from cdclass order by id";
                  return sqlStr;
          }
          //查询CD分类
  public boolean seachcdClass() throws Exception {
                  int id = 0;
                  String classname = "";
                  int rscount = 0;
                  try {
                  DataBase db = new DataBase();
                  db.connect();
                  stmt = db.conn.createStatement ();
                  rs = stmt.executeQuery(getcdClassSql());
                  rscount = stmt.getMaxRows();
                  classlist = new Vector(rscount+1);
                  classlist.clear();
                  while (rs.next()){
                                  id = rs.getInt("id");
                                  classname = rs.getString("classname");
                                  cdclass bc = new cdclass(id,classname);
                                  classlist.addElement(bc);
                          }
                          close();
                          return true;
                  }
                  catch (SQLException sqle){
                          System.out.println(sqle);
              return false;
                  }
          }
          //添加新CD分类时获得页面转递的分类名称
public boolean getRequest(javax.servlet.http.HttpServletRequest newrequest) {
     boolean flag = false;
     try{
         request = newrequest;
         String cdclassname = request.getParameter("cdclassname");
          if (cdclassname==null || cdclassname.equals("")){
              cdclassname = "";
              flag = false;
              }
              cdclass.setClassName(cdclassname);
              return true;
          }catch (Exception e){
            return false;
            }
    }
    //添加新的CD分类
        public boolean insert() throws Exception {
           sqlStr = "insert into cdclass (classname) values ('";
           sqlStr = sqlStr + dataFormat.toGb(cdclass.getClassName()) + "')";
                      try
                      {      System.out.print(sqlStr);
                        DataBase db = new DataBase();
                              db.connect();
                              stmt =db.conn.createStatement ();
                              stmt.execute(sqlStr);
                              return true;
                      }
                      catch (SQLException sqle)
                      {        System.out.print(sqle.getMessage());
                              return false;
                      }
              }
          //删除CD分类
          public boolean delete( int aid ) throws Exception {
               sqlStr = "delete from cdclass where id = "  + aid ;
               try
               {         DataBase db = new DataBase();
                          db.connect();
                          stmt =db.conn.createStatement ();
                       stmt.execute(sqlStr);
                       return true;
               }
               catch (SQLException e)
               {
                       System.out.println(e);
                       return false;
               }
       }
  };


op_sale_statistics.java:
package cdshop.run;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @Singer not attributable
 * @version 1.0
 */
import java.util.*;
import cdshop.util.*;
public class op_sale_statistics extends DataBase {

  ArrayList al=new ArrayList();

  public op_sale_statistics() {
  }

public ArrayList getSaleNumOrder(String classid,String keyword)
       {
         String sql="";
         if((classid!=null&&!classid.equals(""))&&(keyword==null||keyword.equals("")))
          {  sql= "select top 100 cd.cdname cdname,sum(allorder.amount) num "+
                   " from allorder,cd,cdclass "+
                   "  where allorder.cdno=cd.id  "+
                   "  and cd.cdclass=cdclass.id "+
                   "  and cdclass.id='"+classid+"'"+
                   "  group by cdname  "+
                   "  order by num desc ";
          }
        else  if((classid==null||classid.equals(""))&&(keyword!=null&&!keyword.equals("")))
           {  sql= "select top 100 cd.cdname cdname,sum(allorder.amount) num "+
                    " from allorder,cd,cdclass "+
                    "  where allorder.cdno=cd.id  "+
                    "  and cd.cdclass=cdclass.id "+
                    "  and cd.cdname like '%"+dataFormat.toUni(keyword)+"%' "+
                    "  group by cdname  "+
                    "  order by num desc ";
           }
        else   if((classid!=null&&!classid.equals(""))&&(keyword!=null&&!keyword.equals("")))
            {  sql= "select top 100 cd.cdname cdname,sum(allorder.amount)

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] 下一页

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

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