數(shù)據(jù)庫課程設(shè)計--- 百貨進銷存信息管理系統(tǒng)_第1頁
數(shù)據(jù)庫課程設(shè)計--- 百貨進銷存信息管理系統(tǒng)_第2頁
數(shù)據(jù)庫課程設(shè)計--- 百貨進銷存信息管理系統(tǒng)_第3頁
數(shù)據(jù)庫課程設(shè)計--- 百貨進銷存信息管理系統(tǒng)_第4頁
數(shù)據(jù)庫課程設(shè)計--- 百貨進銷存信息管理系統(tǒng)_第5頁
已閱讀5頁,還剩11頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、精品文檔數(shù)據(jù)庫課程設(shè)計報告 百貨進銷存信息管理系統(tǒng)班級: 計101班姓名: 劉春暉 學(xué)號: 1013023002 歡迎下載精品文檔一、課題名稱題目:企業(yè)進銷存管理信息系統(tǒng)開發(fā)工具:Visual Studio 2021,SQL Server 2005數(shù)據(jù)庫:SQL Server 2005操作系統(tǒng):windows7二、設(shè)計目的和要求、任務(wù)2.1目的和要求通過本次課程設(shè)計,加深對數(shù)據(jù)庫原理以及相關(guān)程序設(shè)計語言的理解和應(yīng)用水平。通過設(shè)計實際的數(shù)據(jù)庫系統(tǒng)應(yīng)用課題,進一步熟悉數(shù)據(jù)庫管理系統(tǒng)的操作技術(shù),提高動手能力,提高分析問題和解決問題的能力。2.2任務(wù) 自選一種程序設(shè)計語言以及一種數(shù)據(jù)庫管理系統(tǒng)開發(fā)一個

2、小型的數(shù)據(jù)庫應(yīng)用系統(tǒng)。2.3主要內(nèi)容系統(tǒng)分析與數(shù)據(jù)庫設(shè)計階段1進行系統(tǒng)需求分析和系統(tǒng)設(shè)計。2設(shè)計數(shù)據(jù)模型并進行優(yōu)化,確定數(shù)據(jù)庫結(jié)構(gòu)、功能結(jié)構(gòu)和系統(tǒng)平安性、完整性要求。應(yīng)用程序設(shè)計階段1完成數(shù)據(jù)庫定義工作,實現(xiàn)系統(tǒng)數(shù)據(jù)的處理和錄入。2實現(xiàn)應(yīng)用程序的設(shè)計、編程、優(yōu)化功能。系統(tǒng)集成調(diào)試階段 對系統(tǒng)的各個應(yīng)用程序進行集成和調(diào)試,進一步優(yōu)化系統(tǒng)性能,改善系統(tǒng)用戶界面。三、需求分析3.1 用戶需求說明 數(shù)據(jù)需求商品信息:商品號,商品名,商品屬性入庫信息:倉庫號,商品名,經(jīng)辦人,數(shù)量出庫信息:倉庫號,商品名,經(jīng)辦人,數(shù)量調(diào)價信息:商品號,調(diào)后價格 事務(wù)需求查詢商品信息添加商品刪除商品修改商品信息商品入庫商品

3、出庫添加職工信息添加倉庫信息3.2 系統(tǒng)需求說明 1) 軟件環(huán)境軟件環(huán)境需支持windows操作系統(tǒng),sql server數(shù)據(jù)庫,Visual Studio 20212) 初始數(shù)據(jù)庫大小大約有7部庫存商品大約有4個員工至少有一名管理員其它初始信息可為零3) 記錄查找的類型和平均數(shù)量查詢庫存商品信息 每天大約20次查詢出庫記錄 每天大約5-10次查詢銷售記錄 每天大約20-30次查詢調(diào)價記錄 每天大約3-10次4) 性能單個記錄查詢時間少于一秒多個記錄查詢時間少于三秒添加、刪除、更新記錄時間少于五秒四、總體功能設(shè)計五、數(shù)據(jù)庫設(shè)計 數(shù)據(jù)庫結(jié)構(gòu)設(shè)計管理員登陸表 employee員工表 C 商品表 P

