仓库管理系统数据库课程设计 - 图文

更新时间:2023-12-14 08:28:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

目 录

1 课程设计的目的和意义 ........................... 2

2 需求分析 ....................................... 2

3数据库系统设计 .................................. 3

4.程序代码实现 .................. 错误!未定义书签。

5.系统用户界面设计 .............. 错误!未定义书签。

6 总结 .......................... 错误!未定义书签。

7.附录 .......................... 错误!未定义书签。

一、课程设计的目的和意义

仓库在现实生活中用途十分广泛,各种商城、超市要利用仓库存放物资,药房、医院等要利用仓库存放药品,企业、工厂等要利用仓库存放原材料、生产成品,因此仓库的管理成了一项十分重要的工作。

人工管理仓库既费时又费力,而且容易造成混乱,严重时会影响商城、企业的正常运作,造成恶劣的后果。随着信息技术的发展,办公自动化的普及,如何快速,高效,便捷的管理仓库受到了高度的关注。

本系统模拟仓库管理,系统主要针对于日常库存信息的管理,包括物资管理、仓库管理、入库操作、入库查询统计、出库操作、出库查询统计、库存查询统计等处理情况。用户可以通过相应的模块,对仓库里的物品的基本情况和库存数量进行查询,管理员通过简单的操作即可轻松的管理仓库,查询各项相关信息,并能进行入库和出库操作等。 通过仓库管理系统的设计与实现,使我们巩固和加深对数据库基础理论和基本知识的理解,进一步掌握了使用数据库进行软件设计的基本思想和方法,提高了运用数据库理论解决实际问题的能力,锻炼了实际动手能力、创新能力,培养了调查研究、查阅技术文献、资料、手册以及编写文档的能力。

二、需求分析

系统开发的总体任务是实现各种信息的系统化、规范化和自动化。系统功能分析是在系统开发的总体任务的基础上完成。本仓库管理系统需要完成功能主要有:

●用户登录。实现根据不同用户的权限进行登录,并转到相应权限的操作。 ●用户管理。实现管理人员添加、修改、删除用户;一般用户修改信息等功能。

●货物管理。实现管理人员对货物进库、退库的添加、修改、删除等功能。 ●入库与出库管理。实现管理人员对货物进行入库、出库操作,并可查询相应货物的出入库信息。

●监控管理。在货物管理中加入最高储备和最低储备字段,对仓库中的产品实现监控和报警。

三、数据库系统设计

1.数据库逻辑设计

用户 用户名 密码 用户权限 入库信息 入库编号 货物编号 单价 .... 货物信息 货物编号 货物名称 .... 权限 系统管理员 普通管理员 操作员

图4.1 数据库逻辑结构图

出库信息 出库编号 货物编号 数量 ....

2.数据流图

图4.2 管理员数据流图

图4.3 用户数据流图

3. 数据库表设计 3.1表汇总

表名 用户信息表(EmpInfo) 货物信息表(KcGoods) 销售商信息表(Company) 入库信息表(JhGoodsInfo) 出库信息表(SellGoods) 退货信息表(ThGoodsInfo) 类型 基本表 基本表 基本表 基本表 基本表 基本表 说明 集中保存系统中用户的帐号、密码等信息 集中存放货物的相关信息 存放销售商的角色)信息 集中存放入库货物的相关信息 集中存放出库货物的相关信息 集中存放退货的相关信息

3.2 详细表设计

用户表:[EmpInfo] 字段 EmpId EmpName EmpLoginName EmpSex EmpBrithday EmpDept EmpPost EmpPhone EmpPhoneM EmpAddress EmpRemark 类型 文本 文本 文本 文本 日期 文本 文本 文本 文本 文本 文本 长度 50 10 50 2 50 10 10 20 20 20 50 说明 员工编号 角色名称 密码 性别 出生日期 所属部门 职务 联系电话 传真 地址 备注 约束 主键 权限

货物表:[KcGoods] 字段 GoodsID KcGoodsName KcNum KcDeptName KcUnit KcTime KcRemark 类型 文本 文本 文本 文本 文本 文本 文本 长度 50 50 50 50 50 50 50 说明 货物编号 货物名称 货物数量 存放仓库 存放单位 存放时间 备注 约束 主键

