NET开发仓库管理系统资料.doc_第1页
NET开发仓库管理系统资料.doc_第2页
NET开发仓库管理系统资料.doc_第3页
NET开发仓库管理系统资料.doc_第4页
NET开发仓库管理系统资料.doc_第5页
免费预览已结束,剩余16页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

PINGDINGSHAN UNIVERSITY.NET开发实训报告题 目: 仓库管理系统 专业年级: 计算机科学与技术 姓 名: * 学 号: * 2015年07月03日 1需求分析本仓库管理系统属于中小型仓库管理系统,可以有效的对中小型仓库货物进库,出库进行管理。本系统应达到以下目标:(1) 系统采用人机交互的方式,界面美观友好,信息查询灵活、方便,数据存储安全可靠。(2) 能够对仓库的使用情况进行有效的管理。(3) 能够对使用本系统的管理员进行权限设置,工作人员的详细信息进行有效的管理。(4) 能够准确、详细的记录货物的进库出库的详细情况。(5) 能够直观的显示历史货物使用情况的明细表,以及打印文件备份。(6) 能够对系统数据进行备份和恢复。(7) 对于用户输入的数据,进行严格的数据检验,尽可能地避免人为错误。系统应最大限度地实现易维护性和易操作性。2 系统设计2.1 系统目标 仓库信息模块:实现对仓库信息进行查询,增加,删除,修改,保存等功能。 职员信息模块:实现对职员信息进行查询,增加,删除,修改,保存等功能。 货物入库模块:实现对货物的入库,删除,入库详细信息的打印等功能。货物出库模块:实现对货物的出库,删除,入库详细信息的打印等功能。 货物信息查询模块:实现了根据选择特定的条件对当前的仓库进行相关的信息查询。 系统维护模块:实现对系统数据的备份和恢复,设置管理员的权限等功能。 系统设置模块:实现对管理员登陆系统的密码设置及对系统的锁定。 辅助功能模块:实现日历,记事本,计算器等功能.2.2 系统功能结构 仓库管理系统是由基础信息,库存管理,系统维护,系统设置,辅助功能这几个功能模块组成。(1)基础信息模块分为仓库信息和职工信息两个小模块,分别实现对仓库信息和职员信息进行查询,增加,删除,修改等功能。(2)仓库管理模块分为货物入库、货物出库和货物信息查询三个小模块,分别实现对用户进行增加,删除,权限设置及修改用户密码等功能。(3) 系统维护模块分为权限管理、数据备份、数据恢复三个小模块,分别实现了设置管理员权限,数据备份与恢复等功能。(4) 系统设置模块分为密码重置和锁定系统两个小模块,分别实现设置管理员的密码,对当前的系统加密等功能。(5) 辅助工具模块分为日历、记事本、计算器三个小模块,分别实现了对当前时间查看,事件记录,计算等功能。 图1 系统功能结构图3 系统实现(各自模块)3.1 员工信息模块设计与实现1 货物入库模块概述 在仓库管理的过程中,必然会进行货物入库的工作流程,对不同的货物进行分类管理,通过编号,放在不同的仓库都会提高在今后工作中的效率。在数据库中建立一个入库信息表,用于存储入库货物的信息。通过货物入库这个模块可以实现对仓库货物的增加,删除,以及本次入库详细信息的打印备份等功能。2 货物入库模块设计 货物入库实体的E-R图如图2所示:图2 货物入库实体E-R图表Table_IN用于存储货物入库的详细信息,该表的结构如表1所示:表1 货物入库表GoodsID 货物编号 GoodsName 货物名称 RKGoodsNum 数量 GoodsallPrice 单价WorkerName 收货员 GoodsBZ备注 datetime 进货时间 3 货物入库模块实现过程 private void GetData() SqlConnection conn = BaseClass.DBConn.CyCon(); SqlDataAdapter sda = new SqlDataAdapter(select GoodsID,GoodsName,RKGoodsNum,GoodsallPrice,WorkerName,GoodsBZ,datetime from Table_IN order by ID desc, conn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables0;通过SqlConnection对象连接数据库,创建一个SqlDataAdapters数据适配器对象获取员工信息,并用Fill方法将查询到的数据填充到DataSet中。最后将查询到的员工信息显示在dataGridView1控件中。private void frmRK_Load_1(object sender, EventArgs e) TreeNode newnode1 = treeView1.Nodes.Add(五金); TreeNode newnode2 = treeView1.Nodes.Add(服装); ./通过TreeNode newnode设置根节点 SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=1, conn); SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read() newnode1.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); ./在TreeView里显示同一根节点下的所有叶子节点 cmd = new SqlCommand(select * from Table_Worker, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() SHName.Items.Add(sdrWorkerName.ToString().Trim(); SHName.SelectedIndex = 0; sdr.Close(); GetData(); treeView1.ExpandAll(); 3.2 用户管理模块设计与实现1 货物出库管理模块概述 在仓库管理的过程中,必然会进行货物出库的工作流程,对不同的货物进行分类管理,通过编号,放在不同的仓库都会提高在今后工作中的效率。在数据库中建立一个出库信息表,用于存储出库货物的信息。通过货物入库这个模块可以实现对仓库货物的增加,删除,以及本次出库详细信息的打印备份等功能。2 货物出库管理模块设计 货物出库实体的E-R图如图3所示: 图3 货物出库实体E-R图 表Table_OUT用于存储货物出库的详细信息,该表的结构如表2所示: 表2 货物出库表表 在货物出库表中GoodsID 货物编号 GoodsName 货物名称 RKGoodsNum 数量 GoodsallPrice 单价WorkerName 收货员 GoodsBZ备注 datetime 进货时间3 货物出库管理模块实现过程 通过if语句对Text控件内的内容进行判断,确保GoodsName.Text,GoodsID.Text,GoodsJhPrice.Text内容不为空,然后判断货物的数量是否为空,如果为空的话,通过 MessageBox提示“请输入货物数量”消息。 SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(insert into Table_OUT(GoodsID,GoodsName,CKGoodsNum,GoodsallPrice,WorkerName,GoodsBZ,datetime) values( + GoodsID.Text.Trim() + , + GoodsName.Text.Trim() + ,+ RKGoodsNum.Text.Trim() + , + Convert.ToDecimal(textallPrice.Text.Trim() + , + SHName.SelectedItem.ToString() + , + BZ.Text.Trim() + , + DateTime.Now.ToString() + ), conn); cmd.ExecuteNonQuery(); conn.Close(); GetData(); 通过SqlConnection对象连接数据库,运用insert语句将进货的相关信息差遇到进货信息表中,最后将查询到的员工信息显示在dataGridView1控件中。 3.3打印模块设计与实现1 打印货物入库出库信息模块概述 为了方便管理人员对仓库中货物入库和出库的记录,防止因为某些不可避免的原因造成的数据的丢失,在货物入库和出库中设置了打印货物出库入库的详细情况表。 2 货物信息模块设计 货物信息表实体的E-R图如图4所示: 图4 货物信息表实体E-R图 表Table_RKInfo用于存储包房信息,该表的结构如表3所示: 表3 货物信息表 在货物信息表中GoodsID 货物编号 GoodsName 货物名称 RKGoodsNum 数量 GoodsallPrice 单价WorkerName 收货员 GoodsBZ备注 datetime 进货时间 3 打印功能模块实现过程 在printDocument的PrintPage事件中来实现将需要打印的文本属兔到PrintDocument中,通过for循环一次打印在dataGridView1中显示的每一行。 for (i = 0; i =6; i+) e.Graphics.DrawString(dataGridView1.Columnsi.Name.ToString() , new Font(宋体, 30, FontStyle.Regular), Brushes.Black, 60, 400+60*i); e.Graphics.DrawString(dataGridView1.SelectedCellsi.Value.ToString(), new Font(宋体, 30, FontStyle.Regular), Brushes.Black, 300, 400+60*i); /通过for循环一次打印在dataGridView1中显示的每一行 private void buttonPrint_Click(object sender, EventArgs e) printDialog1.ShowDialog(); printPreviewDialog1.Document = this.printDocument1; printPreviewDialog1.ShowDialog(); /执行打印窗体内的数据操作4 实训总结在本次实训的过程中,行确认好课题后开始认真地准备学习相关的知识,结合老师讲授的专业知识,灵活的应用到本次的实训课题中。完成实训课题的过程也是自我完善的过程,遇到过各种自己当时无法解决的问题,无法正常运行,出现没有处理过的错误。不过通过查阅书籍,与同学们相互交流后问题会越来越少,学到的知识越来越多,对c#这门课程不断的加深理解。另一方面就是学会自己主动的学习新的知识,不断的寻求创新点,在以后的学习中我会不断的加强自己的创新意识,主动学习的积极性,不断提高自己的专业素养。 附 录程序源码: public partial class frmRK : Form public frmRK() InitializeComponent(); private void GetData() SqlConnection conn = BaseClass.DBConn.CyCon(); SqlDataAdapter sda = new SqlDataAdapter(select GoodsID,GoodsName,RKGoodsNum,GoodsallPrice,WorkerName,GoodsBZ,datetime from Table_IN order by ID desc, conn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables0; private void frmRK_Load_1(object sender, EventArgs e) TreeNode newnode1 = treeView1.Nodes.Add(五金); TreeNode newnode2 = treeView1.Nodes.Add(服装); TreeNode newnode3 = treeView1.Nodes.Add(食品); TreeNode newnode4 = treeView1.Nodes.Add(办公用品); SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=1, conn); SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read() newnode1.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=2, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode2.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=3, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode3.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=4, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode4.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_Worker, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() SHName.Items.Add(sdrWorkerName.ToString().Trim(); SHName.SelectedIndex = 0; sdr.Close(); GetData(); treeView1.ExpandAll(); private void treeView1_DoubleClick(object sender, EventArgs e) string Goodsname = treeView1.SelectedNode.Text; if (Goodsname = 五金 | Goodsname = 服装 | Goodsname = 食品 | Goodsname = 办公用品) else SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_RKInfo where GoodsName= + Goodsname + , conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); GoodsID.Text = sdrGoodsID.ToString().Trim(); GoodsName.Text = Goodsname; GoodsJhPrice.Text = sdrGoodsJhPrice.ToString().Trim(); if (RKGoodsNum.Text = ) MessageBox.Show(数量不能为空); return; else textallPrice.Text= Convert.ToString(Convert.ToInt32(GoodsJhPrice.Text)* Convert.ToInt32(RKGoodsNum.Text); conn.Close(); private void RKGoodsNum_TextChanged(object sender, EventArgs e) if (RKGoodsNum.Text = ) MessageBox.Show(数量不能为空); return; else if (Convert.ToInt32(RKGoodsNum.Text) 0) string names = dataGridView1.SelectedCells0.Value.ToString(); SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(delete from Table_IN where GoodsID= + dataGridView1.SelectedCells0.Value.ToString() + , conn); cmd.ExecuteNonQuery(); conn.Close(); GetData(); private void buttonExit_Click_1(object sender, EventArgs e) this.Close(); private void buttonSave_Click(object sender, EventArgs e) if (GoodsName.Text = | GoodsID.Text = | GoodsJhPrice.Text = ) MessageBox.Show(请选择货物名称); return; else if (RKGoodsNum.Text = ) MessageBox.Show(数量不能为空); return; else if (Convert.ToInt32(RKGoodsNum.Text) = 0) MessageBox.Show(请输入消费数量); return; else SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(insert into Table_IN(GoodsID,GoodsName,RKGoodsNum,GoodsallPrice,WorkerName,GoodsBZ,datetime) values( + GoodsID.Text.Trim() + , + GoodsName.Text.Trim() + , + RKGoodsNum.Text.Trim() + , + Convert.ToDecimal(textallPrice.Text.Trim() + , + SHName.SelectedItem.ToString() + , + BZ.Text.Trim() + , +DateTime.Now.ToString() + ), conn); cmd.ExecuteNonQuery(); conn.Close(); GetData(); private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) int i; for (i = 0; i =6; i+) e.Graphics.DrawString(dataGridView1.Columnsi.Name.ToString() , new Font(宋体, 30, FontStyle.Regular), Brushes.Black, 60, 400+60*i); e.Graphics.DrawString(dataGridView1.SelectedCellsi.Value.ToString(), new Font(宋体, 30, FontStyle.Regular), Brushes.Black, 300, 400+60*i); private void buttonPrint_Click(object sender, EventArgs e) printDialog1.ShowDialog(); printPreviewDialog1.Document = this.printDocument1; printPreviewDialog1.ShowDialog(); public partial class frmCK : Form public frmCK() InitializeComponent(); private void GetData() SqlConnection conn = BaseClass.DBConn.CyCon(); SqlDataAdapter sda = new SqlDataAdapter(select GoodsID,GoodsName,CKGoodsNum,GoodsallPrice,WorkerName,GoodsBZ,datetime from Table_OUT order by ID desc, conn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables0; private void frmCK_Load(object sender, EventArgs e) TreeNode newnode1 = treeView1.Nodes.Add(五金); TreeNode newnode2 = treeView1.Nodes.Add(服装); TreeNode newnode3 = treeView1.Nodes.Add(食品); TreeNode newnode4 = treeView1.Nodes.Add(办公用品); SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=1, conn); SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read() newnode1.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=2, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode2.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=3, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode3.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_RKInfo where Goodsty=4, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() newnode4.Nodes.Add(sdr3.ToString().Trim(); sdr.Close(); cmd = new SqlCommand(select * from Table_Worker, conn); sdr = cmd.ExecuteReader(); while (sdr.Read() SHName.Items.Add(sdrWorkerName.ToString().Trim(); SHName.SelectedIndex = 0; sdr.Close(); GetData(); treeView1.ExpandAll(); private void buttonExit_Click(object sender, EventArgs e) this.Close(); private void treeView1_DoubleClick(object sender, EventArgs e) string Goodsname = treeView1.SelectedNode.Text; if (Goodsname = 五金 | Goodsname = 服装 | Goodsname = 食品 | Goodsname = 办公用品) else SqlConnection conn = BaseClass.DBConn.CyCon(); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_RKInfo where GoodsName= + Goodsname + , conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); GoodsID.Text = sdrGoodsID.ToString().Trim(); GoodsName.Text = Goodsname; GoodsJhPrice.Text = sdrGoodsJhPrice.ToString().Trim(); if (RKGoodsNum.Text = ) MessageBox.Show(数量不能为空); return; else textallPrice.Text = Convert.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论