4、 倉庫表 S 進貨,出庫表 SPC 六、應(yīng)用程序設(shè)計功能模塊及詳細代碼1.登陸界面實現(xiàn)用戶管理員的登陸Admin_Login.aspxAdmin_Login.cs 關(guān)鍵代碼protected void Button1_Click(object sender, System.EventArgs e)string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open();SqlCommand cmd=new SqlCommand("sele

5、ct * from employee where employeename='"+this.txtUserName.Text.Trim()+"'",con);SqlDataReader sdr=cmd.ExecuteReader();if(!sdr.Read()con.Close();Response.Write("<script>alert('對不起沒有該管理員存在你的物理地址和將被記錄')</script>");this.txtUserName.Text=""thi

6、s.txtUserPwd.Text=""return;elseif(this.txtUserPwd.Text.Trim()!=sdr"pwd".ToString()con.Close();Response.Write("<script>alert('密碼錯誤你的物理地址和將記錄!')</script>");this.txtUserPwd.Text=""this.txtUserName.Text=""return;elsecon.Close();Sessio

7、n"employeename"=this.txtUserName.Text.Trim();Response.Redirect("Admin_index.aspx");sdr.Close();con.Close();protected void Button2_Click(object sender, System.EventArgs e)this.txtUserPwd.Text=""this.txtUserName.Text="" 2.主界面成功登陸顯示歡送界面Admin_Index.aspx3.商品、員工、倉庫的

8、添加頁面來用實現(xiàn)商品、員工、倉庫的添加Admin_PAdd.aspx Admin_CAdd.aspx Admin_SAdd.aspxAdmin_PAdd.CS關(guān)鍵代碼protected void btnSubmit_Click(object sender, System.EventArgs e)string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open(); string T1 = this.Textbox1.Text; int i1 =

9、 Convert.ToInt16(T1); string T2 = this.Textbox2.Text; int i2 = Convert.ToInt16(T2); string str = "insert into P(Pno,Pname,Im,Om,Number)values('" + this.txtTitle.Text.Trim().Replace("'", "''") + "','" + this.txtSource.Text + "',

10、'" + i1+ "','" + i2 + "',0)" SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Response.Redirect("Admin_PL.aspx");Admin_CAdd.CS 關(guān)鍵代碼protected void btnSubmit_Click(object sender, System.EventArgs e)string d

11、sn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open(); string str = "insert into C(Cno,Cname,Csex)values('" + this.txtTitle.Text.Trim().Replace("'", "''") + "','" + this.txtSource.Text +

12、"','" + this.Textbox1.Text + "')" SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Response.Redirect("Admin_CL.aspx");Admin_SAdd.CS關(guān)鍵代碼protected void btnSubmit_Click(object sender, System.EventArgs e)string dsn=Co

13、nfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open(); string T1 = this.Textbox1.Text; int i1 = Convert.ToInt16(T1); string str = "insert into S(Sno,Sname,Ssize)values('" + this.txtTitle.Text.Trim().Replace("'", "''

14、") + "','" + this.txtSource.Text + "','" + i1+ "')" SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Response.Redirect("Admin_SL.aspx");4. 商品、員工、倉庫的顯示頁面實現(xiàn)商品、員工、倉庫的顯示Admin_PL.aspx Admin_CL.as

15、px Admin_SL.aspxAdmin_PL.CS 關(guān)鍵代碼public partial class rscadm_Admin_ArticleAdd : System.Web.UI.Page string Pno = "" protected void Page_Load(object sender, EventArgs e) if (Session"employeename" = null) Response.Redirect("admin_login.aspx"); string dsn = ConfigurationSett

16、ings.AppSettings"dsn" SqlConnection con = new SqlConnection(dsn); con.Open(); string str = "select Pno,Pname,Im,Om,Number from P" SqlDataAdapter sda = new SqlDataAdapter(str, con); DataSet ds = new DataSet(); sda.Fill(ds, "PList"); this.dgTopic.DataSource = ds.Tables&qu

17、ot;PList".DefaultView; this.dgTopic.DataBind(); ds.Clear(); sda.Dispose(); con.Close(); Admin_CL.CS 關(guān)鍵代碼public partial class rscadm_Admin_ArticleAdd : System.Web.UI.Page string Pno = "" protected void Page_Load(object sender, EventArgs e) if (Session"employeename" = null) Re

18、sponse.Redirect("admin_login.aspx"); string dsn = ConfigurationSettings.AppSettings"dsn" SqlConnection con = new SqlConnection(dsn); con.Open(); string str = "select Cno,Cname,Csex from C" SqlDataAdapter sda = new SqlDataAdapter(str, con); DataSet ds = new DataSet(); sd

19、a.Fill(ds, "PList"); this.dgTopic.DataSource = ds.Tables"PList".DefaultView; this.dgTopic.DataBind(); ds.Clear(); sda.Dispose(); con.Close(); Admin_SL.CS 關(guān)鍵代碼public partial class rscadm_Admin_ArticleAdd : System.Web.UI.Page string Pno = "" protected void Page_Load(objec

20、t sender, EventArgs e) if (Session"employeename" = null) Response.Redirect("admin_login.aspx"); string dsn = ConfigurationSettings.AppSettings"dsn" SqlConnection con = new SqlConnection(dsn); con.Open(); string str = "select Sno,Sname from S" SqlDataAdapter sd

21、a = new SqlDataAdapter(str, con); DataSet ds = new DataSet(); sda.Fill(ds, "PList"); this.dgTopic.DataSource = ds.Tables"PList".DefaultView; this.dgTopic.DataBind(); ds.Clear(); sda.Dispose(); con.Close(); 5.進貨系統(tǒng)實現(xiàn)商品進貨Admin_SPCIAdd.aspxAdmin_SPCIAdd.CS關(guān)鍵代碼protected void btnSubmit

22、_Click(object sender, System.EventArgs e)string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open(); string T1 = this.Textbox2.Text; int i1 = Convert.ToInt16(T1); string str = "update P set Number=Number + "+i1+" where Pno='"

23、;+this.txtTitle.Text.Trim().Replace("'", "''")+"' insert into SPC(Pno,Sno,Cno,Number,times)values('" + this.txtTitle.Text.Trim().Replace("'", "''") + "','" + this.txtSource.Text + "','&qu

24、ot; + this.Textbox1.Text + "','" + i1 + "','" + this.DropDownCalendar1.Value + "')" SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Response.Redirect("Admin_PL.aspx");6.出庫系統(tǒng)實現(xiàn)商品出庫Admin_SPCOAdd.a

25、spxAdmin_SPCOAdd.CS關(guān)鍵代碼protected void btnSubmit_Click(object sender, System.EventArgs e)string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open(); string T1 = this.Textbox2.Text; int i1 = Convert.ToInt16(T1)*(-1); string str = "update P set N

26、umber=Number + " + i1 + " where Pno='" + this.txtTitle.Text.Trim().Replace("'", "''") + "'insert into SPC(Pno,Sno,Cno,Number,times)values('" + this.txtTitle.Text.Trim().Replace("'", "''") + "

27、9;,'" + this.txtSource.Text + "','" + this.Textbox1.Text + "','" + i1 + "','" + this.DropDownCalendar1.Value + "')" SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); Response.Redi

28、rect("Admin_PL.aspx");7.商品信息管理對已添加的商品進行名稱、進價、售價的修改Admin_PX.aspxAdmin_PX.CS關(guān)鍵代碼public partial class protected void Page_Load(object sender, System.EventArgs e)if(Session"employeename"=null)Response.Redirect("admin_login.aspx");if(!this.IsPostBack)BindData();private void

29、BindData()string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open();SqlDataAdapter sda=new SqlDataAdapter("select Pno,Pname,Im,Om from P ",con);DataSet ds=new DataSet();sda.Fill(ds,"PList");this.dgTopic.DataKeyField="Pno&q

30、uot;this.dgTopic.DataSource=ds.Tables"PList".DefaultView;this.dgTopic.DataBind(); ds.Clear(); sda.Dispose();con.Close();private void dgTopic_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)this.dgTopic.EditItemIndex=-1;this.BindData();private void dgTopic_