销售商表:[Company] 字段 CompanyName CompanyDirect CompanyPhone CompanyFax CompanyAddress Remark

入库信息表:[JhGoodsInfo] 字段 GoodsID EmpID GoodsNum GoodsJhPrice DoodsNeedPrice DoodTime DepotName Remark 类型 文本 文本 文本 文本 文本 日期 文本 文本 长度 50 50 50 50 50 50 50 50 说明 入库编号 进货员工编号 入库数量 入库单价 入库总值 入库时间 存入的仓库 备注 约束 主键 类型 文本 文本 文本 文本 文本 文本 长度 50 10 10 10 50 50 说明 公司名称 公司负责人 公司电话 公司传真 公司地址 备注 约束 主键

出库信息表:[SellGoods] 字段 GoodsID EmpID SellGoodsNum Sellprice SellNeedPrice SellGoodsTime SellRemark 类型 文本 文本 文本 文本 文本 日期 文本 长度 50 50 50 50 50 50 50 说明 出库编号 货员工编号 出库数量 出库单价 出库总值 出库时间 备注 约束 主键

四、程序代码实现 1.系统全部类汇总

类名 frm.cs frmCompanyInfo.cs frmDataBack.cs frmDataReole.cs frmEmpInfo.cs frmFindGood.cs frmGonYingShang.cs frmGoodID.cs frmJhGoodsInfo.cs frmKcGoodFind.cs frmKcGoods.cs frmLogin.cs frmMain.cs frmSellGoodInfo.cs frmSellGoods.cs frmThGoodsInfo.cs Program.cs 说明 程序主模块 查询修改添加删除销售商信息 数据备份 数据还原 查询修改添加删除员工信息 查询货物信息 选择供应商信息 选择商品名称 进货信息 选择查询条件 查询库存信息及设置警报数量 用户登录 程序主界面 商品销售信息 修改添加删除商品销售信息 查询修改添加删除商品销售信息 应用程序的主入口点

2.相关类详细设计

2.1 添加入库信息的实现

添加入库信息设计:

进入主界面后,点击【进货管理】----【商品进货信息】即可打开添加入库界面。

