收藏 分销(赏)

仓储物资管理系统数据库课程设计.doc

上传人:丰**** 文档编号:2934495 上传时间:2024-06-11 格式:DOC 页数:25 大小:619.93KB
下载 相关 举报
仓储物资管理系统数据库课程设计.doc_第1页
第1页 / 共25页
仓储物资管理系统数据库课程设计.doc_第2页
第2页 / 共25页
仓储物资管理系统数据库课程设计.doc_第3页
第3页 / 共25页
仓储物资管理系统数据库课程设计.doc_第4页
第4页 / 共25页
仓储物资管理系统数据库课程设计.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

1、 成 绩11信计2013-2014(一)数据库原理及应用课程设计设计题目 仓储物资管理系统 设计时间 2013.12.31-2014.1.4 学生姓名 张政伟 学生学号 20110402124 所在班级 11精算 指导教师 董晓玮 徐州工程学院数学与物理科学学院目 录1 可行性研究32 需求分析32.1 任务概述32.1.1 目标32.1.2 运行环境32.2 数据需求32.2.1 数据流条目32.2.2 数据库描述42.3 功能需求42.3.1 功能划分42.3.2 功能描述43 概要设计44 逻辑设计55 界面设计和代码75.1登陆界面设计75.2注册界面与代码95.3修改密码105.4系

2、统主界面设计和代码115.5查询信息管理界面设计135.6添加信息查询界面设计145.7出入库信息表设计185.8删改信息设计246总结25参考文献251 可行性研究仓库管理系统是为了实现企业产品管理的系统化、规范化和自动化,从而提高企业管理效率而设计的。它完全取代了原来一直用人工管理的工作方式,避免了由于管理人员的工作疏忽以及管理质量问题所造成的各种错误,为及时、准确、高效的完成仓库管理提供了强有力的工具和管理手段。仓库管理系统是一个中小型数据库管理系统,它界面美观、操作简单、安全性高,基本满足了仓库管理的要求。本系统的开发语言采用的是C#,开发环境采用的是Visual studio 200

3、8,数据库采用SQL Server 2005,具有一般系统的数据功能,如数据查询,修改和删除等。仓库管理系统在运行阶段,效果好,数据准确性高,提高了工作效率,同时也实现了仓库管理计算机化。2 需求分析 2.1 任务概述经过调查,对仓库管理的业务流程进行分析。库存的变化通常是通过入库、出库操作来进行。系统对每个入库操作均要求用户填写入库单,对每个出库操作均要求用户填写出库单。在出入库操作同时可以进行增加、删除和修改等操作。用户可以随时进行各种查询、统计、报表打印、账目核对等工作。另外,也可以用图表形式来反映查询结果。2.1.1 目标 (1)界面设计要求尽量友好、美观,应提供登录界面,并考虑用户权

4、限问题;(2)对各种信息应提供录入、修改、删除和查询功能;(3)具有对商品的基本信息和流动信息进行统计的功能;(4)具有数据备份与恢复、帮助等功能;(5)能够新增、修改和删除用户信息;2.1.2 运行环境 Windows 98/2000/XP/2003操作系统下,安装并配置软件Microsoft SQL Server 2000数据库管理系统。 2.2 数据需求 2.2.1 数据流条目 根据我们的进行的调查和分析,系统中各种功能所需的数据项和数据结构如下:商品信息:商品编号,商品名,商品单价;职工信息:职工号,职工姓名,性别,电话,住址;供货商信息:供应商姓名,地址,电话,单位等;入库信息:入库

5、编号,商品编号,商品名称,单价,数量,总价,供应商;出库信息:出库编号,商品编号,商品名称,单价,数量,总价,经手人;2.2.2 数据库描述 使用SQL SERVER2000作为后台数据库,就可以行使基于网络连接的用户认证。从而给不同的子系统分配不同的数据库使用角色,让他们彼此之间使用的数据库隔离开来,以达到较高的安全性。2.3 功能需求根据对各大超市进行的调查和分析,仓库管理系统应该具有以下功能:仓库中的货物信息的录入、修改、删除和查询。仓库的信息的的录入、修改、删除、查询和统计。管理者的信息的录入、修改、删除和查询。供货商的信息的录入、修改、删除、查询和统计。货物流动信息的录入、修改、删除

