




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、計算機工程學院Project2(GUI+SQL2005)實習報告選題名稱: 倉庫管理系統(tǒng) 專業(yè): 計算機科學與技術(軟件工程方向) 班級: 軟件1092 姓名: 王偉劍 學號: 1091305220 指導教師: 馮萬利 于長輝 高尚兵 莊軍 2011 年 06 月 11 日Project2(GUI+SQL2005)實習任務書課題名稱倉庫管理系統(tǒng)設計目的1. 掌握面向對象的程序設計技術和方法;2. 學習用C#設計GUI程序解決實際問題;3. 熟悉VS.NET開發(fā)平臺,能使用.NET平臺進行程序設計及程序調(diào)試;4. 能使用ADO.NET進行數(shù)據(jù)庫系統(tǒng)設計與開發(fā)。實驗環(huán)境1. Windows XP
2、操作系統(tǒng)2. Visual Studio 開發(fā)平臺3. SQL Server2005數(shù)據(jù)庫管理系統(tǒng)任務要求1 利用C#編程思想進行可視化編程,完成系統(tǒng)的設計。突出體現(xiàn)C#語言與其他語言的不同。2 根據(jù)課題需要自主創(chuàng)建sql數(shù)據(jù)庫,表內(nèi)數(shù)據(jù)關聯(lián)緊密,數(shù)據(jù)合理且規(guī)范化,避免數(shù)據(jù)冗余。3 能合適的選擇高級控件(如:菜單欄,工具欄,dataGridView,treeView等)完成課題內(nèi)容,窗口布局合理。4 每個學生從所給題目中任選一題,必須獨立完成,不能相互抄襲。工作進度計劃序號起止日期工 作 內(nèi) 容12011-4-11 2011-6-5需求分析22011-6-6 2011-6-6系統(tǒng)設計32011
3、-6-7 2011-6-9系統(tǒng)實現(xiàn)42011-6-9 2011-6-9撰寫實習報告52011-6-10 2011-6-10實習答辯指導教師(簽章): 2011 年 06 月 日 摘要: 隨著現(xiàn)代工業(yè)的發(fā)展,計算機信息管理系統(tǒng)越來越受到企業(yè)的重視。本文主要分析介紹了倉庫管理系統(tǒng)的一些基本功能和組成情況,包括系統(tǒng)的需求分析、系統(tǒng)結構、功能模塊劃分以及數(shù)據(jù)庫模式分析等,重點對應用程序的實際開發(fā)實現(xiàn)作了介紹。達到了數(shù)據(jù)的一致性和安全性,且應用程序功能完備,符合了庫存管理系統(tǒng)作為典型的信息管理系統(tǒng)(MIS)的要求。同時簡單介紹了Visual Studio 2008編程環(huán)境和SQL數(shù)據(jù)庫管理系統(tǒng)的功能特點
4、,庫存管理系統(tǒng)是企業(yè)物流管理中不可或缺的的一部分。本系統(tǒng)利用ASO三層架構,完成系統(tǒng)登錄,注銷,修改密碼的基本功能,倉庫入庫登記,出庫登記,倉庫貨物預警,倉庫內(nèi)貨物盤點的主要功能。本系統(tǒng)并不復雜,主要完成通過GUI開發(fā),利用關鍵字對數(shù)據(jù)庫進行增刪改查等操作。關鍵詞:倉庫管理;數(shù)據(jù)庫;信息管理;Visual Studio 2008目 錄1 需求分析1.1 系統(tǒng)概述倉庫存放的貨物品種繁多,堆放方式以及處理過程也很復雜。隨著業(yè)務量的增加,倉庫管理者需要處理的信息量會大幅上升,因此往往很難及時準確的掌握整個倉庫的運作狀態(tài)。針對這一情況,本系統(tǒng)在滿足倉庫的基本管理功能基礎上發(fā)揮信息系統(tǒng)的智能化,減輕倉庫
5、管理人員和操作人員的工作負擔。系統(tǒng)主要實現(xiàn)目標是監(jiān)控整個倉庫的運作情況;提供完整的計劃任務功能,由整個操作系統(tǒng)的指令中心來安排進出任務,確認任務的開始,進貨管理和出貨管理按其指令執(zhí)行即可;實時監(jiān)控所有貨物的在線運動的情況,實時提供倉庫變化的信息。1.2系統(tǒng)總體需求根據(jù)詳細的需求分析,企業(yè)在庫存中面臨的主要問題體現(xiàn)在:庫存量大,庫存資金周轉慢,不能及時統(tǒng)計庫存物料;庫房人員重復工作多,效率低;不知道庫存物資積壓時間長短。系統(tǒng)輸入繁瑣,極易產(chǎn)生輸入錯誤,缺少智能化輸入功能,如:產(chǎn)品名稱輸入過程中,產(chǎn)品名稱和產(chǎn)品代碼不能夠相互協(xié)調(diào),易產(chǎn)生不匹配現(xiàn)象。另外,整個系統(tǒng)運行較慢,數(shù)據(jù)處理能力不夠,進行一個
6、查詢往往需要等待很長時間。該系統(tǒng)還缺少通用庫存管理理功能,貨物組成條目都是經(jīng)過手工計算的,工作量很大,且容易產(chǎn)生錯誤,有一個小錯誤,核對都需要花費很大的精力,換句話說,當前沒有通用庫存管理系統(tǒng)。本系統(tǒng)從最初的采購到存儲和出庫,倉庫管理將決定企業(yè)是否兌現(xiàn)其承諾。從倉庫計劃到倉庫操作和交叉運輸,優(yōu)化的倉庫將有助于大幅度減少企業(yè)的庫存量和和貨物成本,因為企業(yè)將能保持較低的庫存貨水平,優(yōu)化入庫,保管和出庫活動,并且協(xié)調(diào)載貨量。1.3可行性分析技術上可行:該系統(tǒng)所需硬件設備,市場上銷售且價格較低,甚至可以使用原有的設備,軟件上,操作系統(tǒng)采用Windows系列操作系統(tǒng),數(shù)據(jù)庫管理系統(tǒng)采用Visual St
7、udio 2008,這些軟件在GUI開發(fā)中已被大量應用,技術上都比較成熟。因此在技術上是可行的。2 概要設計輸入賬號 密 碼 登 錄賬號密碼符合要求主要功能重新輸入退出2.1E-R圖NY修改密碼注銷主要功能庫存盤點倉庫預警出庫登記入庫登記顯示庫內(nèi)貨物詳情輸入預警數(shù)量輸入貨物詳情輸入貨物詳情顯示數(shù)量不足貨物詳情數(shù)據(jù)庫,信息欄同步修改數(shù)據(jù)庫,信息欄同步修改2.2相關說明登錄系統(tǒng):賬號密碼均存儲于SQL數(shù)據(jù)庫中。輸入賬號及賬號對應密碼,即可登錄系統(tǒng)。修改密碼:需輸入一次原密碼,輸入兩次新密碼相同即可修改。密碼修改同步于SQL數(shù)據(jù)庫。注銷: 登錄賬號退出,返回登陸界面。退出系統(tǒng): 系統(tǒng)退出。入庫登記:
8、輸入產(chǎn)品ID,即可直接獲得產(chǎn)品的相關信息,此時輸入入庫數(shù)量就可以完成貨物的入庫操作,如果此時產(chǎn)品為新產(chǎn)品,需輸入產(chǎn)品的詳細信息,就可以完成貨物的入庫操作。入庫操作同步更新SQL數(shù)據(jù)庫。出庫登記:輸入產(chǎn)品ID,即可直接獲得產(chǎn)品的相關信息,此時輸入出庫數(shù)量就可以完成貨物的出庫操作,入庫操作同步更新SQL數(shù)據(jù)庫。倉庫預警:輸入預警數(shù)量,點擊確定按鈕,此時顯示數(shù)據(jù)庫中,貨物數(shù)量小于預警數(shù)量的貨物總數(shù)和貨物詳細信息。商品查詢:顯示倉庫中所有貨物的詳細信息,可以輸入產(chǎn)品ID和產(chǎn)品名稱進行貨物查詢,支持模糊查找。3 詳細設計3.1數(shù)據(jù)庫表定義Users表(用戶信息表)Goods表(貨物詳情表)Worehou
9、ses表(倉庫信息表)3.2GUI框架設計1用戶系統(tǒng)2主菜單3密碼修改4貨物入庫5 貨物出庫6 庫存預警7 商品查詢4 編碼實現(xiàn)登錄系統(tǒng)public static string pwd; public static string pid; private void button1_Click(object sender, EventArgs e) pwd = this.textBox1.Text; pid = this.textBox2.Text; Logs l = new Logs(); if (int.Parse (l.isPassword(this.textBox2.Text,this.
10、textBox1.Text).ToString () )= 1) this.Hide(); Management m = new Management(); m.ShowDialog(); else DialogResult dr = MessageBox.Show("請檢查您的用戶名和密碼", "登錄失敗", MessageBoxButtons.YesNo); if (DialogResult.No=dr) Application.Exit(); private void button2_Click(object sender, EventArgs e
11、) Application.Exit(); 主菜單public partial class Management : Form public Management() InitializeComponent(); private void ChangeToolStripMenuItem_Click(object sender, EventArgs e) ChangePassword cp = new ChangePassword(); cp.ShowDialog(); private void LogoutToolStripMenuItem_Click(object sender, Event
12、Args e) DialogResult dr = MessageBox.Show("您確定要注銷嗎?","注銷", MessageBoxButtons.YesNo); if (dr = DialogResult.Yes) Application.Exit(); private void OutToolStripMenuItem_Click(object sender, EventArgs e) Application.Exit(); private void Management_Load(object sender, EventArgs e) thi
13、s.goodsTableAdapter.Fill(this.wmsDataSet.Goods); private void Management_FormClosed(object sender, FormClosedEventArgs e) Application.Exit(); private void InputF2ToolStripMenuItem_Click(object sender, EventArgs e) InputWHForm iwh = new InputWHForm(); iwh.ShowDialog (); private void Management_Activa
14、ted(object sender, EventArgs e) this.goodsTableAdapter.Fill(this.wmsDataSet.Goods); private void OutF6ToolStripMenuItem_Click(object sender, EventArgs e) OutWHForm owh = new OutWHForm(); owh.ShowDialog (); private void WarningToolStripMenuItem_Click(object sender, EventArgs e) Warning w = new Warnin
15、g(); w.ShowDialog(); private void GoodsDetailsToolStripMenuItem_Click(object sender, EventArgs e) this.goodsTableAdapter.Fill(this.wmsDataSet.Goods); private void WareHouseDetailsToolStripMenuItem_Click(object sender, EventArgs e) this.warehousesTableAdapter.Fill(this.wmsDataSet1.Warehouses); privat
16、e void SearchToolStripMenuItem_Click(object sender, EventArgs e) Search s = new Search(); s.Show(); private void fillByToolStripButton_Click(object sender, EventArgs e) try this.goodsTableAdapter.FillBy(this.wmsDataSet.Goods); catch (System.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Messa
17、ge); 入庫登記 public partial class InputWHForm : Form public InputWHForm() InitializeComponent(); private void InputWHForm_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“wmsDataSet4.Goods”中。您可以根據(jù)需要移動或移除它。 this.goodsTableAdapter.Fill(this.wmsDataSet4.Goods); private void button6_Click(object sender
18、, EventArgs e) this.Close(); public void SendToInput() GoodsDetails s = new GoodsDetails(); s.GID = int.Parse(this.textBox1.Text); s.GName = boBox1.Text; s.Gprice = float.Parse(this.textBox3.Text); s.GProvider1 = boBox1.Text; s.GProvider2 = boBox4.Text; s.Wname = int.Parse (boBox2.Text); s.Count = S
19、qlHelper.DefiniteCount(this.textBox1.Text) + int.Parse(this.textBox2.Text); SqlHelper.AddGoods(s); private void button5_Click(object sender, EventArgs e) SendToInput(); this.Close(); private void textBox1_TextChanged(object sender, EventArgs e) GoodsDetails g = SqlHelper.Bind(this.textBox1.Text); bo
20、Box3.Text = g.GName; this.textBox3.Text = g.Gprice.ToString (); boBox1.Text = g.GProvider1; boBox4.Text = g.GProvider2; boBox2.Text = g.Wname.ToString (); 出庫登記public partial class OutWHForm : Form public OutWHForm() InitializeComponent(); private void button2_Click(object sender, EventArgs e) this.C
21、lose(); private void button1_Click(object sender, EventArgs e) SentToOutput(); this.Close(); private void SentToOutput() GoodsDetails s = new GoodsDetails(); s.GID = int.Parse(this.textBox1.Text); s.GName = boBox1.Text; s.Gprice = float.Parse(this.textBox3.Text); s.GProvider1 = boBox1.Text; s.GProvi
22、der2 = boBox4.Text; s.Count = SqlHelper.DefiniteCount(this.textBox1.Text) - int.Parse(this.textBox2.Text); SqlHelper.OutGoods(s); private void OutWHForm_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“wmsDataSet2.Goods”中。您可以根據(jù)需要移動或移除它。 this.goodsTableAdapter.Fill(this.wmsDataSet2.Goods); privat
23、e void textBox1_TextChanged(object sender, EventArgs e) GoodsDetails g = SqlHelper.Bind(this.textBox1.Text); boBox3.Text = g.GName; this.textBox3.Text = g.Gprice.ToString (); boBox1.Text = g.GProvider1; boBox4.Text = g.GProvider2; 庫存預警 public partial class Warning : Form public Warning() InitializeC
24、omponent(); private void button3_Click(object sender, EventArgs e) this.listBox1.Items.Clear(); List<GoodsDetails> g = new List<GoodsDetails>(); g = SqlHelper.WarningBind(this.textBox2.Text); int i = 0; for ( i=0; i < g.Count();i+ ) this.listBox1.Items.Add(gi.GID.ToString().PadLeft(4)
25、 + gi.GName.PadLeft(20) + gi.Count.ToString().PadLeft(10) + gi.GProvider1.PadLeft(20) + gi.GProvider2.PadLeft(10); this.textBox1.Text = i.ToString(); 貨物查詢public partial class Search : Form public Search() InitializeComponent(); private void button1_Click(object sender, EventArgs e) this.Close(); pri
26、vate void Search_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“wmsDataSet5.Goods”中。您可以根據(jù)需要移動或移除它。 this.goodsTableAdapter.Fill(this.wmsDataSet5.Goods); private void button2_Click(object sender, EventArgs e) GoodsDetails g = SqlHelper.BindVague(boBox3.Text); this.textBox1.Text = g.GID.ToString(
27、); this.textBox3.Text = g.Gprice.ToString(); boBox1.Text = g.GProvider1; boBox4.Text = g.GProvider2; boBox2.Text = g.Wname.ToString(); this.textBox2.Text = g.Count.ToString(); private void button3_Click(object sender, EventArgs e) GoodsDetails g = SqlHelper.Bind(this.textBox1.Text); boBox3.Text = g.
28、GName; this.textBox3.Text = g.Gprice.ToString(); boBox1.Text = g.GProvider1; boBox4.Text = g.GProvider2; boBox2.Text = g.Wname.ToString(); this.textBox2.Text = g.Count.ToString(); 數(shù)據(jù)庫連接 public static void ChangeDBPassword(int p,string p2) SqlConnection co = new SqlConnection(ConnectionString.con); S
29、qlCommand cmd = new SqlCommand(string.Format("update Users set Upassword='0' where UID='1'", p,p2), co); co.Open(); var i = (int)cmd.ExecuteNonQuery (); MessageBox.Show("密碼修改成功"); co.Close(); public static void AddGoods(GoodsDetails g) SqlConnection co = new SqlCo
30、nnection(ConnectionString.con); SqlCommand cmd3 = new SqlCommand(string.Format("select count(*) from Goods where 產(chǎn)品ID='0'", g.GID), co); co.Open (); int j=(int)cmd3.ExecuteScalar (); if(j=0) SqlCommand cmd2 = new SqlCommand(string.Format("insert into Goods values('0',&
31、#39;1','2','3','4','5','6','7')", g.GID ,g.GName ,g.Gprice,g.Count ,g.GProvider1 ,g.GProvider2 ,g.GDescribe,g.Wname ), co); int i = (int)cmd2.ExecuteNonQuery(); MessageBox.Show("添加成功"); co.Close(); else SqlCommand cmd1 = new SqlComma
32、nd(string.Format("update Goods set 產(chǎn)品名稱='1',產(chǎn)品價格='2',倉庫所剩數(shù)量='3',廠商='4',廠商='5',備注='6',收貨倉庫ID='7' where 產(chǎn)品ID='0'", g.GID, g.GName, g.Gprice, g.Count , g.GProvider1, g.GProvider2, g.GDescribe,g.Wname ), co); int i = (int)cmd1.Exe
33、cuteNonQuery(); MessageBox.Show("更新成功"); co.Close(); public static void OutGoods(GoodsDetails g) SqlConnection co = new SqlConnection(ConnectionString.con); try SqlCommand cmd1 = new SqlCommand(string.Format("update Goods set 產(chǎn)品名稱='1',產(chǎn)品價格='2',倉庫所剩數(shù)量='3',廠商=
34、9;4',廠商='5',備注='6',收貨倉庫ID='7' where 產(chǎn)品ID='0'", g.GID, g.GName, g.Gprice, g.Count, g.GProvider1, g.GProvider2, g.GDescribe,g.Wname ), co); co.Open(); int i = (int)cmd1.ExecuteNonQuery(); co.Close(); MessageBox.Show("倉庫出庫記錄完成"); catch (SqlException) M
35、essageBox.Show("出庫失敗"); public static int DefiniteCount(string p) SqlConnection co = new SqlConnection(ConnectionString.con); SqlCommand cmd = new SqlCommand(string.Format("select 倉庫所剩數(shù)量from Goods where 產(chǎn)品ID='0'", p), co); SqlCommand cmd1 = new SqlCommand(string.Format(&q
36、uot;select count(*) from Goods where 產(chǎn)品ID='0'", p), co); co.Open(); int i=0; if (int)cmd1.ExecuteScalar() = 1) i = (int)cmd.ExecuteScalar(); co.Close(); return i; public static GoodsDetails Bind(string p) SqlConnection co = new SqlConnection(ConnectionString.con); SqlCommand cmd = new S
37、qlCommand(string.Format("select * from Goods where 產(chǎn)品ID='0'", p), co); co.Open(); var i = cmd.ExecuteReader(); GoodsDetails g = new GoodsDetails(); while (i.Read() g.GName = i1.ToString(); g.Gprice = float.Parse(i2.ToString(); g.GProvider1 = i4.ToString(); g.GProvider2 = i5.ToStrin
38、g(); g.GDescribe = i6.ToString(); g.Count = (int)i3; g.Wname = (int)i7; return g; public static List<GoodsDetails> WarningBind(string p) SqlConnection co = new SqlConnection(ConnectionString.con); SqlCommand cmd = new SqlCommand(string.Format ("select * from Goods where 倉庫所剩數(shù)量<'0
39、39;",p), co); co.Open(); var i = cmd.ExecuteReader(); List<GoodsDetails> gd = new List<GoodsDetails>(); while (i.Read() GoodsDetails g = new GoodsDetails(); g.GName = i1.ToString(); g.GProvider1 = i4.ToString(); g.GProvider2 = i5.ToString(); g.Count = (int)i3; g.Wname = (int)i7; gd.
40、Add(g); return gd; public static GoodsDetails BindVague(string p) SqlConnection co = new SqlConnection(ConnectionString.con); SqlCommand cmd = new SqlCommand(string.Format("select * from Goods where 產(chǎn)品名稱like '%0%'", p), co); co.Open(); var i = cmd.ExecuteReader(); GoodsDetails g =
41、new GoodsDetails(); while (i.Read() g.GID = (int)i0; g.GName = i1.ToString(); g.Gprice = float.Parse(i2.ToString(); g.GProvider1 = i4.ToString(); g.GProvider2 = i5.ToString(); g.GDescribe = i6.ToString(); g.Count = (int)i3; g.Wname = (int)i7; return g; 5 總結 在這次課程設計中,讓我學到了很多在課堂和書本上學不到的知識,我在這次課程設計中最大的收獲有以下幾個方面: 一、領略到了數(shù)據(jù)庫設計在計算機領域的重要性。數(shù)據(jù)庫作為一個永久存儲形式在應用中發(fā)揮著重要的作用。在數(shù)據(jù)庫設計中,我明白了數(shù)據(jù)庫設計中不是范式越高越好的。我們要根據(jù)我們的應用來決定,一切應該以需求為首要選擇。 二、對變成環(huán)境、一些控件的使用和界面的美化方面更加熟悉。因為倉庫管理系統(tǒng)中涉及到很多控件的使用,只有很好的使用這些控件才可以給出一個很好的界面呈現(xiàn)在用戶的面前。這樣更有利于數(shù)據(jù)庫和用戶之間的交流。這里就要涉及一些平時不太常見的控件
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 惠州布袋風管施工方案
- 武漢學校智能地暖施工方案
- 隧洞豎井管棚施工方案
- 云浮無塵車間凈化施工方案
- 衛(wèi)生間防水上墻施工方案
- 2012年7月國家開放大學漢語言文學本科《中國現(xiàn)代文學專題》期末紙質(zhì)考試試題及答案
- 提升農(nóng)業(yè)生產(chǎn)技術的創(chuàng)新與應用實施方案
- 綠色就業(yè)與勞動市場轉型策略
- 加強污染防治和生態(tài)建設未來展望與持續(xù)改進措施
- 加強跨部門協(xié)作與整合資源的策略及實施路徑
- 九三學社申請入社人員簡歷表
- 2024年湖南株洲市天元區(qū)社區(qū)專職工作者招聘筆試沖刺題(帶答案解析)
- 腎臟疾病的早期發(fā)現(xiàn)和治療
- 村級財務監(jiān)督培訓課件
- 2024年赤峰職業(yè)技術學院高職單招(英語/數(shù)學/語文)筆試歷年真題摘選含答案解析
- 品質(zhì)組長晉升述職報告
- 大數(shù)據(jù)在國家安全與防控中的作用
- 水電廠設備分析報告
- 電腦一體機技術方案
- GB/T 9364.8-2023小型熔斷器第8部分:帶有特殊過電流保護的熔斷電阻器
- 《健康體檢報告解讀》課件
評論
0/150
提交評論