下面给出完成添加功能的关键代码: public partial class frmJhGoodsInfo : Form {

public frmJhGoodsInfo() {

InitializeComponent(); }

public frmJhGoodsInfo(int intCdo) {

InitializeComponent(); }

tb_JhGoodsInfo jhGood=new tb_JhGoodsInfo();

tb_JhGoodsInfoMenthod jhMenthod=new tb_JhGoodsInfoMenthod(); public static int intFalg = 0; private void ControlStatus() {

this.toolSave.Enabled = !this.toolSave.Enabled; this.toolAdd.Enabled = !this.toolAdd.Enabled;

this.toolCancel.Enabled = !this.toolCancel.Enabled; this.toolAmend.Enabled = !this.toolAmend.Enabled; this.tollDelete.Enabled = !this.tollDelete.Enabled; }

2.2 库存查询类的实现

库存查询界面:

进入主界面后,选择【库存管理】---【库存查询】即可进入入库信息的查询界面。

本系统共提供两种查询方式,分别是商品编号查询、商品名称查询查询,选择任意一种查询方式并输入要查询的值,点击【查询】按钮,系统会根据输入的查询值以及选取的查询方式在数据库中进行检索,并将查询结果显示在界面下方的空白区域。

完成库存查询功能的核心代码: namespace CHEXC {

public partial class frmKcGoodFind : Form {

public frmKcGoodFind() {

InitializeComponent(); }

tb_KcGoodsMenthod tb_GoodMenthd = new tb_KcGoodsMenthod(); tb_KcGoods kcgood = new tb_KcGoods();

private void button1_Click(object sender, EventArgs e) {

if (comboBox1.Text == \ {

MessageBox.Show(\请选择查询条件!\ return; }

if (txtkey.Text == \ {

MessageBox.Show(\请输入查询信息\ return; }

switch (comboBox1.Text) {

case \商品编号\商品编号\ kcgood.strGoodsID = txtkey.Text;

tb_GoodMenthd.tb_ThGoodsFind(dataGridView1,1,kcgood); break;

case \商品名称\商品名称\

kcgood.strKcGoodsName = txtkey.Text; tb_GoodMenthd.tb_ThGoodsFind(dataGridView1, kcgood);

break; } }

private void frmKcGoodFind_Load(object sender, EventArgs e) {

2,

} } }

五、系统用户界面设计

1.界面总体设计

主界面:菜单栏、工作区、状态栏等。

功能界面:全部为主界面的子界面,并完成相互独立的功能。

2.系统界面及功能概述

2.1登陆界面:

功能简介:系统的登陆界面,输入正确的用户名和密码,单击【确定】,程序会根据输入的用户所属的角色,分配给其合适的权限,并进入相应的程序主界面;如果账号或密码错误则会弹出错误提示,要求用户重新输入。

2.2用户主界面:

2.4商品退货界面:

2.5商品销售信息界面:

2.6商品库存界面:

六、总结

计算机技术的快速发展大大的推进了现代人工作生活的变化,越来越多的行业开始应用计算机来增强管理,提高效益。

计算机软件作为计算机系统的两大组成部分之一,看起来更接近普通用户;在设计一个软件系统的时候需要考虑到的因素非常多,但是最重要的莫过于功能和界面,功能直接关系着软件系统是否能完成用户的需求,而界面则直接面对用户,人们总是更倾向于使用一个操作方便的软件系统。

在设计仓库管理系统的时候,便是从以上两个方面入手,首要实现功能性需求,再设计一个相对方便操作的用户界面。在这两个方面集成开发环境(IDE)的作用显得十分突出,Microsoft Visual Studio 2005是一套非常强大的开发套件,利用它可以快速的开发出界面友好,功能强大的软件系统。

此次完成的仓库管理系统可以完全适应中小型的仓库管理需求,它具有用户

管理、物资管理、出入库管理、库存管理等功能,可以方便快捷进行添加、删除、查询等操作,且系统运行比较稳定。

在完成毕业设计的过程中也遇到了许多问题,主要是因为自己对高级语言编程以及数据库方面的知识理解不够深刻,平时动手做的软件不多;但是在指导老师的悉心指导下,通过查阅资料基本上都能比较好的解决遇到的问题,最终比较顺利的完成了此次毕业设计。在这个过程中我也学到了很多东西,对C#,数据库都有了更深入的理解,可以较熟练地使用VS2005开发软件,也增强了分析问题、解决问题的能力,总的来说这次毕业设计使我受益颇多。

谢 辞

在论文完成之际,向我的老师王强老师表示深深的敬意!

本设计是在王强老师的悉心指导、谆谆教诲下完成的,在此感谢王老师在设计期间对我的指导,以及在我学习过程中,遇到困难时对我的帮助,使我学到了好多知识,学会了能够透彻的分析问题解决问题的能力。

同时,感谢在我大学期间给与我帮助的所有老师,培养了我热爱学习、勤学好问、创新探索的能力,让我学到了不少的知识,使我受益非浅,还培养了我解决问题和处理问题的能力,为我在今后的工作和生活中打下了基础。

附 录

附录一:商品进货信息代码 using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;

using System.Windows.Forms; using CHEXC.ClassInfo; using CHEXC.GoodMenhod;

using System.Data.SqlClient; namespace CHEXC {

public partial class frmJhGoodsInfo : Form {

public frmJhGoodsInfo() {

InitializeComponent(); }

public frmJhGoodsInfo(int intCdo) {

InitializeComponent(); }

tb_JhGoodsInfo jhGood=new tb_JhGoodsInfo();

tb_JhGoodsInfoMenthod jhMenthod=new tb_JhGoodsInfoMenthod(); public static int intFalg = 0; private void ControlStatus() {

this.toolSave.Enabled = !this.toolSave.Enabled; this.toolAdd.Enabled = !this.toolAdd.Enabled; this.toolCancel.Enabled = !this.toolCancel.Enabled; this.toolAmend.Enabled = !this.toolAmend.Enabled; this.tollDelete.Enabled = !this.tollDelete.Enabled; }

public void ClearContorl() {

txtGoodsNum.Text = \ txtGoodsRemark.Text = \ txtGoodsSellPrice.Text = \

txtJhCompName.Text = \ txtGoodsNoPrice.Text = \ txtGoodsNeedPrice.Text = \ txtGoodsName.Text = \ txtGoodsJhPrice.Text = \ txtGoodsID.Text = \ txtEmpId.Text = \ cmbDepotName.Text = \ }

public int getIntCount() {

int intReslut = 0; if (intFalg == 1) {

if (txtGoodsID.Text == \ {

MessageBox.Show(\商品编号不能为空!\ return intReslut; }

if (txtGoodsName.Text == \ {

MessageBox.Show(\商品名称不能为空!\ return intReslut; }

if (txtJhCompName.Text == \ {

MessageBox.Show(\供应商名称不能为空!\ return intReslut; }

if (txtEmpId.Text == \

{

MessageBox.Show(\进货人姓名不能为空!\ return intReslut; }

if (txtGoodsNum.Text == \ {

\提示\

MessageBox.Show(\数量不能为空!\ return intReslut; }

if (txtGoodsName.Text == \ {

MessageBox.Show(\进货单价不能为空!\ return intReslut; } }

if (intFalg == 2) {

if (txtGoodsID.Text == \ {

MessageBox.Show(\商品编号不能为空!,选择要修改记录 return intReslut; } }

if (intFalg == 3) {

if (txtGoodsID.Text == \ {

MessageBox.Show(\商品编号不能为空!,选择要删除记录\提示\

return intReslut; } }

jhGood.strGoodsID = txtGoodsID.Text; jhGood.strEmpId = txtEmpId.Text;

jhGood.strJhCompName = txtGoodsName.Text; jhGood.strDepotName = cmbDepotName.Text;

jhGood.strGoodsNum = Convert.ToInt32(txtGoodsNum.Text); jhGood.strGoodsName = txtGoodsName.Text; jhGood.strGoodsUnit = cmbGoodsUnit.Text; jhGood.deGoodsJhPrice = txtGoodsJhPrice.Text; jhGood.deGoodsNeedPrice = txtGoodsNeedPrice.Text; jhGood.deGoodsNoPrice = txtGoodsNoPrice.Text; jhGood.deGoodsSellPrice = txtGoodsSellPrice.Text; jhGood.strGoodsRemark = txtGoodsRemark.Text; jhGood.DaGoodTime = dateTimePicker1.Value; if (intFalg != 3) {

jhGood.Falg = 0; } else {

jhGood.Falg = 1; }

intReslut = 1; return intReslut; }

private void frmJhGoodsInfo_Load(object sender, EventArgs e)

{

jhMenthod.tb_JhGoodsInfoFind(\ }

private void FillControls() { try {

SqlDataReader

sqldr

jhMenthod.tb_JhGoodsInfoFind(this.dataGridView1[0, this.dataGridView1.CurrentCell.RowIndex].Value.ToString(),1);

sqldr.Read(); if (sqldr.HasRows) {

txtEmpId.Text=sqldr[1].ToString(); txtGoodsName.Text=sqldr[4].ToString(); cmbDepotName.Text = sqldr[3].ToString();

txtGoodsNum.Text=sqldr[5].ToString(); cmbGoodsUnit.Text=sqldr[6].ToString(); txtGoodsJhPrice.Text=sqldr[7].ToString(); txtGoodsNeedPrice.Text=sqldr[9].ToString(); txtGoodsNoPrice.Text=sqldr[10].ToString(); txtGoodsSellPrice.Text=sqldr[8].ToString(); txtGoodsRemark.Text=sqldr[11].ToString(); txtJhCompName.Text = sqldr[2].ToString();

=

txtGoodsID.Text = sqldr[0].ToString(); txtGoodsID.Enabled = false; } }

catch (Exception ee) {

MessageBox.Show(ee.ToString());

} }

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {

}

private void toolAdd_Click(object sender, EventArgs e) {

ControlStatus(); ClearContorl(); intFalg = 1;//添加标记

txtGoodsID.Text = jhMenthod.JhGoodsID(); txtGoodsID.Enabled = false; }

private void toolAmend_Click(object sender, EventArgs e) {

ControlStatus(); ClearContorl();

intFalg = 2;//添加标记 }

private void toolrefulsh_Click(object sender, EventArgs e) {

ControlStatus(); ClearContorl();

}

private void toolExit_Click(object sender, EventArgs e) {

this.Close(); }

private void toolCancel_Click(object sender, EventArgs e) {

ControlStatus(); ClearContorl();

}

private void toolSave_Click(object sender, EventArgs e) {

if (getIntCount() == 1) {

if (intFalg == 1) {

if (jhMenthod.tb_JhGoodsInfoMenthodAdd(jhGood)==2) {

MessageBox.Show(\添加成功\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); } else {

MessageBox.Show(\添加失败\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); }

}

if (intFalg == 2) {

if (jhMenthod.tb_JhGoodsInfoMenthodUpdate(jhGood)==1) {

MessageBox.Show(\修改成功\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); } else {

MessageBox.Show(\修改失败\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); }

}

if (intFalg == 3) {

if (jhMenthod.tb_JhGoodsInfoMenthodDelete(jhGood)==1) {

MessageBox.Show(\删除成功\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); } else {

MessageBox.Show(\删除失败\提示\ intFalg = 0;

jhMenthod.tb_JhGoodsInfoFind(\ ControlStatus(); ClearContorl(); }

}

} }

private

void

dataGridView1_CellClick(object

sender,

DataGridViewCellEventArgs e) {

if (intFalg == 2 || intFalg == 3) {

FillControls(); } }

private void txtGoodsJhPrice_TextChanged(object sender, EventArgs e) {

if (txtGoodsNum.Text != \ {

txtGoodsNeedPrice.Text

=

Convert.ToString(Convert.ToInt32(txtGoodsJhPrice.Text)*Convert.ToInt32(txtGoodsNum.Text)); }

}

private

void

txtGoodsSellPrice_KeyPress(object

sender,

KeyPressEventArgs e) {

if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar)&&e.KeyChar!='.') {

MessageBox.Show(\请输入数字\ e.Handled = true; } }

private void txtGoodsNum_KeyPress(object sender, KeyPressEventArgs e) {

if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar)) {

MessageBox.Show(\请输入数字\ e.Handled = true; } }

private void txtGoodsJhPrice_KeyPress(object sender, KeyPressEventArgs e) {

if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar) && e.KeyChar != '.') {

MessageBox.Show(\请输入数字\ e.Handled = true; }

}

private void txtGoodsNoPrice_KeyPress(object sender, KeyPressEventArgs e) {

if (e.KeyChar != 8 && !char.IsDigit(e.KeyChar) && e.KeyChar != '.') {

MessageBox.Show(\请输入数字\ e.Handled = true; } }

//供应商信息

private void button1_Click(object sender, EventArgs e) {

frmGonYingShang frmgong = new frmGonYingShang(); frmgong.Owner = this; frmgong.ShowDialog(); }

private void tollDelete_Click(object sender, EventArgs e) {

ControlStatus(); ClearContorl(); intFalg = 3;//添加标记 } }

}

附录二:库存查询代码 using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;

using System.Windows.Forms; using CHEXC.GoodMenhod; using CHEXC.ClassInfo;

namespace CHEXC {

public partial class frmKcGoodFind : Form {

public frmKcGoodFind() {

InitializeComponent(); }

tb_KcGoodsMenthod tb_GoodMenthd = new tb_KcGoodsMenthod(); tb_KcGoods kcgood = new tb_KcGoods();

private void button1_Click(object sender, EventArgs e) {

if (comboBox1.Text == \ {

MessageBox.Show(\请选择查询条件!\ return;

}

if (txtkey.Text == \ {

MessageBox.Show(\请输入查询信息\ return; }

switch (comboBox1.Text) {

case \商品编号\商品编号\ kcgood.strGoodsID = txtkey.Text;

tb_GoodMenthd.tb_ThGoodsFind(dataGridView1,1,kcgood); break;

case \商品名称\商品名称\

kcgood.strKcGoodsName = txtkey.Text;

tb_GoodMenthd.tb_ThGoodsFind(dataGridView1, kcgood);

break; } }

private void frmKcGoodFind_Load(object sender, EventArgs e) {

} } }

2,

本文来源:https://www.bwwdw.com/article/iu45.html

Top