6、和查询。2.3.1 功能划分 仓库管理系统主要实现以下四方面的功能:A. 登陆b. 注册c. 查询d. 修改2.3.2 功能描述 仓库管理包括登陆、注册、查询、修改四方面功能。登陆,分为普通管理员登陆和超级管理员登陆。查询,分为员工查询,仓库查询和物品查询。修改,主要实现添加,修改和删除。3 概要设计 对系统功能分析中的各项功能进行集中、分块,按照结构化程序设计的要求,得到如下图所示的系统功能模块图。员工查询仓库查询商品查询注册仓库管理系统登录普通管理员超级管理员查询修改添加修改删除4 逻辑设计根据数据库需求分析,本系统的数据库逻辑结构设计如下。商品信息设计入库单信息设计 出库单信息设计职工信

7、息设计仓库信息设计供货商信息表5 界面设计和代码5.1登陆界面设计 public partial class Fmlogin : Form public Fmlogin() InitializeComponent(); private void BUT_Y_Click(object sender, EventArgs e) string username = tbuser.Text; string password = tbpw.Text; string connstring = Data Source=.zhaojuan-PCSQLEXPRESS;AttachDbFilename=F:仓库管

8、理系统仓库管理系统WMS_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True; SqlConnection conn = new SqlConnection(connstring);/获取用户名和密码匹配的行的数量的sql语句 string sql = string.Format(select count(*) from usertable where username=0and password=1, username, password); try if (comboBox1.Text = 超级管理员&

9、tbuser.Text=admin) conn.Open(); SqlCommand comm = new SqlCommand(sql, conn); int num = (int)comm.ExecuteScalar(); if (num 0) this.Hide(); Fmmenu f1 = new Fmmenu(); f1.ShowDialog(); else MessageBox.Show(用户名或密码或身份错误,请重新输入!,登录失败, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); else if (comboBox1.Tex

10、t =普通管理员) conn.Open(); SqlCommand comm = new SqlCommand(sql, conn); int num = (int)comm.ExecuteScalar(); if (num 0) this.Hide(); Fmmenu f1 = new Fmmenu(); f1.删改信息ToolStripMenuItem.Enabled = false; f1.ShowDialog(); else MessageBox.Show(用户名或密码或身份错误,请重新输入!,登录失败, MessageBoxButtons.OK, MessageBoxIcon.Exc

11、lamation); else MessageBox.Show(用户名或密码或身份错误,请重新输入!,登录失败, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); catch (Exception eee) MessageBox.Show(eee.Message, 数据库操作错误!, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); finally conn.Close(); private void BUT_z_Click(object sender, EventArgs e) Fmreg

12、ister f2 = new Fmregister(); f2.ShowDialog(); 5.2注册界面与代码 private void button1_Click(object sender, EventArgs e) if (tbpw.Text = tB2_repw.Text) string connstring = Data Source=.zhaojuan-PCSQLEXPRESS;AttachDbFilename=F:仓库管理系统仓库管理系统WMS_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=Tr

