网上书店项目总结报告由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“网上书店项目开发总结”。
数据库代码:
/*================*/ /* DBMS name:
Microsoft SQL Server 2008
*/ /* Created on:
2011-11-2 9:27:06
*/ /*================*/
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('Administrators')and o.name = 'FK_ADMINIST_REFERENCE_USERS')alter table Administrators
drop constraint FK_ADMINIST_REFERENCE_USERS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('Re_status')and o.name = 'FK_RE_STATU_REFERENCE_ADMINIST')alter table Re_status
drop constraint FK_RE_STATU_REFERENCE_ADMINIST go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('books')and o.name = 'FK_BOOKS_REFERENCE_BOOKTYPE')alter table books
drop constraint FK_BOOKS_REFERENCE_BOOKTYPE go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('books')and o.name = 'FK_BOOKS_REFERENCE_PUBLISH')alter table books
drop constraint FK_BOOKS_REFERENCE_PUBLISH go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('booktype')and o.name = 'FK_BOOKTYPE_REFERENCE_BOOKTYPE')alter table booktype
drop constraint FK_BOOKTYPE_REFERENCE_BOOKTYPE go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('leaveWords')and o.name = 'FK_LEAVEWOR_REFERENCE_USERS')alter table leaveWords
drop constraint FK_LEAVEWOR_REFERENCE_USERS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('limite')and o.name = 'FK_LIMITE_REFERENCE_ADMINIST')alter table limite
drop constraint FK_LIMITE_REFERENCE_ADMINIST go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('model')and o.name = 'FK_MODEL_REFERENCE_LIMITE')alter table model
drop constraint FK_MODEL_REFERENCE_LIMITE go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('orders')and o.name = 'FK_ORDERS_REFERENCE_SHIPPED')alter table orders
drop constraint FK_ORDERS_REFERENCE_SHIPPED go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('orders')and o.name = 'FK_ORDERS_REFERENCE_BOOKS')alter table orders
drop constraint FK_ORDERS_REFERENCE_BOOKS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('orders')and o.name = 'FK_ORDERS_REFERENCE_USERS')alter table orders
drop constraint FK_ORDERS_REFERENCE_USERS go if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('sales')and o.name = 'FK_SALES_REFERENCE_ORDERS')alter table sales
drop constraint FK_SALES_REFERENCE_ORDERS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('shipped')and o.name = 'FK_SHIPPED_REFERENCE_SALES')alter table shipped
drop constraint FK_SHIPPED_REFERENCE_SALES go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('shoppingcar')and o.name = 'FK_SHOPPING_REFERENCE_BOOKTYPE')alter table shoppingcar
drop constraint FK_SHOPPING_REFERENCE_BOOKTYPE go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('shoppingcar')and o.name = 'FK_SHOPPING_REFERENCE_BOOKS')alter table shoppingcar
drop constraint FK_SHOPPING_REFERENCE_BOOKS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('shoppingcar')and o.name = 'FK_SHOPPING_REFERENCE_USERS')alter table shoppingcar
drop constraint FK_SHOPPING_REFERENCE_USERS go
if exists(select 1
from sys.sysreferences r join sys.sysobjects o on(o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('users')and o.name = 'FK_USERS_REFERENCE_LIMITE')alter table users
drop constraint FK_USERS_REFERENCE_LIMITE go
if exists(select 1
from sysobjects
where id = object_id('Administrators')
and
type = 'U')
drop table Administrators go
if exists(select 1
from sysobjects
where id = object_id('Re_status')
and
type = 'U')
drop table Re_status go
if exists(select 1
from sysobjects
where id = object_id('books')
and
type = 'U')
drop table books go
if exists(select 1
from sysobjects
where id = object_id('booktype')
and
type = 'U')
drop table booktype go
if exists(select 1
from sysobjects
where id = object_id('booktype2')
and
type = 'U')
drop table booktype2 go
if exists(select 1
from sysobjects
where id = object_id('discount')
and
type = 'U')
drop table discount go
if exists(select 1
from sysobjects
where id = object_id('leaveWords')
and
type = 'U')
drop table leaveWords go
if exists(select 1
from sysobjects
where id = object_id('limite')
and
type = 'U')
drop table limite go
if exists(select 1
from sysobjects
where id = object_id('model')
and
type = 'U')
drop table model go
if exists(select 1
from sysobjects
where id = object_id('orders')
and
type = 'U')
drop table orders go
if exists(select 1
from sysobjects
where id = object_id('publish')
and
type = 'U')
drop table publish go
if exists(select 1
from sysobjects
where id = object_id('sales')
and
type = 'U')
drop table sales go
if exists(select 1
from sysobjects
where id = object_id('shipped')
and
type = 'U')
drop table shipped go
if exists(select 1
from sysobjects
where id = object_id('shoppingcar')
and
type = 'U')
drop table shoppingcar go
if exists(select 1
from sysobjects
where id = object_id('users')
and
type = 'U')
drop table users go
/*================*/ /* Table: Administrators
*/ /*================*/ create table Administrators(Administrator_id
varchar(50)
not null,Username
varchar(20)
null,Administrator_name
varchar(20)
not null,Administrator_paword varchar(50)
not null,“Administrator_e-mall” varchar(30)
null,constraint PK_ADMINISTRATORS primary key(Administrator_id))go
/*================*/ /* Table: Re_status
*/ /*================*/ create table Re_status(Administrator_id
varchar(50)
not null,Username
varchar(10)
not null,Re_status_date
datetime
not null,Subject
varchar(10)
not null,re_ststus_texe
varchar(2000)
null,Re_status
varchar(2)
not null,constraint PK_RE_STATUS primary key(Administrator_id))go
/*================*/ /* Table: books
*/ /*================*/ create table books(bookID
varchar(50)
not null,Smalltype_id
varchar(50)
null,Pub_id
varchar(50)
null,title
varchar(80)
not null,price
double precision
not null,author
varchar(10)
not null,Version
varchar(20)
null,Publishdate
datetime
null,introduction
varchar(2000)
null,type
varchar(50)
not null,stock_qty
int
null,constraint PK_BOOKS primary key(bookID))go
/*================*/ /* Table: booktype
*/ /*================*/ create table booktype(Smalltype_id
varchar(50)
not null,Bigtype_id
varchar(50)
not null,Bigtype_name
varchar(50)
not null,constraint PK_BOOKTYPE primary key(Smalltype_id))go
/*================*/ /* Table: booktype2
*/ /*================*/ create table booktype2(Smalltype_id
varchar(50)
not null,Smalltype_name
varchar(50)
not null,Bigtype_id
varchar(50)
not null,constraint PK_BOOKTYPE2 primary key(Smalltype_id))go
/*================*/ /* Table: discount
*/ /*================*/ create table discount(datetime
varchar(10)
not null,discount
double precision
not null,remark
datetime
not null,constraint PK_DISCOUNT primary key(datetime))go
/*================*/ /* Table: leaveWords
*/ /*================*/ create table leaveWords(Lword_id
varchar(50)
not null,use_Username
varchar(20)
null,Username
varchar(6)
not null,Subject
varchar(6)
not null,Submit_date
datetime
null,Lword_texe
varchar(4000)
null,Re_status
varchar(10)
null,constraint PK_LEAVEWORDS primary key(Lword_id))go
/*================*/ /* Table: limite
*/ /*================*/ create table limite(username
varchar(20)
not null,Administrator_id
varchar(50)
null,user_limite
varchar(2)
not null,constraint PK_LIMITE primary key(username))go
/*================*/ /* Table: model
*/ /*================*/ create table model(model_id
varchar(10)
not null,username
varchar(20)
null,modelname
varchar(20)
not null,remark
varchar(20)
not null,constraint PK_MODEL primary key(model_id))go
/*================*/ /* Table: orders
*/ /*================*/ create table orders(Order_id
varchar(50)
not null,bookID
varchar(50)
null,Username
varchar(20)
null,Ship_id
varchar(50)
null,shipaddre
varchar(50)
not null,Order_date
datetime
not null,Book_id
varchar(50)
not null,quantity
int
not null,status
varchar(2)
not null,constraint PK_ORDERS primary key(Order_id))go
/*================*/ /* Table: publish
*/ /*================*/ create table publish(Pub_id
varchar(50)
not null,Pub_name
varchar(50)
not null,Pub_phone
varchar(15)
not null,Pub_add
varchar(50)
not null,constraint PK_PUBLISH primary key(Pub_id))go
/*================*/ /* Table: sales
*/ /*================*/ create table sales(Sale_id
varchar(50)
not null,Order_id
varchar(50)
null,Sale_date
datetime
null,Saler
varchar(20)
not null,Sale_status
varchar(2)
null,constraint PK_SALES primary key(Sale_id))go
/*================*/ /* Table: shipped
*/ /*================*/ create table shipped(Ship_id
varchar(50)
not null,Sale_id
varchar(50)
null,receive_name
varchar(10)
not null,receive_addre
varchar(50)
not null,Ship_date
datetime
not null,Ship_man
varchar(10)
not null,receive_postcode
varchar(6)
not null,receive_telephone
varchar(20)
not null,constraint PK_SHIPPED primary key(Ship_id))go
/*================*/ /* Table: shoppingcar
*/ /*================*/ create table shoppingcar(shoppingcarid
varchar(10)
not null,Smalltype_id
varchar(50)
null,bookID
varchar(50)
null,Username
varchar(20)
null,totalprice
double precision
not null,constraint PK_SHOPPINGCAR primary key(shoppingcarid))go
/*================*/ /* Table: users
*/ /*================*/ create table users(Username
varchar(20)
not null,lim_username
varchar(20)
null,Paword
varchar(10)
not null,degree
varchar(2)
not null,Phone
varchar(15)
null,“E-mall”
varchar(30)
null,Addre
varchar(100)
not null,True_name
varchar(10)
not null,Postcode
varchar(6)
not null,constraint PK_USERS primary key(Username))go
alter table Administrators
add constraint FK_ADMINIST_REFERENCE_USERS foreign key(Username)
references users(Username)go
alter table Re_status
add constraint FK_RE_STATU_REFERENCE_ADMINIST foreign key(Administrator_id)
references Administrators(Administrator_id)go
alter table books
add constraint FK_BOOKS_REFERENCE_BOOKTYPE foreign key(Smalltype_id)
references booktype(Smalltype_id)go
alter table books
add constraint FK_BOOKS_REFERENCE_PUBLISH foreign key(Pub_id)
references publish(Pub_id)go
alter table booktype
add constraint FK_BOOKTYPE_REFERENCE_BOOKTYPE foreign key(Smalltype_id)
references booktype2(Smalltype_id)go
alter table leaveWords
add constraint FK_LEAVEWOR_REFERENCE_USERS foreign key(use_Username)
references users(Username)go
alter table limite
add constraint FK_LIMITE_REFERENCE_ADMINIST foreign key(Administrator_id)
references Administrators(Administrator_id)go
alter table model
add constraint FK_MODEL_REFERENCE_LIMITE foreign key(username)
references limite(username)go
alter table orders
add constraint FK_ORDERS_REFERENCE_SHIPPED foreign key(Ship_id)
references shipped(Ship_id)go
alter table orders
add constraint FK_ORDERS_REFERENCE_BOOKS foreign key(bookID)
references books(bookID)go
alter table orders
add constraint FK_ORDERS_REFERENCE_USERS foreign key(Username)
references users(Username)go
alter table sales
add constraint FK_SALES_REFERENCE_ORDERS foreign key(Order_id)
references orders(Order_id)go
alter table shipped
add constraint FK_SHIPPED_REFERENCE_SALES foreign key(Sale_id)
references sales(Sale_id)go
alter table shoppingcar
add constraint FK_SHOPPING_REFERENCE_BOOKTYPE foreign key(Smalltype_id)
references booktype2(Smalltype_id)go
alter table shoppingcar
add constraint FK_SHOPPING_REFERENCE_BOOKS foreign key(bookID)
references books(bookID)go
alter table shoppingcar
add constraint FK_SHOPPING_REFERENCE_USERS foreign key(Username)
references users(Username)go
alter table users
add constraint FK_USERS_REFERENCE_LIMITE foreign key(lim_username)
references limite(username)go
DB类:
using System;using System.Collections.Generic;using System.Text;
namespace DBLib { /// /// DB 类的摘要说明。
/// 提供访问SQL Server的基本方法
/// public cla DB { public DB(){ }
//connStr为访问SQL Server2000的连接字符串
//下面是临时调试使用的方法,直接设置联接字符串。
string connStr = “server=.;database=bookstore;integrated security=SSPI”;
#region 获取查询结果,DataSet GetSqlDataSet(string sqlString)/// /// 获取查询结果。返回类型为DataSet /// sqlString 参数为查询的SQL语句
/// public DataSet GetSqlDataSet(string sqlString){ //定义返回变量
//实例化数据集DataSet,对象名为ds DataSet ds = new DataSet();try { //实例化连接对象SqlConnection,对象名为sqlConn SqlConnection sqlConn = new SqlConnection(connStr);
//用查询的SQL(sqlString)语句和连接对象sqlConn实例化数据接口SqlDataAdapter //对象名为da SqlDataAdapter da = new SqlDataAdapter(sqlString, sqlConn);
//da.Fill(ds)是数据接口(SqlDataAdapter)提供的方法
//具体作用为:
//打开与数据库的连接
//将查询的SQL语句发送到数据库服务器 //接受返回的查询结果
//并将结果填充到数据集对象ds中
//关闭与数据库的连接 da.Fill(ds);} catch(Exception e){ //抛出捕捉到的异常
throw(e);} //返回查询到的结果
return ds;} #endregion
#region 执行增、删或改的SQL语句 int ExecuteSql(string sqlString)/// /// 执行增、删或改的SQL语句
/// 返回值为受影响的行数(记录数)
/// sqlString 参数为增、删或改的SQL语句
/// public int ExecuteSql(string sqlString){ int i = 0;try { ////实例化连接对象SqlConnection,对象名为sqlConn SqlConnection sqlConn = new SqlConnection(connStr);
//用查询的SQL(sqlString)语句和连接对象sqlConn实例化SqlCommand //对象名为sqlCmd SqlCommand sqlCmd = new SqlCommand(sqlString, sqlConn);
//打开与数据库的连接 sqlConn.Open();
//将增、删或改的SQL语句发送到数据库服务器
//并接受返回的结果,返回的结果为受影响的行数(记录数)i = sqlCmd.ExecuteNonQuery();
//关闭与数据库的连接 sqlConn.Close();} catch(Exception e){ Exception ee = new Exception(sqlString + e.Meage);throw(ee);} return i;} #endregion
} }
Administrators类: using System;using System.Collections.Generic;using System.Text;
namespace DBlib { cla Administrators { string Administrator_id;public string Administrator_Id { get { return Administrator_id;} set { Administrator_id = value;} } string Username;public string UserName { get { return Username;} set { Username = value;} } string Administrator_name;public string Administrator_Name { get { return Administrator_name;} set { Administrator_name = value;} } string Administrator_paword;public string Administrator_Paword { get { return Administrator_paword;} set { Administrator_paword = value;} } string Administrator_e_mall;public string Administrator_E_Mall { get { return Administrator_e_mall;} set { Administrator_e_mall = value;} } DB db = new DB();public bool Insert(){ try { string sql = “insert into Administrators(Administrator_id ,Username,Administrator_name,Administrator_paword,Administrator_e_mall)values('” + this.Administrator_id + “','” + this.Username + “','” + this.Administrator_name + “','” + this.Administrator_paword + “','” + this.Administrator_e_mall + “')”;db.ExecuteSql(sql);return true;} catch { return false;} } public bool Delete(){ try { string sql = “delete from Administrators where Administrator_id='” + this.Administrator_id + “'”;db.ExecuteSql(sql);return true;} catch { return false;} } public bool Update(){ try { string sql = “update Administrators set Administrator_id='” + this.Administrator_id + “',Username='” + this.Username + “',Administrator_name='” + this.Administrator_name + “',Administrator_paword='” + this.Administrator_paword + “',Administrator_e_mall='” + this.Administrator_e_mall + “'”;db.ExecuteSql(sql);return true;} catch { return false;} } public DataSet SelectAll(){
string sql = “select * from Administrators”;DataSet ds = db.GetSqlDataSet(sql);return ds;} public DataSet Select(){
string sql = “select * from Administrators where Administrator_name like '%” + this.Administrator_name + “%'”;DataSet ds = db.GetSqlDataSet(sql);return ds;}
public bool IsExist(){ string sql = “select * from Administrators where Administrator_id='” + this.Administrator_id + “'”;DataSet ds = db.GetSqlDataSet(sql);if(ds.Tables[0].Rows.Count == 1){ return true;} else { return false;} } } }
网上书店项目概述网上购书系统由3部分组成:用户管理、购书网站和订单处理中心。其中,用户管理负责用户注册及用户登陆;购书网站是一个Web应用程序,用户可以通过Web浏览器登录到......
开卷有益网上书店项目设计书 开卷有益 网上书店项目设计书课程名称网站规划建设与管理维护专业 班级 提交人2013年9月29日 开卷有益网上书店项目设计书 开卷有益网上书店项......
南京信息工程大学课程论文题目网上书店项目概述网上购书系统3部分组成:用户管理、购书网站和订单处理中心。其中,用户管理负责用户注册及用户登陆;购书网站是一个Web应用程序,用......
为了能写出更好的策划书,下面好范文推荐一篇优秀策划书范文,仅供参考:一、引言随着中国加入WTO,全球经济一体化的逐步深入,网上书店已是现代传统书店必不可少的经营策略。目前,网......
第 三 波 网 上 书 店 策 划 书一. 市场分析1.开展网上书店的可行性分析(1)网上书店优质低价的竞争优势网上购物,具有价格低廉、高效、方便、种类齐全的特点,而且与传统书店的经......