數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告.doc_第1頁
數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告.doc_第2頁
數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告.doc_第3頁
數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告.doc_第4頁
數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告.doc_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

成績數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)報(bào)告商品銷售管理系統(tǒng)學(xué)院:信息工程學(xué)院班級(jí): 學(xué)號(hào): 姓名: 完成時(shí)間: 201 課程設(shè)計(jì)的任務(wù)數(shù)據(jù)庫原理及應(yīng)用是計(jì)算機(jī)及其相關(guān)學(xué)科的一門重要的學(xué)科基礎(chǔ)課程,也是計(jì)算機(jī)軟件科學(xué)與技術(shù)、信息科學(xué)與技術(shù)的重要學(xué)科分支。本課程設(shè)計(jì)旨在通過對(duì)一個(gè)小型數(shù)據(jù)庫管理系統(tǒng)(DBMS)的綜合設(shè)計(jì)過程,強(qiáng)化學(xué)生對(duì)計(jì)算機(jī)系統(tǒng)軟件的設(shè)計(jì)能力,提高學(xué)生的綜合素質(zhì),并通過課程設(shè)計(jì)進(jìn)一步加強(qiáng)學(xué)生對(duì)所學(xué)知識(shí)的理解,以及對(duì)數(shù)據(jù)庫的全面、深刻認(rèn)識(shí)。具體要求如下:1)了解DBMS的設(shè)計(jì)過程;2)掌握關(guān)系型DBMS的結(jié)構(gòu)及實(shí)現(xiàn);3)掌握系統(tǒng)程序設(shè)計(jì)的基礎(chǔ)知識(shí);4)深化理解并掌握數(shù)據(jù)庫原理及應(yīng)用課程的相關(guān)內(nèi)容;5)強(qiáng)化軟件開發(fā)的團(tuán)隊(duì)意識(shí),提高合作能力。系統(tǒng)需求分析與設(shè)計(jì)數(shù)據(jù)流圖ER圖數(shù)據(jù)結(jié)構(gòu)描述商品數(shù)據(jù)結(jié)構(gòu):ShanidChar6ShannameChar8ShancountSmailint2ShanpriceSmailint2Factoridchar6公司數(shù)據(jù)結(jié)構(gòu):FactoridChar6FactornamevarChar24FactoraddrvarChar24FactorphoneChar11銷售數(shù)據(jù)結(jié)構(gòu):ShanidChar6FactoridChar6SalsecountSmailint2銷售管理系統(tǒng)軟件設(shè)計(jì)流程圖和功能模塊圖商品信息查詢商品信息錄入銷售信息查詢銷售信息錄入公司信息查詢公司信息錄入程序模塊匯總 商品信息錄入; 商品信息查詢; 公司信息錄入; 公司信息查詢; 銷售信息錄入; 銷售信息查詢;源程序清單主目錄:using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) Response.Redirect(/Default2.aspx); protected void Button3_Click(object sender, EventArgs e) Response.Redirect(/Default3.aspx); protected void Button2_Click(object sender, EventArgs e) Response.Redirect(/Default4.aspx); protected void Button4_Click(object sender, EventArgs e) Response.Redirect(/Default6.aspx); protected void Button5_Click(object sender, EventArgs e) Response.Redirect(/Default4.aspx); protected void Button6_Click(object sender, EventArgs e) Response.Redirect(/Default5.aspx); protected void Button7_Click(object sender, EventArgs e) Response.Redirect(/Default7.aspx); 1 商品信息錄入;using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Default2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button3_Click(object sender, EventArgs e) if (ShangID.Text.Trim().Length 1) Response.Write(window.alert(沒有要?jiǎng)h除的項(xiàng)!); return; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string select = select count(*) as total from S where ShanID=+ ShangID.Text.Trim()+ ; SqlCommand cmdsel = new SqlCommand(select, con); SqlDataReader dr = cmdsel.ExecuteReader(); if (dr.Read() if (int.Parse(drtotal.ToString() = 0) Response.Write(window.alert(要?jiǎng)h除的記錄不存在!); return; dr.Close(); string str = delete from S where ShanID= + + ShangID.Text.Trim() + ; SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); con.Close(); protected void Exit_Click(object sender, EventArgs e) Response.Redirect (/Default.aspx);protected void Insert_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;uid=sa;pwd=123456;database=studb); con.Open(); string insert = insert into S(ShanID,ShanName,ShanCount,ShanPrice,FactoryID) values( + + ShangID.Text.Trim() + + , + + ShangName.Text.Trim() + + , + ShangCount.Text.Trim() + , + + ShangPrice.Text.Trim() + + , + + ShangAddr.Text.Trim() + + ); Response.Write(insert); SqlCommand cmd1 = new SqlCommand(insert, con); cmd1.ExecuteNonQuery(); con.Close();2 商品信息查詢;using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Default3 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void MoveToFirst_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select ShanID from S order by ShanID asc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() string Student = srShanID.ToString(); Refresh(Student); sr.Close(); private void Refresh(string shangId) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select * from S where ShanID= + + shangId.ToString() + ; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() ShangID.Text = shangId.ToString(); ShangName.Text = srShanName.ToString(); ShangCount.Text = srShanCount.ToString(); ShangPrice.Text = srShanPrice.ToString(); ShangAddr.Text = srFactoryID.ToString(); protected void MoveToPre_Click(object sender, EventArgs e) if (ShangID.Text.Trim().Length 1) Response.Write(window.alert(請(qǐng)選擇一個(gè)當(dāng)前項(xiàng)!); return; string shangid = ; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select ShanID from S order by ShanID asc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() shangid = srShanID.ToString(); sr.Close(); if (shangid = ShangID.Text.Trim() Response.Write(window.alert(當(dāng)前數(shù)據(jù)項(xiàng)已經(jīng)是第一個(gè)了!); return; else string tempstr = select max(ShanID) as maxid from S where ShanID + + ShangID.Text.Trim() + ; cmd.CommandText = tempstr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() string shId = drmaxid.ToString(); Refresh(shId); con.Close(); protected void MoveToNext_Click(object sender, EventArgs e) if (ShangID.Text.Trim().Length 1) Response.Write(window.alert(請(qǐng)選擇一個(gè)當(dāng)前項(xiàng)!); return; string shangid = ; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select ShanID from S order by ShanID desc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() shangid = srShanID.ToString(); sr.Close(); if (shangid = ShangID.Text.Trim() Response.Write(window.alert(當(dāng)前數(shù)據(jù)項(xiàng)已經(jīng)是最后一個(gè)了!); return; else string tempstr = select min(ShanID) as maxid from S where ShanID + + ShangID.Text.Trim() + ; cmd.CommandText = tempstr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() string shId = drmaxid.ToString(); Refresh(shId); con.Close(); protected void MoveToLast_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select ShanID from S order by ShanID desc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() string Shang = srShanID.ToString(); Refresh(Shang); sr.Close(); con.Close(); protected void KeySelect_Click(object sender, EventArgs e) bool find = false; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string cmdstr = select * from S; SqlDataAdapter da = new SqlDataAdapter(cmdstr, con); DataSet ds = new DataSet(); da.Fill(ds); for (int i = 0; i ds.Tables0.Rows.Count; i+) for (int j = 0; j ds.Tables0.Columns.Count; j+) string data = (ds.Tables0.Rowsij.ToString().Trim(); if (data = Select.Text.Trim() ShangID.Text = ds.Tables0.RowsiShanID.ToString(); ShangName.Text = ds.Tables0.RowsiShanName.ToString(); ShangCount.Text = ds.Tables0.RowsiShanCount.ToString(); ShangPrice.Text = ds.Tables0.RowsiShanPrice.ToString(); ShangAddr.Text = ds.Tables0.RowsiFactoryID.ToString(); find = true; if (find = false) Response.Write(window.alert(沒有相關(guān)記錄!); con.Close(); protected void Exit_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); 3 公司信息錄入;using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Default4 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Insert_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;uid=sa;pwd=123456;database=studb); con.Open(); string insert = insert into Factory(FactorID,FactorName,FactorAddr,FactorPhone) values( + + FactoryID.Text.Trim() + + , + + FactoryName.Text.Trim() + + , + + FactoryAddr.Text.Trim() + + , + + FactoryPhone.Text.Trim() + + ); Response.Write(insert); SqlCommand cmd1 = new SqlCommand(insert, con); cmd1.ExecuteNonQuery(); con.Close(); protected void Delete_Click(object sender, EventArgs e) if (FactoryID.Text.Trim().Length 1) Response.Write(window.alert(沒有要?jiǎng)h除的項(xiàng)!); return; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string select = select count(*) as total from Factory where FactorID= + + FactoryID.Text.Trim() + ; SqlCommand cmdsel = new SqlCommand(select, con); SqlDataReader dr = cmdsel.ExecuteReader(); if (dr.Read() if (int.Parse(drtotal.ToString() = 0) Response.Write(window.alert(要?jiǎng)h除的記錄不存在!); return; dr.Close(); string str = delete from Factory where FactorID= + + FactoryID.Text.Trim() + ; SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); con.Close(); protected void Exit_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); 4 公司信息查詢;using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Default5 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void MoveToFirst_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select FactorID from Factory order by FactorID asc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() string Student = srFactorID.ToString(); Refresh(Student); sr.Close(); private void Refresh(string factorId) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select * from Factory where FactorID= + + factorId.ToString() + ; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() FactoryID.Text = factorId.ToString(); FactoryName.Text = srFactorName.ToString(); FactoryAddr.Text = srFactorAddr.ToString(); FactoryPhone.Text = srFactorPhone.ToString(); protected void MoveToPre_Click(object sender, EventArgs e) if (FactoryID.Text.Trim().Length 1) Response.Write(window.alert(請(qǐng)選擇一個(gè)當(dāng)前項(xiàng)!); return; string factoryid = ; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select FactorID from Factory order by FactorID asc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() factoryid = srFactorID.ToString(); sr.Close(); if (factoryid = FactoryID.Text.Trim() Response.Write(window.alert(當(dāng)前數(shù)據(jù)項(xiàng)已經(jīng)是第一個(gè)了!); return; else string tempstr = select max(FactorID) as maxid from Factory where FactorID + + FactoryID.Text.Trim() + ; cmd.CommandText = tempstr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() string faId = drmaxid.ToString(); Refresh(faId); con.Close(); protected void MoveToNext_Click(object sender, EventArgs e) if (FactoryID.Text.Trim().Length 1) Response.Write(window.alert(請(qǐng)選擇一個(gè)當(dāng)前項(xiàng)!); return; string factoryid = ; SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select FactorID from Factory order by FactorID desc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() factoryid = srFactorID.ToString(); sr.Close(); if (factoryid = FactoryID.Text.Trim() Response.Write(window.alert(當(dāng)前數(shù)據(jù)項(xiàng)已經(jīng)是最后一個(gè)了!); return; else string tempstr = select min(FactorID) as maxid from Factory where FactorID + + FactoryID.Text.Trim() + ; cmd.CommandText = tempstr; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() string faId = drmaxid.ToString(); Refresh(faId); con.Close(); protected void MoveToLast_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=localhost;user id=sa;pwd=123456;database=studb); con.Open(); string str = select FactorID from Factory order by FactorID desc; SqlCommand cmd = new SqlCommand(str, con); SqlDataReader sr = cmd.ExecuteReader(); if (sr.Read() string Factory = srFactorID.ToString(); Refresh(Factory); sr.Close(); con.Close(); protected void Selecte_Click(object sender, EventArgs e) bool find = false; SqlConnectio

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論