仓库管理系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

仓库管理信息系统2目录一、功能模块图……………………………………………………3二、登陆……………………………………………………………3三、主界面…………………………………………………………5四、对仓库进行管理………………………………………………81、库存查询………………………………………………………82、货物入库………………………………………………………93、删除产品信息…………………………………………………114、修改产品信息…………………………………………………13五、用户管理………………………………………………………151、添加用户………………………………………………………152、查看用户………………………………………………………163、修改用户密码…………………………………………………18六、总结…………………………………………………………203一、功能模块图二、登陆实习代码如下:namespace仓库信息管理系统1{publicpartialclassLogin:Form{添加产品修改信息信息删除查看管理员对仓库进行管理管理人员信息管理添加管理员查询产品修改密码登陆4publicLogin(){InitializeComponent();}privatevoidbtLogin_Click(objectsender,EventArgse){stringusername=用户名.Text.Trim();//取出账号stringpw=密码.Text.Trim();//取出密码stringconstr=datasource=(local);+InitialCatalog=仓库管理信息系统;+IntegratedSecurity=SSPI;;//设置连接字符串SqlConnectionmycon=newSqlConnection(constr);//实例化连接对象SqlCommandmycom=mycon.CreateCommand();//创建SQL命令执行对象strings1=selectUserName,UserRightfromUserinfowhereUserName='+username+'andUserRight='+pw+';//编写SQL命令mycom.CommandText=s1;//执行SQL命令SqlDataAdaptermyDA=newSqlDataAdapter();//实例化数据适配器myDA.SelectCommand=mycom;//让适配器执行SELECT命令DataSetmyDS=newDataSet();//实例化结果数据集intn=myDA.Fill(myDS,Userinfo);//将结果放入数据适配器,返回元祖个数if(n!=0){MessageBox.Show(欢迎使用!);//登录成功Mainmain=newMain();this.Hide();main.Show();}else{MessageBox.Show(用户名或密码有错。请重新输入!);用户名.Text=;//清空账号密码.Text=;//清空密码?用户名.Focus();//光标括设置在账号上}}privatevoidbtExit_Click(objectsender,EventArgse){if(MessageBox.Show(您真的要退出本系统吗?,提示,MessageBoxButtons.OKCancel,MessageBoxIcon.Information)==DialogResult.OK){Application.Exit();}else{5this.btLogin.Enabled=true;this.Hide();Loginlogin=newLogin();login.Show();}}}}三、主界面实现代码如下:namespace仓库信息管理系统1{publicpartialclassMain:Form{privateintchildFormNumber=0;publicMain(){InitializeComponent();}privatevoidShowNewForm(objectsender,EventArgse){FormchildForm=newForm();6childForm.MdiParent=this;childForm.Text=窗口+childFormNumber++;childForm.Show();}privatevoidOpenFile(objectsender,EventArgse){OpenFileDialogopenFileDialog=newOpenFileDialog();openFileDialog.InitialDirectory=Environment.GetFolderPath(Environment.SpecialFolder.Personal);openFileDialog.Filter=文本文件(*.txt)|*.txt|所有文件(*.*)|*.*;if(openFileDialog.ShowDialog(this)==DialogResult.OK){stringFileName=openFileDialog.FileName;}}privatevoidSaveAsToolStripMenuItem_Click(objectsender,EventArgse){SaveFileDialogsaveFileDialog=newSaveFileDialog();saveFileDialog.InitialDirectory=Environment.GetFolderPath(Environment.SpecialFolder.Personal);saveFileDialog.Filter=文本文件(*.txt)|*.txt|所有文件(*.*)|*.*;if(saveFileDialog.ShowDialog(this)==DialogResult.OK){stringFileName=saveFileDialog.FileName;}}privatevoidExitToolsStripMenuItem_Click(objectsender,EventArgse){this.Close();}privatevoidCascadeToolStripMenuItem_Click(objectsender,EventArgse){LayoutMdi(MdiLayout.Cascade);}privatevoidTileVerticalToolStripMenuItem_Click(objectsender,EventArgse){LayoutMdi(MdiLayout.TileVertical);}privatevoidTileHorizontalToolStripMenuItem_Click(objectsender,EventArgse){LayoutMdi(MdiLayout.TileHorizontal);}privatevoidArrangeIconsToolStripMenuItem_Click(objectsender,EventArgse){7LayoutMdi(MdiLayout.ArrangeIcons);}privatevoidCloseAllToolStripMenuItem_Click(objectsender,EventArgse){foreach(FormchildForminMdiChildren){childForm.Close();}}privatevoid供货商设置ToolStripMenuItem_Click(objectsender,EventArgse){}privatevoid库存查询ToolStripMenuItem_Click(objectsender,EventArgse){库存查询btLook=new库存查询();btLook.ShowDialog();}privatevoid货物入库ToolStripMenuItem_Click(objectsender,EventArgse){修改产品信息RK=new修改产品信息();RK.ShowDialog();}privatevoid删除产品信息ToolStripMenuItem_Click(objectsender,EventArgse){删除SC=new删除();SC.ShowDialog();}privatevoid修改产品信息ToolStripMenuItem_Click(objectsender,EventArgse){修改csXG=new修改cs();XG.ShowDialog();}privatevoid添加用户ToolStripMenuItem_Click(objectsender,EventArgse){添加UTJU=new添加U();TJU.ShowDialog();}privatevoid查看用户ToolStripMenuItem_Click(objectsender,EventArgse){查看UCKU=new查看U();CKU.ShowDialog();}privatevoid修改用户密码ToolStripMenuItem_Click(objectsender,EventArgse)8{修改UXGU=new修改U();XGU.ShowDialog();}}}四、对仓库进行管理1、库存查询代码实现:privatevoidbtLook_Click(objectsender,EventArgse){if(txtLKWord.Text==){MessageBox.Show(请输入货物名称);}else{SqlConnectioncon=newSqlConnection(DataSource=(local);Database=仓库管理信息系统;IntegratedSecurity=SSPI;Uid=sa;Pwd=);SqlCommandcmd=newSqlCommand(SelectGoodsIDas货物编号,GoodsNameas货物名称,+StoreNameas仓库名称,GoodsSpecas货物规格,GoodsUnitas计量单位,+GoodsNumas货物数量,GoodsInPriceas进货价格,GoodsOutPriceas出货价格,+Editeras修改人,EditDateas修改日期+fromGoodsinfowhereGoodsID=@GOODSID,con);SqlDataAdapteradp=newSqlDataAdapter(cmd);cmd.Parameters.AddWithValue(@GOODSID,txtLKWord.Text);9DataSetds=newDataSet();con.Open();adp.Fill(ds,仓库管理信息系统);dataGridView1.DataSource=ds.Tables[0];//检查你的DataSet是否有数据/*MessageBox.Show(ds.Tables[0].Rows.Count.ToString());con.Close();*/}}2、货物入库代码实现:publicpartialclass货物入库:Form{public货物入库(){InitializeComponent();}privatevoidbutton1_Click(objectsender,EventArgse){if(textBox1.Text==){MessageBox.Show(货物编号不能为空);}else10{if(textBox2.Text==){MessageBox.Show(货物名称不能为空);}else{if(textBox3.Text==){MessageBox.Show(仓库名称不能为空);}else{if(textBox4.Text==){Messag

1 / 20
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功