实习报告之仓库管理系统.docx

上传人:scccc 文档编号:13234224 上传时间:2021-12-19 格式:DOCX 页数:26 大小:185.28KB
返回 下载 相关 举报
实习报告之仓库管理系统.docx_第1页
第1页 / 共26页
实习报告之仓库管理系统.docx_第2页
第2页 / 共26页
实习报告之仓库管理系统.docx_第3页
第3页 / 共26页
实习报告之仓库管理系统.docx_第4页
第4页 / 共26页
实习报告之仓库管理系统.docx_第5页
第5页 / 共26页
点击查看更多>>
资源描述

《实习报告之仓库管理系统.docx》由会员分享,可在线阅读,更多相关《实习报告之仓库管理系统.docx(26页珍藏版)》请在三一文库上搜索。

1、计算机工程学院Project2(GUI+SQL2005)实习报告选题名称: 仓库管理系统 专业: 计算机科学与技术(软件工程方向) 班级: 软件1092 姓名: 王伟剑 学号: 1091305220 指导教师: 冯万利 于长辉 高尚兵 庄军 2011 年 06 月 11 日Project2(GUI+SQL2005)实习任务书课题名称仓库管理系统设计目的1. 掌握面向对象的程序设计技术和方法;2. 学习用C#设计GUI程序解决实际问题;3. 熟悉VS.NET开发平台,能使用.NET平台进行程序设计及程序调试;4. 能使用ADO.NET进行数据库系统设计与开发。实验环境1. Windows XP

2、操作系统2. Visual Studio 开发平台3. SQL Server2005数据库管理系统任务要求1 利用C#编程思想进行可视化编程,完成系统的设计。突出体现C#语言与其他语言的不同。2 根据课题需要自主创建sql数据库,表内数据关联紧密,数据合理且规范化,避免数据冗余。3 能合适的选择高级控件(如:菜单栏,工具栏,dataGridView,treeView等)完成课题内容,窗口布局合理。4 每个学生从所给题目中任选一题,必须独立完成,不能相互抄袭。工作进度计划序号起止日期工 作 内 容12011-4-11 2011-6-5需求分析22011-6-6 2011-6-6系统设计32011

3、-6-7 2011-6-9系统实现42011-6-9 2011-6-9撰写实习报告52011-6-10 2011-6-10实习答辩指导教师(签章): 2011 年 06 月 日 摘要: 随着现代工业的发展,计算机信息管理系统越来越受到企业的重视。本文主要分析介绍了仓库管理系统的一些基本功能和组成情况,包括系统的需求分析、系统结构、功能模块划分以及数据库模式分析等,重点对应用程序的实际开发实现作了介绍。达到了数据的一致性和安全性,且应用程序功能完备,符合了库存管理系统作为典型的信息管理系统(MIS)的要求。同时简单介绍了Visual Studio 2008编程环境和SQL数据库管理系统的功能特点

4、,库存管理系统是企业物流管理中不可或缺的的一部分。本系统利用ASO三层架构,完成系统登录,注销,修改密码的基本功能,仓库入库登记,出库登记,仓库货物预警,仓库内货物盘点的主要功能。本系统并不复杂,主要完成通过GUI开发,利用关键字对数据库进行增删改查等操作。关键词:仓库管理;数据库;信息管理;Visual Studio 2008目 录1 需求分析1.1 系统概述仓库存放的货物品种繁多,堆放方式以及处理过程也很复杂。随着业务量的增加,仓库管理者需要处理的信息量会大幅上升,因此往往很难及时准确的掌握整个仓库的运作状态。针对这一情况,本系统在满足仓库的基本管理功能基础上发挥信息系统的智能化,减轻仓库

