B2C校園網(wǎng)上書(shū)店需求分析 課程設(shè)計(jì)總結(jié)報(bào)告
附表2
漳州師范學(xué)院計(jì)算機(jī)科學(xué)與工程系
數(shù)據(jù)庫(kù)課程設(shè)計(jì)總結(jié)報(bào)告
學(xué)生學(xué)號(hào)080811403專(zhuān)業(yè)軟件工程方向姓名班級(jí)蔡品芳08計(jì)非師(4)班所屬學(xué)期201*-201*學(xué)年第1學(xué)期一、項(xiàng)目介紹與設(shè)計(jì)目的本項(xiàng)目主要針對(duì)于校園二手圖書(shū)交易而開(kāi)發(fā)。系統(tǒng)可以向?yàn)g覽者提供出售的圖書(shū)的信息,并進(jìn)行購(gòu)買(mǎi)等操作。并且給店主(管理員)一個(gè)條理清楚,操作簡(jiǎn)便的管理平臺(tái)。為買(mǎi)家和賣(mài)家提供方便實(shí)用高效的交易平臺(tái)。二、項(xiàng)目環(huán)境要求本網(wǎng)站為ASP.NET網(wǎng)站,采用VisualStudio201*開(kāi)發(fā)環(huán)境,運(yùn)行時(shí)需要安裝IIS和.NETFramework3.5。三、項(xiàng)目功能模塊根據(jù)買(mǎi)家和賣(mài)家所涉及到的行為,可以把系統(tǒng)基本分為5個(gè)功能模塊:1.人員信息管理模塊2.商品呈現(xiàn)模塊3.購(gòu)物車(chē)模塊4.商品管理模塊5.訂單管理模塊四、小組成員名單及分工情況(要求包括小組成員名單、工作分配及小組各成員貢獻(xiàn)度))個(gè)人作品五、程序用戶(hù)名及密碼管理員密碼為:080811403六、體會(huì)與感想1.在做購(gòu)物網(wǎng)站過(guò)程中,購(gòu)物車(chē)的模塊很關(guān)鍵,其邏輯比起其他模塊要稍稍復(fù)雜一點(diǎn)。一個(gè)是購(gòu)物行為前對(duì)登錄的驗(yàn)證,購(gòu)物時(shí)商品信息的傳遞,以及結(jié)算,修改,刪除等操作都必須將邏輯弄清楚,因?yàn)橘?gòu)物車(chē)模塊的信息直接關(guān)系到訂單表和訂單明細(xì)表數(shù)據(jù)的正確性。2.整個(gè)網(wǎng)站的頁(yè)面數(shù)據(jù)傳遞有很多種方式,但其安全性和靈活度都不一樣,要考慮相應(yīng)的情況選擇合適的傳值方式。3.后臺(tái)數(shù)據(jù)完善后,要考慮如何將數(shù)據(jù)更合理地呈現(xiàn)給前臺(tái)的用戶(hù),不需要呈現(xiàn)所有數(shù)據(jù),要站在用戶(hù)的角度進(jìn)行思考,將有效呈現(xiàn)數(shù)據(jù)最大提高。七、指導(dǎo)教師意見(jiàn)指導(dǎo)教師(簽名):年月日注:該表格由學(xué)生填寫(xiě),內(nèi)容采用小四號(hào)宋體。
擴(kuò)展閱讀:網(wǎng)上書(shū)店項(xiàng)目總結(jié)報(bào)告
數(shù)據(jù)庫(kù)代碼:
/*==============================================================*//*DBMSname:MicrosoftSQLServer201**//*Createdon:201*-11-29:27:06*/
/*==============================================================*/
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("Administrators")ando.name="FK_ADMINIST_REFERENCE_USERS")altertableAdministrators
dropconstraintFK_ADMINIST_REFERENCE_USERSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("Re_status")ando.name="FK_RE_STATU_REFERENCE_ADMINIST")altertableRe_status
dropconstraintFK_RE_STATU_REFERENCE_ADMINISTgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("books")ando.name="FK_BOOKS_REFERENCE_BOOKTYPE")altertablebooks
dropconstraintFK_BOOKS_REFERENCE_BOOKTYPEgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("books")ando.name="FK_BOOKS_REFERENCE_PUBLISH")altertablebooks
dropconstraintFK_BOOKS_REFERENCE_PUBLISHgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("booktype")ando.name="FK_BOOKTYPE_REFERENCE_BOOKTYPE")altertablebooktype
dropconstraintFK_BOOKTYPE_REFERENCE_BOOKTYPEgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("leaveWords")ando.name="FK_LEAVEWOR_REFERENCE_USERS")altertableleaveWords
dropconstraintFK_LEAVEWOR_REFERENCE_USERSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("limite")ando.name="FK_LIMITE_REFERENCE_ADMINIST")altertablelimite
dropconstraintFK_LIMITE_REFERENCE_ADMINISTgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("model")ando.name="FK_MODEL_REFERENCE_LIMITE")altertablemodel
dropconstraintFK_MODEL_REFERENCE_LIMITEgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("orders")ando.name="FK_ORDERS_REFERENCE_SHIPPED")altertableorders
dropconstraintFK_ORDERS_REFERENCE_SHIPPEDgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("orders")ando.name="FK_ORDERS_REFERENCE_BOOKS")altertableorders
dropconstraintFK_ORDERS_REFERENCE_BOOKSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("orders")ando.name="FK_ORDERS_REFERENCE_USERS")altertableorders
dropconstraintFK_ORDERS_REFERENCE_USERSgoifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("sales")ando.name="FK_SALES_REFERENCE_ORDERS")altertablesales
dropconstraintFK_SALES_REFERENCE_ORDERSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("shipped")ando.name="FK_SHIPPED_REFERENCE_SALES")altertableshipped
dropconstraintFK_SHIPPED_REFERENCE_SALESgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("shoppingcar")ando.name="FK_SHOPPING_REFERENCE_BOOKTYPE")altertableshoppingcar
dropconstraintFK_SHOPPING_REFERENCE_BOOKTYPEgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("shoppingcar")ando.name="FK_SHOPPING_REFERENCE_BOOKS")altertableshoppingcar
dropconstraintFK_SHOPPING_REFERENCE_BOOKSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")wherer.fkeyid=object_id("shoppingcar")ando.name="FK_SHOPPING_REFERENCE_USERS")altertableshoppingcar
dropconstraintFK_SHOPPING_REFERENCE_USERSgo
ifexists(select1
fromsys.sysreferencesrjoinsys.sysobjectsoon(o.id=r.constidando.type="F")
wherer.fkeyid=object_id("users")ando.name="FK_USERS_REFERENCE_LIMITE")altertableusers
dropconstraintFK_USERS_REFERENCE_LIMITEgo
ifexists(select1
fromsysobjects
whereid=object_id("Administrators")andtype="U")droptableAdministratorsgo
ifexists(select1
fromsysobjects
whereid=object_id("Re_status")andtype="U")droptableRe_statusgo
ifexists(select1
fromsysobjects
whereid=object_id("books")andtype="U")droptablebooksgo
ifexists(select1
fromsysobjects
whereid=object_id("booktype")andtype="U")droptablebooktypego
ifexists(select1
fromsysobjects
whereid=object_id("booktype2")andtype="U")droptablebooktype2go
ifexists(select1
fromsysobjects
whereid=object_id("discount")andtype="U")droptablediscountgo
ifexists(selectfromsysobjects
whereid=object_id("leaveWords")andtype="U")droptableleaveWordsgo
ifexists(select1
fromsysobjects
whereid=object_id("limite")andtype="U")droptablelimitego
ifexists(select1
fromsysobjects
whereid=object_id("model")andtype="U")droptablemodelgo
ifexists(select1
fromsysobjects
whereid=object_id("orders")andtype="U")droptableordersgo
ifexists(select1
fromsysobjects
whereid=object_id("publish")andtype="U")droptablepublishgo
ifexists(select1
fromsysobjects
whereid=object_id("sales")andtype="U")droptablesalesgo
ifexists(select1
fromsysobjects
whereid=object_id("shipped")andtype="U")droptableshippedgo
ifexists(select1
fromsysobjects
whereid=object_id("shoppingcar")andtype="U")droptableshoppingcargo
ifexists(select1
fromsysobjects
whereid=object_id("users")andtype="U")droptableusersgo
/*==============================================================*//*Table:Administrators*/
/*==============================================================*/createtableAdministrators(
Administrator_idvarchar(50)notnull,Usernamevarchar(20)null,Administrator_namevarchar(20)notnull,Administrator_passwordvarchar(50)notnull,"Administrator_e-mall"varchar(30)null,
constraintPK_ADMINISTRATORSprimarykey(Administrator_id))go
/*==============================================================*//*Table:Re_status*/
/*==============================================================*/createtableRe_status(
Administrator_idvarchar(50)notnull,Usernamevarchar(10)notnull,Re_status_datedatetimenotnull,Subjectvarchar(10)notnull,re_ststus_texevarchar(201*)null,
Re_statusvarchar(2)notnull,constraintPK_RE_STATUSprimarykey(Administrator_id))go
/*==============================================================*//*Table:books*/
/*==============================================================*/createtablebooks(
bookIDvarchar(50)notnull,Smalltype_idvarchar(50)null,Pub_idvarchar(50)null,titlevarchar(80)notnull,pricedoubleprecisionnotnull,authorvarchar(10)notnull,Versionvarchar(20)null,Publishdatedatetimenull,introductionvarchar(201*)null,
typevarchar(50)notnull,stock_qtyintnull,constraintPK_BOOKSprimarykey(bookID))go
/*==============================================================*//*Table:booktype*/
/*==============================================================*/createtablebooktype(
Smalltype_idvarchar(50)notnull,Bigtype_idvarchar(50)notnull,Bigtype_namevarchar(50)notnull,constraintPK_BOOKTYPEprimarykey(Smalltype_id))go
/*==============================================================*//*Table:booktype2*/
/*==============================================================*/createtablebooktype2(
Smalltype_idvarchar(50)notnull,Smalltype_namevarchar(50)notnull,Bigtype_idvarchar(50)notnull,constraintPK_BOOKTYPE2primarykey(Smalltype_id))go
/*==============================================================*//*Table:discount*//*==============================================================*/createtablediscount(
datetimevarchar(10)notnull,discountdoubleprecisionnotnull,remarkdatetimenotnull,constraintPK_DISCOUNTprimarykey(datetime))go
/*==============================================================*//*Table:leaveWords*/
/*==============================================================*/createtableleaveWords(
Lword_idvarchar(50)notnull,use_Usernamevarchar(20)null,Usernamevarchar(6)notnull,Subjectvarchar(6)notnull,Submit_datedatetimenull,Lword_texevarchar(4000)null,Re_statusvarchar(10)null,constraintPK_LEAVEWORDSprimarykey(Lword_id))go
/*==============================================================*//*Table:limite*/
/*==============================================================*/createtablelimite(
usernamevarchar(20)notnull,Administrator_idvarchar(50)null,user_limitevarchar(2)notnull,constraintPK_LIMITEprimarykey(username))go
/*==============================================================*//*Table:model*/
/*==============================================================*/createtablemodel(
model_idvarchar(10)notnull,usernamevarchar(20)null,modelnamevarchar(20)notnull,remarkvarchar(20)notnull,constraintPK_MODELprimarykey(model_id))go
/*==============================================================*//*Table:orders*/
/*==============================================================*/createtableorders(
Order_idvarchar(50)notnull,bookIDvarchar(50)null,Usernamevarchar(20)null,Ship_idvarchar(50)null,shipaddressvarchar(50)notnull,Order_datedatetimenotnull,Book_idvarchar(50)notnull,quantityintnotnull,statusvarchar(2)notnull,constraintPK_ORDERSprimarykey(Order_id))go
/*==============================================================*//*Table:publish*/
/*==============================================================*/createtablepublish(
Pub_idvarchar(50)notnull,Pub_namevarchar(50)notnull,Pub_phonevarchar(15)notnull,Pub_addvarchar(50)notnull,constraintPK_PUBLISHprimarykey(Pub_id))go
/*==============================================================*//*Table:sales*/
/*==============================================================*/createtablesales(
Sale_idvarchar(50)notnull,Order_idvarchar(50)null,Sale_datedatetimenull,Salervarchar(20)notnull,Sale_statusvarchar(2)null,constraintPK_SALESprimarykey(Sale_id))go
/*==============================================================*//*Table:shipped*/
/*==============================================================*/createtableshipped(
Ship_idvarchar(50)notnull,Sale_idvarchar(50)null,receive_namevarchar(10)notnull,receive_addressvarchar(50)notnull,Ship_datedatetimenotnull,Ship_manvarchar(10)notnull,receive_postcodevarchar(6)notnull,receive_telephonevarchar(20)notnull,constraintPK_SHIPPEDprimarykey(Ship_id))go
/*==============================================================*//*Table:shoppingcar*/
/*==============================================================*/createtableshoppingcar(
shoppingcaridvarchar(10)notnull,Smalltype_idvarchar(50)null,bookIDvarchar(50)null,Usernamevarchar(20)null,totalpricedoubleprecisionnotnull,
constraintPK_SHOPPINGCARprimarykey(shoppingcarid))go
/*==============================================================*//*Table:users*/
/*==============================================================*/createtableusers(
Usernamevarchar(20)notnull,lim_usernamevarchar(20)null,Passwordvarchar(10)notnull,degreevarchar(2)notnull,Phonevarchar(15)null,"E-mall"varchar(30)null,Addressvarchar(100)notnull,True_namevarchar(10)notnull,Postcodevarchar(6)notnull,constraintPK_USERSprimarykey(Username))go
altertableAdministrators
addconstraintFK_ADMINIST_REFERENCE_USERSforeignkey(Username)referencesusers(Username)go
altertableRe_status
addconstraintFK_RE_STATU_REFERENCE_ADMINISTforeignkey(Administrator_id)referencesAdministrators(Administrator_id)go
altertablebooks
addconstraintFK_BOOKS_REFERENCE_BOOKTYPEforeignkey(Smalltype_id)referencesbooktype(Smalltype_id)go
altertablebooks
addconstraintFK_BOOKS_REFERENCE_PUBLISHforeignkey(Pub_id)referencespublish(Pub_id)go
altertablebooktype
addconstraintFK_BOOKTYPE_REFERENCE_BOOKTYPEforeignkey(Smalltype_id)referencesbooktype2(Smalltype_id)go
altertableleaveWords
addconstraintFK_LEAVEWOR_REFERENCE_USERSforeignkey(use_Username)referencesusers(Username)go
altertablelimite
addconstraintFK_LIMITE_REFERENCE_ADMINISTforeignkey(Administrator_id)referencesAdministrators(Administrator_id)go
altertablemodel
addconstraintFK_MODEL_REFERENCE_LIMITEforeignkey(username)referenceslimite(username)go
altertableordersaddconstraintFK_ORDERS_REFERENCE_SHIPPEDforeignkey(Ship_id)referencesshipped(Ship_id)go
altertableorders
addconstraintFK_ORDERS_REFERENCE_BOOKSforeignkey(bookID)referencesbooks(bookID)go
altertableorders
addconstraintFK_ORDERS_REFERENCE_USERSforeignkey(Username)referencesusers(Username)go
altertablesales
addconstraintFK_SALES_REFERENCE_ORDERSforeignkey(Order_id)referencesorders(Order_id)go
altertableshipped
addconstraintFK_SHIPPED_REFERENCE_SALESforeignkey(Sale_id)referencessales(Sale_id)go
altertableshoppingcar
addconstraintFK_SHOPPING_REFERENCE_BOOKTYPEforeignkey(Smalltype_id)referencesbooktype2(Smalltype_id)go
altertableshoppingcar
addconstraintFK_SHOPPING_REFERENCE_BOOKSforeignkey(bookID)referencesbooks(bookID)go
altertableshoppingcar
addconstraintFK_SHOPPING_REFERENCE_USERSforeignkey(Username)referencesusers(Username)go
altertableusers
addconstraintFK_USERS_REFERENCE_LIMITEforeignkey(lim_username)referenceslimite(username)go
DB類(lèi):
usingSystem;
usingSystem.Collections.Generic;usingSystem.Text;
namespaceDBLib{
//////DB類(lèi)的摘要說(shuō)明。
///提供訪問(wèn)SQLServer的基本方法
///publicclassDB{
publicDB(){}
//connStr為訪問(wèn)SQLServer201*的連接字符串
//下面是臨時(shí)調(diào)試使用的方法,直接設(shè)置聯(lián)接字符串。
stringconnStr="server=.;database=bookstore;integratedsecurity=SSPI";
#region獲取查詢(xún)結(jié)果,DataSetGetSqlDataSet(stringsqlString)///
///獲取查詢(xún)結(jié)果。返回類(lèi)型為DataSet///sqlString參數(shù)為查詢(xún)的SQL語(yǔ)句///
publicDataSetGetSqlDataSet(stringsqlString){
//定義返回變量
//實(shí)例化數(shù)據(jù)集DataSet,對(duì)象名為dsDataSetds=newDataSet();try{
//實(shí)例化連接對(duì)象SqlConnection,對(duì)象名為sqlConnSqlConnectionsqlConn=newSqlConnection(connStr);
//用查詢(xún)的SQL(sqlString)語(yǔ)句和連接對(duì)象sqlConn實(shí)例化數(shù)據(jù)接口SqlDataAdapter//對(duì)象名為da
SqlDataAdapterda=newSqlDataAdapter(sqlString,sqlConn);
//da.Fill(ds)是數(shù)據(jù)接口(SqlDataAdapter)提供的方法//具體作用為://打開(kāi)與數(shù)據(jù)庫(kù)的連接
//將查詢(xún)的SQL語(yǔ)句發(fā)送到數(shù)據(jù)庫(kù)服務(wù)器//接受返回的查詢(xún)結(jié)果
//并將結(jié)果填充到數(shù)據(jù)集對(duì)象ds中//關(guān)閉與數(shù)據(jù)庫(kù)的連接da.Fill(ds);}
catch(Exceptione){
//拋出捕捉到的異常throw(e);}
//返回查詢(xún)到的結(jié)果returnds;}
#endregion
#region執(zhí)行增、刪或改的SQL語(yǔ)句intExecuteSql(stringsqlString)///
///執(zhí)行增、刪或改的SQL語(yǔ)句///返回值為受影響的行數(shù)(記錄數(shù))///sqlString參數(shù)為增、刪或改的SQL語(yǔ)句///
publicintExecuteSql(stringsqlString){
inti=0;try{
////實(shí)例化連接對(duì)象SqlConnection,對(duì)象名為sqlConnSqlConnectionsqlConn=newSqlConnection(connStr);
//用查詢(xún)的SQL(sqlString)語(yǔ)句和連接對(duì)象sqlConn實(shí)例化SqlCommand//對(duì)象名為sqlCmd
SqlCommandsqlCmd=newSqlCommand(sqlString,sqlConn);
//打開(kāi)與數(shù)據(jù)庫(kù)的連接sqlConn.Open();
//將增、刪或改的SQL語(yǔ)句發(fā)送到數(shù)據(jù)庫(kù)服務(wù)器
//并接受返回的結(jié)果,返回的結(jié)果為受影響的行數(shù)(記錄數(shù))i=sqlCmd.ExecuteNonQuery();
//關(guān)閉與數(shù)據(jù)庫(kù)的連接sqlConn.Close();}
catch(Exceptione){
Exceptionee=newException(sqlString+e.Message);throw(ee);}
returni;}
#endregion}}
Administrators類(lèi):usingSystem;
usingSystem.Collections.Generic;usingSystem.Text;
namespaceDBlib{
classAdministrators{
stringAdministrator_id;publicstringAdministrator_Id{
get{returnAdministrator_id;}set{Administrator_id=value;}}
stringUsername;publicstringUserName{
get{returnUsername;}set{Username=value;}}
stringAdministrator_name;publicstringAdministrator_Name{
get{returnAdministrator_name;}set{Administrator_name=value;}}
stringAdministrator_password;publicstringAdministrator_Password{
get{returnAdministrator_password;}set{Administrator_password=value;}}
stringAdministrator_e_mall;publicstringAdministrator_E_Mall{
get{returnAdministrator_e_mall;}set{Administrator_e_mall=value;}}
DBdb=newDB();publicboolInsert(){try{
stringsql="insertinto
Administrators(Administrator_id,Username,Administrator_name,Administrator_password,Administrator_e_mall)values(""
+this.Administrator_id+"",""+this.Username+"",""
+this.Administrator_name+"",""+this.Administrator_password+"",""+this.Administrator_e_mall+"")";db.ExecuteSql(sql);returntrue;}catch{
returnfalse;}}
publicboolDelete(){try{
stringsql="deletefromAdministratorswhereAdministrator_id=""+this.Administrator_id+""";db.ExecuteSql(sql);returntrue;}catch{
returnfalse;}}
publicboolUpdate(){try{
stringsql="updateAdministratorssetAdministrator_id=""+this.Administrator_id+"",Username=""+this.Username+"",Administrator_name=""
+this.Administrator_name+"",Administrator_password=""+this.Administrator_password+"",Administrator_e_mall=""+this.Administrator_e_mall+""";db.ExecuteSql(sql);returntrue;}catch{
returnfalse;}}
publicDataSetSelectAll(){
stringsql="select*fromAdministrators";DataSetds=db.GetSqlDataSet(sql);returnds;}
publicDataSetSelect(){
stringsql="select*fromAdministratorswhereAdministrator_namelike"%"+this.Administrator_name+"%"";
DataSetds=db.GetSqlDataSet(sql);returnds;}
publicboolIsExist(){
stringsql="select*fromAdministratorswhereAdministrator_id=""+this.Administrator_id+""";
DataSetds=db.GetSqlDataSet(sql);if(ds.Tables[0].Rows.Count==1){
returntrue;}else{
returnfalse;}}}}
友情提示:本文中關(guān)于《B2C校園網(wǎng)上書(shū)店需求分析 課程設(shè)計(jì)總結(jié)報(bào)告》給出的范例僅供您參考拓展思維使用,B2C校園網(wǎng)上書(shū)店需求分析 課程設(shè)計(jì)總結(jié)報(bào)告:該篇文章建議您自主創(chuàng)作。
來(lái)源:網(wǎng)絡(luò)整理 免責(zé)聲明:本文僅限學(xué)習(xí)分享,如產(chǎn)生版權(quán)問(wèn)題,請(qǐng)聯(lián)系我們及時(shí)刪除。