31、DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open();SqlCommand cmd=new SqlCommand("delete from P where Pno='"+this.dgTopic.DataKeyse.Item.ItemInd

32、ex.ToString()+"'",con);cmd.ExecuteNonQuery(); cmd.Dispose();con.Close();BindData();private void dgTopic_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)this.dgTopic.EditItemIndex=e.Item.ItemIndex;this.BindData();private void dgTopic_PageIndexChanged(obje

33、ct source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)this.dgTopic.CurrentPageIndex=e.NewPageIndex;this.BindData();private void dgTopic_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)string Pno=this.dgTopic.DataKeyse.Item.ItemIndex.ToString();string P

34、name=(TextBox)(e.Item.Cells1.Controls0).Text;string T1=(TextBox)(e.Item.Cells2.Controls0).Text; int Im = Convert.ToInt16(T1);string T2=(TextBox)(e.Item.Cells3.Controls0).Text; int Om = Convert.ToInt16(T2);string dsn=ConfigurationSettings.AppSettings"dsn"SqlConnection con=new SqlConnection(dsn);con.Open();SqlCommand cmd=new SqlCommand("update P set Pname='"+Pname+"',Im='"+Im+"',Om='"+Om+"' where Pno='"+Pno+"'",con);cmd.ExecuteN

溫馨提示

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

評論

0/150

提交評論