5、管理人员和操作人员的工作负担。系统主要实现目标是监控整个仓库的运作情况;提供完整的计划任务功能,由整个操作系统的指令中心来安排进出任务,确认任务的开始,进货管理和出货管理按其指令执行即可;实时监控所有货物的在线运动的情况,实时提供仓库变化的信息。1.2系统总体需求根据详细的需求分析,企业在库存中面临的主要问题体现在:库存量大,库存资金周转慢,不能及时统计库存物料;库房人员重复工作多,效率低;不知道库存物资积压时间长短。系统输入繁琐,极易产生输入错误,缺少智能化输入功能,如:产品名称输入过程中,产品名称和产品代码不能够相互协调,易产生不匹配现象。另外,整个系统运行较慢,数据处理能力不够,进行一个

6、查询往往需要等待很长时间。该系统还缺少通用库存管理理功能,货物组成条目都是经过手工计算的,工作量很大,且容易产生错误,有一个小错误,核对都需要花费很大的精力,换句话说,当前没有通用库存管理系统。本系统从最初的采购到存储和出库,仓库管理将决定企业是否兑现其承诺。从仓库计划到仓库操作和交叉运输,优化的仓库将有助于大幅度减少企业的库存量和和货物成本,因为企业将能保持较低的库存货水平,优化入库,保管和出库活动,并且协调载货量。1.3可行性分析技术上可行:该系统所需硬件设备,市场上销售且价格较低,甚至可以使用原有的设备,软件上,操作系统采用Windows系列操作系统,数据库管理系统采用Visual St

7、udio 2008,这些软件在GUI开发中已被大量应用,技术上都比较成熟。因此在技术上是可行的。2 概要设计输入账号 密 码 登 录账号密码符合要求主要功能重新输入退出2.1E-R图NY修改密码注销主要功能库存盘点仓库预警出库登记入库登记显示库内货物详情输入预警数量输入货物详情输入货物详情显示数量不足货物详情数据库,信息栏同步修改数据库,信息栏同步修改2.2相关说明登录系统:账号密码均存储于SQL数据库中。输入账号及账号对应密码,即可登录系统。修改密码:需输入一次原密码,输入两次新密码相同即可修改。密码修改同步于SQL数据库。注销: 登录账号退出,返回登陆界面。退出系统: 系统退出。入库登记:

8、输入产品ID,即可直接获得产品的相关信息,此时输入入库数量就可以完成货物的入库操作,如果此时产品为新产品,需输入产品的详细信息,就可以完成货物的入库操作。入库操作同步更新SQL数据库。出库登记:输入产品ID,即可直接获得产品的相关信息,此时输入出库数量就可以完成货物的出库操作,入库操作同步更新SQL数据库。仓库预警:输入预警数量,点击确定按钮,此时显示数据库中,货物数量小于预警数量的货物总数和货物详细信息。商品查询:显示仓库中所有货物的详细信息,可以输入产品ID和产品名称进行货物查询,支持模糊查找。3 详细设计3.1数据库表定义Users表(用户信息表)Goods表(货物详情表)Worehou

9、ses表(仓库信息表)3.2GUI框架设计1用户系统2主菜单3密码修改4货物入库5 货物出库6 库存预警7 商品查询4 编码实现登录系统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: 这行代码将数据加载到表“wmsDataSet4.Goods”中。您可以根据需要移动或移除它。 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: 这行代码将数据加载到表“wmsDataSet2.Goods”中。您可以根据需要移动或移除它。 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: 这行代码将数据加载到表“wmsDataSet5.Goods”中。您可以根据需要移动或移除它。 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(); 数据库连接 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 产品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 产品名称='1',产品价格='2',仓库所剩数量='3',厂商='4',厂商='5',备注='6',收货仓库ID='7' where 产品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 产品名称='1',产品价格='2',仓库所剩数量='3',厂商=

34、9;4',厂商='5',备注='6',收货仓库ID='7' where 产品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 仓库所剩数量from Goods where 产品ID='0'", p), co); SqlCommand cmd1 = new SqlCommand(string.Format(&q

36、uot;select count(*) from Goods where 产品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 SqlCommand(string.Format("select * from Goods where 产品ID='0'", p), co);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1