13、ue; SqlConnection conn = new SqlConnection(connstring); ; try conn.Open();SqlCommand comm = new SqlCommand(register, conn); comm.CommandType = CommandType.StoredProcedure;comm.Parameters.AddWithValue(username, tbuser.Text.Trim();comm.Parameters.AddWithValue(password, tbpw.Text.Trim(); comm.Parameter

14、s.AddWithValue(workerID, tB_worker.Text.Trim(); int count = comm.ExecuteNonQuery();/执行命令,返回的行数 if (count 0) MessageBox.Show(注册成功!可以登录!, 成功, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(注册失败!,错误!,MessageBoxButtons.OK,MessageBoxIcon.Information); catch(Exception ) MessageBox

15、.Show(操作数据失败!可能用户名重复或您不是本公司职员!, 错误!, MessageBoxButtons.OK, MessageBoxIcon.Information); finally conn.Close(); else MessageBox.Show(注册失败!重复密码错误!, 错误!, MessageBoxButtons.OK, MessageBoxIcon.Information); private void but_return_Click(object sender, EventArgs e) this.Close();5.3修改密码private void but_Y_Cl

16、ick(object sender, EventArgs e) if (tBsure.Text = tBNpass.Text) string connstring = Data Source=zhaojuan-PCSQLEXPRESS;AttachDbFilename=D:仓库管理系统仓库管理系统WMS_DB.mdf;Integrated Security=True; SqlConnection conn = new SqlConnection(connstring); try conn.Open(); SqlCommand comm = new SqlCommand(updatepass,

17、conn);comm.CommandType=CommandType.StoredProcedure;comm.Parameters.AddWithValue(username, tBuser.Text);comm.Parameters.AddWithValue(password, tBpass.Text); comm.Parameters.AddWithValue(newpass, tBNpass.Text); int count = comm.ExecuteNonQuery(); if (count 0) MessageBox.Show(修改密码成功); tBuser.Text = ; t

18、Bpass.Text = ; tBNpass.Text = ;tBsure.Text = ; tBuser.Focus(); else MessageBox.Show(数据库操作失败, 修改密码失败, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); catch MessageBox.Show(操作数据失败!, 错误!, MessageBoxButtons.OK, MessageBoxIcon.Information); finally conn.Close(); else MessageBox.Show(确认密码与新密码不符, 修改密码失败

19、, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); tBuser.Text = ; tBpass.Text = ; tBNpass.Text = ; tBsure.Text = ; tBuser.Focus(); private void button1_Click(object sender, EventArgs e) this.Close();5.4系统主界面设计和代码 public partial class Fmmenu : Form public Fmmenu() InitializeComponent(); private vo

20、id 职员ToolStripMenuItem_Click(object sender, EventArgs e) putinto_w w = new putinto_w(); w.ShowDialog(); private void 查询所有ToolStripMenuItem_Click(object sender, EventArgs e) allinformation s = new allinformation(); s.ShowDialog(); private void 按仓库ToolStripMenuItem_Click(object sender, EventArgs e) BY

21、_WHID bw = new BY_WHID(); bw.ShowDialog(); private void 供货商ToolStripMenuItem_Click(object sender, EventArgs e) putinto_sup su = new putinto_sup(); su.ShowDialog(); private void 仓库信息ToolStripMenuItem_Click(object sender, EventArgs e) putinto_WH wh = new putinto_WH(); wh.ShowDialog(); private void 商品信

22、息ToolStripMenuItem_Click(object sender, EventArgs e) putin_G g = new putin_G();g.ShowDialog(); private void 入库ToolStripMenuItem_Click(object sender, EventArgs e) putin pi = new putin(); pi.ShowDialog(); private void 出库ToolStripMenuItem_Click(object sender, EventArgs e) putout po = new putout(); po.S

23、howDialog(); private void 删改信息ToolStripMenuItem_Click(object sender, EventArgs e) updataANDdelete ud = new updataANDdelete(); ud.ShowDialog(); private void 提醒ToolStripMenuItem_Click(object sender, EventArgs e) remind re = new remind(); re.ShowDialog(); private void 修改密码ToolStripMenuItem_Click(object

24、 sender, EventArgs e) updatapass up = new updatapass(); up.ShowDialog(); private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) About ab = new About(); ab.ShowDialog(); private void 按供货商ToolStripMenuItem_Click(object sender, EventArgs e) BY_SUP bs = new BY_SUP(); bs.ShowDialog(); 5.5查询信息

25、管理界面设计 public partial class allinformation : Form public allinformation() InitializeComponent(); private void allinformation_Load(object sender, EventArgs e) this.view_putoutTableAdapter.Fill(this.wMS_DBDataSet4.View_putout); this.view_putinTableAdapter.Fill(this.wMS_DBDataSet3.view_putin); this.sup

26、plierTableAdapter.Fill(this.wMS_DBDataSet2.Supplier); this.workerTableAdapter.Fill(this.wMS_DBDataSet1.Worker); this.gOODSTableAdapter.Fill(this.wMS_DBDataSet.GOODS);private void fillByToolStripButton_Click(object sender, EventArgs e) try this.gOODSTableAdapter.FillBy(this.wMS_DBDataSet.GOODS); catc

27、h (System.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); try this.workerTableAdapter.FillBy1(this.wMS_DBDataSet1.Worker); catch (System.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); try this.view_putoutTableAdapter.FillBy(this.wMS_DBDataSet4.View_putout); catch (Sy

28、stem.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); try this.supplierTableAdapter.FillBy(this.wMS_DBDataSet2.Supplier); catch (System.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); try this.view_putinTableAdapter.FillBy(this.wMS_DBDataSet3.view_putin); catch (System

29、.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); 5.6添加信息查询界面设计根据上图可知添加信息分为三类,人员信心,仓库信息,和商品信息,此外,人员信息分为职工类和供货商类,因添加界面和代码,格式大抵相同,所以只展示部分界面,进入添加设计如下:1.添加商品信息 public partial class putin_G : Form public putin_G() InitializeComponent(); private void but_Y_Click(object sender, EventArgs e)

30、string connstring = Data Source=.zhaojuan-PCSQLEXPRESS;AttachDbFilename=F:仓库管理系统仓库管理系统WMS_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True; SqlConnection conn = new SqlConnection(connstring); try conn.Open(); SqlCommand comm = new SqlCommand(insertgoods, conn); comm.CommandType

31、= CommandType.StoredProcedure; comm.Parameters.AddWithValue(goods_ID, tB1_G_ID.Text.Trim(); comm.Parameters.AddWithValue(goods_name, tB2_G_name.Text.Trim(); comm.Parameters.AddWithValue(goods_price, tB3_G_price.Text.Trim(); comm.Parameters.AddWithValue(minnum, tB5_G_minnum.Text.Trim(); int count = c

32、omm.ExecuteNonQuery();/执行命令,返回的行数 if (count 0) MessageBox.Show(添加成功!, 成功, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(添加失败!, 错误!, MessageBoxButtons.OK, MessageBoxIcon.Information); catch (Exception) MessageBox.Show(操作数据失败!可能商品已存在!, 错误!, MessageBoxButtons.OK, MessageBoxIco

33、n.Information); finally conn.Close(); private void button1_Click(object sender, EventArgs e) this.Close(); 2录入仓库信息public partial class putinto_WH : Form public putinto_WH() InitializeComponent(); private void but_Y_Click(object sender, EventArgs e)string connstring = Data Source=.zhaojuan-PCSQLEXPRE

34、SS;AttachDbFilename=F:仓库管理系统仓库管理系统WMS_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;SqlConnection conn = new SqlConnection(connstring); try conn.Open(); SqlCommand comm = new SqlCommand(insertWH, conn); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithVa

35、lue(WH_ID, tB1_WH_ID.Text.Trim(); comm.Parameters.AddWithValue(WHname, tB2_WHname.Text.Trim(); comm.Parameters.AddWithValue(workerID, tB3_workerID.Text.Trim(); comm.Parameters.AddWithValue(WHphone, tB4_WHphone.Text.Trim(); comm.Parameters.AddWithValue(address, tB5_address.Text.Trim(); int count = co

36、mm.ExecuteNonQuery();/执行命令,返回的行数 if (count 0) MessageBox.Show(添加成功!, 成功, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(添加失败!, 错误!, MessageBoxButtons.OK, MessageBoxIcon.Information); catch (Exception) MessageBox.Show(操作数据失败!可能仓库已存在!, 错误!, MessageBoxButtons.OK, MessageBoxIcon

37、.Information); finally conn.Close(); private void button1_Click(object sender, EventArgs e) this.Close(); 3录入职员信息(代码只展示不同部分 Try conn.Open(); SqlCommand comm = new SqlCommand(insertworker, conn); comm.CommandType=CommandType.StoredProcedure comm.Parameters.AddWithValue(workerID,tB1_ID.Text.Trim();com

38、m.Parameters.AddWithValue(workerName,tB2_name.Text.Trim();comm.Parameters.AddWithValue(Sex, tB3_sex.Text.Trim();comm.Parameters.AddWithValue(phone, tB4_phone.Text.Trim();comm.Parameters.AddWithValue(workerPost,tB5_POST.Text.Trim();int count = comm.ExecuteNonQuery();/执行命令,返回的行数5.7出入库信息表设计1出库表界面设计 public partial class putout : Form public putout() InitializeComponent(); private void button1_Click(object sender, EventArgs e) this.Close(); private void but_Y_Click(ob

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 学术论文 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服