仓库管理系统源代码
java仓库管理系统课程设计源代码
![java仓库管理系统课程设计源代码](https://img.taocdn.com/s3/m/ab19118adb38376baf1ffc4ffe4733687e21fc91.png)
一、项目背景介绍1.1 仓库管理系统的重要性仓库管理系统是一种对仓库内物品进行全面管理和监控的信息系统。
在现代物流管理中,仓库管理系统扮演着至关重要的角色,可以提高仓库的利用率、降低存货成本、提高物流效率,为企业节省大量人力和物力资源,是企业管理中不可或缺的一部分。
1.2 项目意义本课程设计拟设计并实现一套基于Java语言的仓库管理系统,旨在通过应用软件技术和信息管理技术,实现对进销存等多类业务流程的自动化管理,并在实际操作中验证其运行效果和实用性,为学生提供一种将所学知识应用于实践的机会。
二、系统功能需求2.1 基本功能1) 系统登入:要求用户输入用户名和密码进行登入验证;2) 信息录入:包括商品信息、入库信息、出库信息等的录入;3) 信息查询:可以根据商品编号、名称、类别等条件查询商品信息;4) 库存管理:可以实时查看库存状况,并进行库存的盘点与调剂;5) 报表输出:可以输出商品进销存报表,方便管理人员进行决策;6) 权限管理:不同用户具有不同的权限,管理员具有对系统进行设置的权限。
2.2 进一步功能1) 供应商管理:可以录入供应商信息,并进行供应商的评价和选择;2) 客户管理:可以录入客户信息,并对客户进行分类管理;3) 交易管理:支持交易的生成、记录和统计。
三、技术选型和开发环境3.1 技术选型本系统采用Java语言作为主要开发语言,使用MySQL作为数据库,前端采用Swing技术进行界面设计,后端采用JDBC进行数据传输和交互。
3.2 开发工具1) 开发环境:Eclipse2) 数据库工具:Navicat3) 版本管理工具:Git4) 项目管理工具:Maven四、系统设计4.1 系统架构设计本系统采用MVC(Model-View-Controller)架构,将业务逻辑、数据表示和用户界面分离,使得系统更加易于维护和升级。
4.2 数据库设计1) 商品表:包括商品编号、名称、类别、进价、售价、库存等字段;2) 入库表:包括入库单号、商品编号、数量、日期等字段;3) 出库表:包括出库单号、商品编号、数量、日期等字段;4) 用户表:包括用户名、密码、权限等字段。
仓库管理系统(VB+Access+源代码)
![仓库管理系统(VB+Access+源代码)](https://img.taocdn.com/s3/m/602ea0de312b3169a551a47f.png)
精心整理仓库管理系统项目的建立这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。
由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。
此文可作供初学者们学习交流。
作者联系方式:E-mail最终运行效果打开软件出现如下登录界面输入系统预设用户名及密码(1 1)单击“登录”或单击“新用户”添加新用户进入如下主界面:建立工程1、创建标准EXE2、按“打开”3、添加MDI窗体——打开4、编辑菜单在空白处右击——点击“菜单编辑器”在“标题”里输入“系统”,在“名称”里输入“Sys”(注意此处不能为汉字)点击“下一个”再点击“”“确定”退到MDI界面点击“系统”——“退出”如下,然后编写代码。
代码如下:PrivateSubExit_Click()EndEndSub数据库的建立VB6.0中可以创建Access数据库。
如下建立一个“用户表”的数据库,用来存放用户信息及一些出入库管理信息。
如下图单击“外接程序”再单击“可视化数据管理器”出现如图点击“文件”——“新建”——“MicrosoftAccess”——“Version2.0MDB”输入数据库名,“保存”出现如下图在数据窗口中右击——“新建表”,最终如下往数据表里添加数据在这里就不罗嗦了,请查阅相关书籍。
精心整理精心整理登录界面窗口的建立最终界面如下:1、Adodc1的添加过程为:单击“工程”——“部件”出现下图所示,选择“控件”下的“MicrosoftADODataControl6.0(OLEDB)”单击“确定”在工具栏中会出现“”图标,单击它并拖动到相应位置即可。
其它元件不在一一说明。
2、本窗体代码如下:PrivateSubCommand1_Click() ' “登录”、“确定”按钮IfCommand1.Caption=" 确定"AndCommand2.Caption=" 取消"Then ' 如果为“确定”则添加新用户IfText1.Text=""Then ' 提示用户输入用户名MsgBox" 请输入用户名!",," 登录信息提示:"ExitSubElse 'DimusenameAsString ' 检测用户名是否已经存在DimstrSAsStringusename=Trim(Text1.Text)strS="select*from 用户登录信息表where 用户名='"&usename&"'"mandType=adCmdTextAdodc1.RecordSource=strSAdodc1.RefreshMsgBox" 您输入的用户已存在 !",," 登录提示信息:"Text1.Text=""Text2.Text=""Text3.Text=""Text1.SetFocusExitSubEndIfEndIfIfText2.Text=""Then ' 提示用户密码不能为空MsgBox" 密码不能为空!",," 登录提示信息:"Text2.SetFocusExitSubEndIfIfText3.Text=""ThenMsgBox" 请再次输入密码!",," 登录提示信息:"Text3.SetFocusExitSubEndIfIfText2.Text<>Text3.TextThenMsgBox" 两次输入的密码不一致,请确认!",," 登录提示信息:"Text2.Text=""Text3.Text=""Text2.SetFocus精心整理精心整理ExitSubElseMsgBox(" 添加新用户成功,现在您可以登陆系统了!")Label3.Visible=FalseText3.Visible=FalseCommand1.Caption=" 登录"Command2.Caption=" 退出"EndIfElse ' “登录”按钮,用户登录DimstrSnoAsStringDimstrSelectAsStringstrSno=Trim(Text1.Text) ' 检测用户名是否存在strSelect="select 密码from 用户登录信息表where 用户名='"&strSno&"'"mandType=adCmdTextAdodc1.RecordSource=strSelectAdodc1.RefreshMsgBox" 用户名不存在,请重新输入!",," 登录提示信息:"Text1.Text=""Text2.Text=""Text1.SetFocusExitSubEndIfForm1.Hide'UnloadMeForm2.Show'MsgBox" 登陆成功!",," 登录提示信息:"ElseMsgBox" 密码不正确,请重新输入!",," 登录提示信息:"Text2.Text=""Text2.SetFocusEndIfEndIfEndSubPrivateSubCommand2_Click() ' “退出”或“取消”按钮IfCommand2.Caption=" 取消"ThenLabel3.Visible=FalseText3.Visible=FalseCommand1.Caption=" 登录"Command2.Caption=" 退出"Text1.Text=""Text2.Text=""Text1.SetFocusElseEnd'UnloadMeEndIfEndSub精心整理精心整理PrivateSubCommand3_Click() ' “新用户”按钮Label3.Visible=TrueText3.Visible=TrueText1.Text=""Text2.Text=""Text3.Text=""Command1.Caption=" 确定"Command2.Caption=" 取消"Text1.SetFocusEndSubPrivateSubCommand3_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)Label6.Visible=TrueEndSubPrivateSubCommand3_MouseUp(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)Label6.Visible=FalseEndSubPrivateSubForm_Load()Label3.Visible=FalseText3.Visible=FalseEndSubPrivateSubTimer1_Timer() ' 时间time1控件的time事件代码,用来' 显示向左移动的欢迎字幕IfLabel4.Left+Label4.Width>0Then ' 当标签右边位置大于0时,标签向左移Label4.MoveLabel4.Left-80Else ' 否则标签从头开始Label4.Left=Form1.ScaleWidthEndIfIfLabel5.Left+Label5.Width>0ThenLabel5.MoveLabel5.Left-80ElseLabel5.Left=Form1.ScaleWidthEndIfEndSub主界面窗体如下:代码:PrivateSubAddNew_Click() Frame1.Visible=TrueFrame2.Visible=FalseEndSubPrivateSubCHKPMCHX_Click()Frame2.Caption=" 出库信息"DimpmAsString精心整理精心整理DimnAsStringpm=InputBox(" 产品名"," 请输入",0)n="select*from 出库表where 品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubCHKXHCHX_Click()Frame2.Caption=" 出库信息"DimXHAsStringDimnAsStringXH=InputBox(" 产品型号"," 请输入",0)n="select*from 出库表where 型号='"&XH&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndSubPrivateSubCKCZ_Click()'Form2.HideForm6.ShowEndSubPrivateSubCKJSHR_Click()Frame2.Caption=" 出库信息"DimJSHRAsStringDimnAsStringJSHR=InputBox(" 经手人"," 请输入",0)n="select*from 出库表where 经手人='"&JSHR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubCKSHJ_Click()Frame2.Caption=" 出库信息"DimCHKRQAsStringDimnAsStringCHKRQ=InputBox(" 出库日期,格式为:月/日/年如:12/1/2011"," 请输入",0) n="select*from 出库表where 出库日期='"&CHKRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubCKZCX_Click()Frame2.Caption=" 出库信息" 精心整理精心整理DimZBAsStringZB="select*from 出库表"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid1EndSubPrivateSubCommand1_Click()IfText1.Text=""Then ' 提示用户输入用户名MsgBox" 请输入用户名!",," 登录信息提示:"ExitSubElse 'DimusenameAsString ' 检测用户名是否已经存在DimstrSAsStringusename=Trim(Text1.Text)strS="select*from 用户登录信息表where 用户名='"&usename&"'"mandType=adCmdTextAdodc1.RecordSource=strSAdodc1.RefreshMsgBox" 您输入的用户已存在!",," 登录提示信息:"Text1.Text=""Text2.Text=""Text3.Text=""Text1.SetFocusExitSubEndIfEndIfIfText2.Text=""Then ' 提示用户密码不能为空MsgBox" 密码不能为空!",," 登录提示信息:"Text2.SetFocusExitSubEndIfIfText3.Text=""ThenMsgBox" 请再次输入密码!",," 登录提示信息:"Text3.SetFocusExitSubEndIfIfText2.Text<>Text3.TextThenMsgBox" 两次输入的密码不一致,请确认!",," 登录提示信息:"Text2.Text=""Text3.Text=""Text2.SetFocusExitSubElseeDimXAsInteger 精心整理精心整理X=MsgBox(" 成功添加新用户,是否要重新登录!",vbYesNo+vbQuestion+vbDefaultButton1," 提示信息!") IfX=vbYesThenUnloadMeForm3.ShowEndIf'MsgBox(" 成功添加新用户!")'Label3.Visible=False'Text3.Visible=False'Command1.Caption=" 登录"'Command2.Caption=" 退出"EndIfFrame1.Visible=FalseFrame2.Visible=TrueText1.Text=""Text2.Text="'"Text3.Text=""'Form3.ShowEndSubPrivateSubCommand2_Click()Frame1.Visible=FalseFrame2.Visible=TrueEndSubPrivateSubCXDL_Click()Form3.Show'UnloadMeEndSubPrivateSubExit_Click()EndUnloadForm1UnloadForm2UnloadForm3UnloadForm4UnloadForm5UnloadForm6UnloadForm7UnloadForm8EndSubPrivateSubForm_Load()UnloadForm1Frame1.Visible=FalseCallInitGrid0Me.Height=MDIForm1.Height-1060 Me.Width=MDIForm1.Width-560Me.Top=MDIForm1.TopMe.Left=MDIForm1.LeftEndSub精心整理精心整理PrivateSubGHCZ_Click()'Form2.HideForm8.ShowEndSubPrivateSubGHPMCX_Click()Frame2.Caption=" 归还信息"DimpmAsStringDimnAsStringpm=InputBox(" 产品名"," 请输入",0)n="select*from 归还表where 品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubGHRCX_Click()Frame2.Caption=" 归还信息"DimJCRAsStringDimnAsStringJCR=InputBox(" 归还人"," 请输入",0)n="select*from 归还表where 归还人='"&JCR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubGHSJCX_Click()Frame2.Caption=" 归还信息"DimJCRQAsStringDimnAsStringJCRQ=InputBox(" 归还日期,格式为:月/日/年如:12/1/2011"," 请输入",0) n="select*from 归还表where 归还日期='"&JCRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubGHXHCX_Click()Frame2.Caption=" 归还信息"DimXHAsStringDimnAsStringXH=InputBox(" 产品型号"," 请输入",0) n="select*from 归还表where 型号='"&XH&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.Refresh精心整理精心整理CallInitGrid2EndSubPrivateSubGHZCX_Click()Frame2.Caption=" 归还信息"DimZBAsStringZB="select*from 归还表"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCCZ_Click()'Form2.HideForm7.ShowEndSubPrivateSubJCHPMCHX_Click()Frame2.Caption=" 借出信息"DimpmAsStringDimnAsStringpm=InputBox(" 产品名"," 请输入",0)n="select*from 借出表where 品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCHXHCHX_Click()Frame2.Caption=" 借出信息"DimXHAsStringDimnAsStringXH=InputBox(" 产品型号"," 请输入",0) n="select*from 借出表where 型号='"&XH&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCRCX_Click()Frame2.Caption=" 借出信息"DimJCRAsStringDimnAsStringJCR=InputBox(" 借出人"," 请输入",0) n="select*from 借出表where 借出人='"&JCR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.Refresh精心整理精心整理CallInitGrid2EndSubPrivateSubJCSHJCX_Click()Frame2.Caption=" 借出信息"DimJCRQAsStringDimnAsStringJCRQ=InputBox(" 借出日期,格式为:月/日/年如:12/1/2011"," 请输入",0) n="select*from 借出表where 借出日期='"&JCRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCZCX_Click()Frame2.Caption=" 借出信息"DimZBAsStringZB="select*from 借出表"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid2EndSubPrivateSubJSHRCHX_Click()Frame2.Caption=" 归还信息"DimJSHRAsStringDimnAsStringJSHR=InputBox(" 经手人"," 请输入",0)n="select*from 归还表where 经手人='"&JSHR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJSHRCX_Click()Frame2.Caption=" 借出信息"DimJSHRAsStringDimnAsStringJSHR=InputBox(" 经手人"," 请输入",0)n="select*from 借出表where 经手人='"&JSHR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubPMCX_Click()Frame2.Caption=" 库存信息" 精心整理精心整理DimpmAsStringDimnAsStringpm=InputBox(" 产品名"," 请输入",0)n="select*from 库存表where 品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid0EndSubPrivateSubRKCZ_Click()'Form2.HideForm5.ShowEndSubPrivateSubRKJSHR_Click()Frame2.Caption=" 入库信息"DimJSHRAsStringDimnAsStringJSHR=InputBox(" 经手人"," 请输入",0)n="select*from 入库表where 经手人='"&JSHR&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubRKPMCHX_Click()Frame2.Caption=" 入库信息"DimpmAsStringDimnAsStringpm=InputBox(" 产品名"," 请输入",0)IfLen(pm)>0Thenn="select*from 入库表where 品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndIfCallInitGrid1EndSubPrivateSubRKSHJ_Click()Frame2.Caption=" 入库信息"DimRKRQAsStringDimnAsStringRKRQ=InputBox(" 入库日期,格式为:月/日/年如:12/1/2011"," 请输入",0) n="select*from 入库表where 入库日期='"&RKRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.Refresh精心整理精心整理CallInitGrid1EndSubPrivateSubRKXHCHX_Click()Frame2.Caption=" 入库信息"DimXHAsStringDimnAsStringXH=InputBox(" 产品型号"," 请输入",0)IfLen(XH)>0Thenn="select*from 入库表where 型号='"&XH&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndIfCallInitGrid1EndSubPrivateSubRKZCX_Click()Frame2.Caption=" 入库信息"DimZBAsStringZB="select*from 入库表"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid1EndSubPrivateSubTimer1_Timer()IfLabel4.Left+Label4.Width>0Then ' 当标签右边位置大于0时,标签向左移Label4.MoveLabel4.Left-80Else ' 否则标签从头开始Label4.Left=Form2.ScaleWidthEndIfIfLabel5.Left+Label5.Width>0ThenLabel5.MoveLabel5.Left-80ElseLabel5.Left=Form2.ScaleWidthEndIfIfLabel6.Left+Label6.Width>0ThenLabel6.MoveLabel6.Left-80ElseLabel6.Left=Form2.ScaleWidthEndIfIfLabel7.Left+Label7.Width>0Then Label7.MoveLabel7.Left-80ElseLabel7.Left=Form2.ScaleWidthEndIfEndSub精心整理精心整理PrivateSubXGMM_Click()'Form2.HideForm4.ShowEndSubPrivateSubXHCX_Click()Frame2.Caption=" 库存信息"DimXHAsStringDimnAsStringXH=InputBox(" 产品型号"," 请输入",0) IfLen(XH)>0Then'AndVal(XH)<>0n="select*from 库存表where 型号='"&XH&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndIfCallInitGrid0EndSubPrivateSubZB_Click()Frame2.Caption=" 库存信息"DimZBAsString'DimNAsString'PM=InputBox(" 产品名"," 请输入",0) ZB="select*from 库存表"'where 品名='"&PM&"'"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid0EndSubPrivateSubInitGrid0()WithDataGrid1.Columns(0).Width=1600.Columns(1).Width=2200.Columns(2).Width=2200.Columns(3).Width=1000.Columns(4).Width=1000.Columns(5).Width=4000EndWithEndSubPrivateSubInitGrid1()WithDataGrid1.Columns(0).Width=800.Columns(1).Width=1600.Columns(2).Width=1600.Columns(3).Width=800.Columns(4).Width=800.Columns(5).Width=1000 精心整理精心整理.Columns(6).Width=800.Columns(7).Width=4000EndWithEndSubPrivateSubInitGrid2()WithDataGrid1'.Columns(0).Caption=" 学号"'.Columns(1).Caption=" 课程名"'.Columns(2).Caption=" 学分"'.Columns(3).Caption=" 成绩"' 设置DtgCond的列宽.Columns(0).Width=800.Columns(1).Width=1600.Columns(2).Width=1600.Columns(3).Width=800.Columns(4).Width=800.Columns(5).Width=800.Columns(6).Width=1000.Columns(7).Width=800.Columns(8).Width=4000EndWithEndSub用户重新登录界面代码:PrivateSubCommand1_Click()DimstrSnoAsStringDimstrSelectAsStringstrSno=Trim(Text1.Text) ' 检测用户名是否存在strSelect="select 密码from 用户登录信息表where 用户名='"&strSno&"'"mandType=adCmdTextAdodc1.RecordSource=strSelectAdodc1.RefreshMsgBox" 用户名不存在,请重新输入!",," 登录提示信息:"Text1.Text=""Text2.Text=""Text1.SetFocusExitSubEndIfUnloadMeForm2.Show'MsgBox" 登陆成功!",," 登录提示信息:"ElseMsgBox" 密码不正确,请重新输入!",," 登录提示信息:" 精心整理精心整理Text2.Text=""Text2.SetFocusEndIfEndSubPrivateSubCommand2_Click()UnloadMeForm2.ShowEndSub修改用户密码界面代码:PrivateSubCommand1_Click()IfTrim(Text1.Text)<>Form2.TextUserNameThenMsgBox" 用户名不正确,请确认!",," 信息提示!"Text1.Text=""Text1.SetFocusExitSubElseDimnameAsStringDimnamesAsStringname=Trim(Text1.Text)names="select*from 用户登录信息表where 用户名='"&name&"'" mandType=adCmdTextAdodc1.RecordSource=namesAdodc1.RefreshIfText2.Text=""ThenMsgBox" 请输入旧密码!",," 信息提示!"Text2.SetFocusExitSubEndIfMsgBox" 旧密码不正确,请确认!",," 信息提示!"Text2.Text=""Text2.SetFocusExitSubEndIfIfText3.Text=""ThenMsgBox" 请输入新密码!",," 信息提示!"Text3.SetFocusExitSubEndIfIfText4.Text=""ThenMsgBox" 请再次输入新密码!",," 信息提示!"Text4.SetFocusExitSub精心整理精心整理EndIfIfTrim(Text3.Text)<>Trim(Text4.Text)ThenMsgBox" 两次输入的新密码不一致!",," 信息提示!"Text3.Text=""Text4.Text=""Text3.SetFocusExitSubElseMsgBox(" 密码修改成功!")UnloadMe'Form2.ShowEndIfEndIfEndSubPrivateSubCommand2_Click()UnloadMe'Form2.ShowEndSub入库管理代码:PrivateSubCommand1_Click()IfText1.Text=""AndText2.Text=""ThenMsgBox" “品名”和“型号”不能同时为空,必须输入其中一项 !",," 提示信息!" ExitSubText1.SetFocusElseIfText3.Text=""AndText4.Text=""ThenMsgBox" 请输入产品“数量”或“单位”之一 !",," 提示信息!"Text3.SetFocusExitSubEndIfIfText5.Text=""ThenMsgBox" 请经手人签名!",vbCritical," 提示信息!"Text5.SetFocusExitSubEndIfAdodc1.Refresh EndIf DimpmAsString DimpmsAsString DimnAsString DimmAsStringpm=Trim(Text1.Text) 精心整理精心整理n=Val(Text3.Text)pms="select*from 库存表where 品名='"&pm&"'"WithForm2EndWithElseEndIfEndIfDimXAsIntegerX=MsgBox(" 产品入库登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1," 提示信息!") IfX=vbNoThenUnloadMe'Form2.ShowElseText1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""Text5.Text=""Text6.Text=""Text7.Text=""Text1.SetFocusEndIfDimZBAsStringZB="select*from 入库表"'where 品名='"&PM&"'"EndSubPrivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""Text5.Text=""Text6.Text=""Text7.Text=""Text1.SetFocusEndSubPrivateSubCommand3_Click()UnloadMe'Form2.ShowEndSub出库管理代码:PrivateSubCommand1_Click()IfCombo1.Text=""AndCombo2.Text=""Then'text1.Text=""AndText2.Text=""Then 精心整理精心整理MsgBox" “品名”和“型号”不能同时为空,必须输入其中一项 !",," 提示信息!" ExitSubElseIfText1.Text=""AndCombo3.Text=""Then'Text4.Text=""ThenMsgBox" 请输入产品“数量”或“单位”之一 !",," 提示信息!"Text2.SetFocusExitSubEndIfIfText2.Text=""ThenMsgBox" 请经手人签名!",vbCritical," 提示信息!"Text2.SetFocusExitSubEndIfAdodc1.RefreshEndIfDimpmAsStringDimpmsAsStringDimnAsStringDimmAsStringpm=Trim(Combo1.Text)n=Val(Text1.Text)pms="select*from 库存表where 品名='"&pm&"'"EndIfDimXAsIntegerX=MsgBox(" 产品出库登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1," 提示信息!") IfX=vbNoThenUnloadMe'Form2.ShowEndIfCombo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""DimZBAsStringZB="select*from 出库表"'where 品名='"&PM&"'" EndSubPrivateSubCommand2_Click()Combo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""精心整理精心整理Text4.Text=""EndSubPrivateSubCommand3_Click()UnloadMe'Form2.ShowEndSubPrivateSubForm_Load()Adodc2.RefreshLoopEndSub借出管理代码:PrivateSubCommand1_Click()IfCombo1.Text=""AndCombo2.Text=""Then'text1.Text=""AndText2.Text=""Then MsgBox" “品名”和“型号”不能同时为空,必须输入其中一项 !",," 提示信息!" ExitSubElseIfText1.Text=""AndCombo3.Text=""Then'Text4.Text=""ThenMsgBox" 请输入产品“数量”或“单位”之一 !",," 提示信息!"Text1.SetFocusExitSubEndIfIfText2.Text=""ThenMsgBox" 请经手人签名!",vbCritical," 提示信息!"Text2.SetFocusExitSubEndIfAdodc1.RefreshEndIfDimpmAsStringDimpmsAsStringDimnAsStringDimmAsStringpm=Trim(Combo1.Text)n=Val(Text1.Text)pms="select*from 库存表where 品名='"&pm&"'"EndIfDimXAsIntegerX=MsgBox(" 产品借出登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1," 提示信息!") IfX=vbNoThenUnloadMeForm2.ShowEndIf精心整理精心整理Combo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""DimZBAsStringZB="select*from 借出表"'where 品名='"&PM&"'"EndSubPrivateSubCommand2_Click()Combo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""EndSubPrivateSubCommand3_Click()UnloadMeForm2.ShowEndSubPrivateSubForm_Load()Adodc2.RefreshLoopEndSub归还管理代码:PrivateSubCommand1_Click()IfCombo1.Text=""AndCombo2.Text=""Then'text1.Text=""AndText2.Text=""Then MsgBox" “品名”和“型号”不能同时为空,必须输入其中一项 !",," 提示信息!" ExitSubElseIfText1.Text=""AndCombo3.Text=""Then'Text4.Text=""ThenMsgBox" 请输入产品“数量”或“单位”之一 !",," 提示信息!"Text1.SetFocusExitSubEndIfIfText2.Text=""ThenMsgBox" 请经手人签名!",vbCritical," 提示信息!"Text2.SetFocusExitSub精心整理精心整理EndIfIfText3.Text=""ThenMsgBox" 请输入归还人姓名!",vbCritical," 提示信息!"Text3.SetFocusExitSubEndIfAdodc1.RefreshEndIfDimpmAsStringDimpmsAsStringDimnAsStringDimmAsStringpm=Trim(Combo1.Text)n=Val(Text1.Text)pms="select*from 库存表where 品名='"&pm&"'"EndIfDimXAsIntegerX=MsgBox(" 产品归还登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1," 提示信息!") IfX=vbNoThenUnloadMeForm2.ShowEndIfCombo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""DimZBAsStringZB="select*from 归还表"'where 品名='"&PM&"'"EndSubPrivateSubCommand2_Click()Combo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""EndSub PrivateSubCommand3_Click() UnloadMeForm2.ShowEndSubPrivateSubForm_Load()精心整理精心整理'DimiAsString'i=0'Adodc2.Refresh'i=i+1'LoopCallpmEndSubPrivateSubpm() DimiAsVariant DimjAsVariant DimkAsVariant DimaAsVariant DimbAsVariant DimcAsVariant DimsAsVariant DimDAsVarianti=0j=0Adodc2.Refreshi=i+1LoopD=Split(a,",")Ifj<iThens=D(2)Combo1.AddItems'k=0'Ifk<jAndD(k)<>D(j)Then'IfD(k)<>D(j)Then'C ombo1.AddItemD(j)'k=k+1'Else'k=k+1'EndIf'EndIfj=j+1EndIfText5.Text=s'a+","+D(2)+D(1)'+""+Val(i)+""+Val(j)+""+Val(k) Text6.Text=j'Combo1.AddItemD(1)EndSub精心整理。
仓库管理系统代码大全
![仓库管理系统代码大全](https://img.taocdn.com/s3/m/893134ff6c175f0e7dd137af.png)
系统主函数(program.cs)using System;using System.Collections.Generic;using System.Windows.Forms;namespace warehouse{static class Program{/// <summary>/// 应用程序的主入口点。
/// </summary>[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new frmLogin());//运行一个登陆对象}}}集的常规信息using System.Reflection;using pilerServices;using System.Runtime.InteropServices;// 有关程序集的常规信息通过下列属性集// 控制。
更改这些属性值可修改// 与程序集关联的信息。
[assembly: AssemblyTitle("warehouse")][assembly: AssemblyDescription("")][assembly: AssemblyConfiguration("")][assembly: AssemblyCompany("")][assembly: AssemblyProduct("warehouse")][assembly: AssemblyCopyright("版权所有2009")][assembly: AssemblyTrademark("")][assembly: AssemblyCulture("")]// 将ComVisible 设置为false 使此程序集中的类型// 对COM 组件不可见。
VB仓库管理系统源代码
![VB仓库管理系统源代码](https://img.taocdn.com/s3/m/7f034ea76c85ec3a87c2c5d8.png)
.1.请购作业程序Private Sub ComCX_Click()'查询'在编号文本框中输入编号,连接数据库,查询编号,并将编号?品名?规格?单位?单价的数据分别导入到相应文本框。
Set CN = New ADODB.ConnectionSet Rs = New ADODB.RecordsetCN.Open Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb;Persist Security Info=False'打开数据库Rs.CursorType = adOpenStatic '制定一个静态游标Rs.LockType = adLockOptimistic '设置锁定模式为开放式Rs.Open select * from JLBH where FtextBHSJ Like' & % & Trim(textBHSJ.Text)& % & ', CNDoEventsDo Until Rs.EOF = TrueIf Rs.EOF = False ThenlistBHSJ1.AddItem (Rs.Fields(0))listPMSJ1.AddItem (Rs.Fields(1))listGGSJ1.AddItem (Rs.Fields(2))listDWSJ1.AddItem (Rs.Fields(3))listDJSJ1.AddItem (Rs.Fields(4))专业资料Word.Rs.MoveNextEnd IfLoopEnd SubPrivate Sub comFHZY_Click()'返回上页frmQGZY.HidefrmCKGLXT.ShowEnd SubPrivate Sub comQD_Click()'录入数据If textBHSJ.Text = \ Or textPMSJ.Text = \ Or textGGSJ.Text = \ Or textDWSJ.Text = \ Or textDJSJ.Text = \ Or textQGSLSJ.Text = \ Then獍?硯尠请将数据补充完整!textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \textQGSLSJ.Text = \Else专业资料Word.Dim cnn As New Connection, rst As New Recordset, fid As FieldDim strSql As String, strconn As StringstrSql = Select textBHSJ From qgzy where textBHSJ= ' & Trim(textBHSJ.Text) & 'strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source='strconn = strconn & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb'cnn.ConnectionString = strconncnn.OpenSet rst = cnn.Execute(strSql)str1=InsertIntoqgzy(textBHSJ,textPMSJ,textGGSJ,textDWSJ,textDJSJ,textQGSJ)str1 = str1 + Values(' & Trim(textBHSJ.Text) & ',' & Trim(textPMSJ.Text) & ',' & Trim(textGGSJ.Text) & ',' & Trim(textDWSJ.Text) & ',' & Trim(textDJSJ.Text) & ',' & Trim(textQGSLSJ.Text) & ')cnn.Execute str1listBHSJ1.AddItem (Trim(textBHSJ.Text))listPMSJ1.AddItem (Trim(textPMSJ.Text))listGGSJ1.AddItem (Trim(textGGSJ.Text))listDWSJ1.AddItem (Trim(textDWSJ.Text))listDJSJ1.AddItem (Trim(textDJSJ.Text))专业资料Word.listQGSLSJ1.AddItem (Trim(textQGSLSJ.Text))獍?硯尠数据输入成功!rst.Closecnn.CloseSet Rs = NothingSet CN = NothingtextBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \textQGSLSJ.Text = \End IfEnd SubPrivate Sub comsc_Click()'删除If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1 If listBHSJ1.Selected(i) Then专业资料Word.textBHSJ.Text = listBHSJ1.List(i)textPMSJ.Text = listPMSJ1.List(i)textGGSJ.Text = listGGSJ1.List(i)textDWSJ.Text = listDWSJ1.List(i)textDJSJ.Text = listDJSJ1.List(i)textQGSLSJ.Text = listQGSLSJ1.List(i) End IfNextEnd IfDim cnn As New Connection, rst As New Recordset, fid As FieldDim strSql As String, strconn As StringstrSql = Select FtextBHSJ From jlbh where FtextBHSJ=' & Trim(textBHSJ.Text) & 'strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source='strconn = strconn & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb'cnn.ConnectionString = strconncnn.OpenSet rst = cnn.Execute(strSql)If rst.EOF = False Thenstr1 = Delete from qgzy where FtextBHSJ=' & Trim(textBHSJ.Text) & 'cnn.Execute str1专业资料Word.textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1If listBHSJ1.Selected(i) ThenlistBHSJ1.RemoveItem (i)listPMSJ1.RemoveItem (i)listGGSJ1.RemoveItem (i)listDWSJ1.RemoveItem (i)listDJSJ1.RemoveItem (i)listQGSLSJ1.RemoveItem (i)End IfNextEnd If獍?硯尠数据已删除!Else专业资料Word.獍?硯尠无此数据!textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDJSJ.Text = \textQGSLSJ.Text = \End Ifrst.Closecnn.CloseSet Rs = NothingSet CN = NothingEnd Sub‘以下是listbox串连显示Private Sub listBHSJ1_Click()If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1 If listBHSJ1.Selected(i) ThenlistPMSJ1.Selected(i) = TrueEnd If专业资料Word.NextEnd IfPrivate Sub listDJSJ1_Click()If listDJSJ1.SelCount > 0 ThenFor i = listDJSJ1.ListCount - 1 To 0 Step -1If listDJSJ1.Selected(i) ThenlistQGSLSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd SubPrivate Sub listDWSJ1_Click()If listDWSJ1.SelCount > 0 ThenFor i = listDWSJ1.ListCount - 1 To 0 Step -1 If listDWSJ1.Selected(i) ThenlistDJSJ1.Selected(i) = TrueEnd IfNextEnd If专业资料Word.Private Sub listGGSJ1_Click()If listGGSJ1.SelCount > 0 ThenFor i = listGGSJ1.ListCount - 1 To 0 Step -1 If listGGSJ1.Selected(i) ThenlistDWSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd SubPrivate Sub listPMSJ1_Click()If listPMSJ1.SelCount > 0 ThenFor i = listPMSJ1.ListCount - 1 To 0 Step -1 If listPMSJ1.Selected(i) ThenlistGGSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd Sub专业资料Word.Private Sub listQGSLSJ1_Click()If listQGSLSJ1.SelCount > 0 ThenFor i = listQGSLSJ1.ListCount - 1 To 0 Step -1 If listQGSLSJ1.Selected(i) ThenlistBHSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd Sub2.增加料号程序Private Sub comFHZY_Click()'返回上页frmJLBH.HidefrmCKGLXT.ShowEnd SubPrivate Sub comSCBH_Click()'删除If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1If listBHSJ1.Selected(i) ThentextBHSJ.Text = listBHSJ1.List(i)textPMSJ.Text = listPMSJ1.List(i)专业资料Word.textGGSJ.Text = listGGSJ1.List(i)textDWSJ.Text = listDWSJ1.List(i)textDJSJ.Text = listDJSJ1.List(i)End IfNextEnd IfDim cnn As New Connection, rst As New Recordset, fid As FieldDim strSql As String, strconn As StringstrSql = Select FtextBHSJ From jlbh where FtextBHSJ=' & Trim(textBHSJ.Text) & 'strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source='strconn = strconn & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb'cnn.ConnectionString = strconncnn.OpenSet rst = cnn.Execute(strSql)If rst.EOF = False Thenstr1 = Delete * from jlbh where FtextBHSJ=' & Trim(textBHSJ.Text) & 'cnn.Execute str1textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \专业资料Word.textDWSJ.Text = \textDJSJ.Text = \If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1If listBHSJ1.Selected(i) ThenlistBHSJ1.RemoveItem (i)listPMSJ1.RemoveItem (i)listGGSJ1.RemoveItem (i)listDWSJ1.RemoveItem (i)listDJSJ1.RemoveItem (i)End IfNextEnd If獍?硯尠编号已删除!Else獍?硯尠无此编号!请确认后重新输入textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \专业资料Word.End Ifrst.Closecnn.CloseSet Rs = NothingSet CN = NothingEnd SubPrivate Sub comZJBH_Click()'新增料号If textBHSJ.Text = \ Or textPMSJ.Text = \ Or textGGSJ.Text = \ Or textDWSJ.Text = \ Or textDJSJ.Text = \ Then獍?硯尠请将数据补充完整!textBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \ElseDim cnn As New Connection, rst As New Recordset, fid As FieldDim strSql As String, strconn As StringstrSql = Select FtextBHSJ From jlbh where FtextBHSJ= ' & Trim(textBHSJ.Text) 专业资料Word.& 'strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source='strconn = strconn & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb'cnn.ConnectionString = strconncnn.OpenSet rst = cnn.Execute(strSql)If rst.EOF = False Then獍?硯尠该编号已存在,不能追加!Elsestr1 = Insert Into jlbh (FtextBHSJ,FtextPMSJ,FtextGGSJ,FtextDWSJ,FtextDJSJ) str1 = str1 + Values(' & Trim(textBHSJ.Text) & ',' & Trim(textPMSJ.Text) & ',' & Trim(textGGSJ.Text) & ',' & Trim(textDWSJ.Text) & ',' & Trim(textDJSJ.Text)cnn.Execute str1listBHSJ1.AddItem (Trim(textBHSJ.Text))listPMSJ1.AddItem (Trim(textPMSJ.Text))listGGSJ1.AddItem (Trim(textGGSJ.Text))listDWSJ1.AddItem (Trim(textDWSJ.Text))listDJSJ1.AddItem (Trim(textDJSJ.Text))獍?硯尠恭喜您,添加成功!专业资料Word.End Ifrst.Closecnn.CloseSet Rs = NothingSet CN = NothingtextBHSJ.Text = \textPMSJ.Text = \textGGSJ.Text = \textDWSJ.Text = \textDJSJ.Text = \End Sub‘以下是listbox循环选中程序Private Sub listBHSJ1_Click()If listBHSJ1.SelCount > 0 ThenFor i = listBHSJ1.ListCount - 1 To 0 Step -1 If listBHSJ1.Selected(i) ThenlistPMSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd Sub专业资料Word.Private Sub listDJSJ1_Click()If listDJSJ1.SelCount > 0 ThenFor i = listDJSJ1.ListCount - 1 To 0 Step -1If listDJSJ1.Selected(i) ThenlistBHSJ1.Selected(i) = TrueEnd IfNextEnd IfPrivate Sub listDWSJ1_Click()If listDWSJ1.SelCount > 0 ThenFor i = listDWSJ1.ListCount - 1 To 0 Step -1 If listDWSJ1.Selected(i) ThenlistDJSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd SubPrivate Sub listGGSJ1_Click()If listGGSJ1.SelCount > 0 Then专业资料Word.For i = listGGSJ1.ListCount - 1 To 0 Step -1If listGGSJ1.Selected(i) ThenlistDWSJ1.Selected(i) = TrueEnd IfNextEnd IfPrivate Sub listPMSJ1_Click()If listPMSJ1.SelCount > 0 ThenFor i = listPMSJ1.ListCount - 1 To 0 Step -1 If listPMSJ1.Selected(i) ThenlistGGSJ1.Selected(i) = TrueEnd IfNextEnd IfEnd Sub专业资料Word。
仓库管理系统(VB Access 源代码)
![仓库管理系统(VB Access 源代码)](https://img.taocdn.com/s3/m/164465ec5022aaea988f0f21.png)
仓库管理系统项目的建立这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。
由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。
此文可作供初学者们学习交流。
作者联系方式:E-mail luo.shiye@ QQ:1355044347最终运行效果打开软件出现如下登录界面主界面:1、创建标准EXE2、按“打开”3、添加MDI窗体——打开4、编辑菜单在空白处右击——点击“菜单编辑器”在“标题”里输入“系统”,在“名称”里输入“Sys”(注意此处不能为汉字)点击“下一个”再点击“”“确定”退到MDI界面点击“系统”——“退出”如下,然后编写代码。
代码如下:Private Sub Exit_Click()EndEnd Sub数据库的建立VB6.0中可以创建Access数据库。
如下建立一个“用户表”的数据库,用来存放用户信息及一些出入库管理信息。
如下图单击“外接程序”再单击“可视化数据管理器”出现如图点击“文件”——“新建”——“Microsoft Access”——“Version 2.0 MDB”输入数据库名,“保存”出现如下图在数据窗口中右击——“新建表”,最终如下往数据表里添加数据在这里就不罗嗦了,请查阅相关书籍。
登录界面窗口的建立最终界面如下:1、Adodc1的添加过程为:单击“工程”——“部件”出现下图所示,选择“控件”下的“Microsoft ADO Data Control 6.0 (OLEDB)”单击“确定”在工具栏中会出现“”图标,单击它并拖动到相应位置即可。
其它元件不在一一说明。
2、本窗体代码如下:Private Sub Command1_Click() '“登录”、“确定”按钮 If Command1.Caption = "确定" And Command2.Caption = "取消" Then '如果为“确定”则添加新用户 If Text1.Text = "" Then '提示用户输入用户名MsgBox "请输入用户名!", , "登录信息提示:"Exit SubElse 'Dim usename As String '检测用户名是否已经存在 Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from 用户登录信息表 where 用户名='" & usename & "'"mandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshIf Adodc1.Recordset.EOF = False ThenMsgBox "您输入的用户已存在!", , "登录提示信息:"Text1.Text = ""Text3.Text = ""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then '提示用户密码不能为空MsgBox "密码不能为空!", , "登录提示信息:"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请再次输入密码!", , "登录提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Text2.SetFocusExit SubElseAdodc1.Recordset.AddNew '添加新用户Adodc1.Recordset.Fields("用户名") = Trim(Text1.Text)Adodc1.Recordset.Fields("密码") = Trim(Text2.Text)Adodc1.Recordset.UpdateMsgBox ("添加新用户成功,现在您可以登陆系统了!")Label3.Visible = FalseText3.Visible = FalseCommand1.Caption = "登录"Command2.Caption = "退出"End IfElse '“登录”按钮,用户登录 Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text) '检测用户名是否存在strSelect = "select 密码 from 用户登录信息表 where 用户名 = '" & strSno & "'"mandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshIf Adodc1.Recordset.EOF = True ThenMsgBox "用户名不存在,请重新输入!", , "登录提示信息:"Text1.Text = ""Text1.SetFocusExit SubEnd IfIf Adodc1.Recordset.Fields("密码") = Trim(Text2.Text) Then '检测密码是否正确Form1.Hide'Unload MeForm2.Show'MsgBox "登陆成功!", , "登录提示信息:"ElseMsgBox "密码不正确,请重新输入!", , "登录提示信息:"Text2.Text = ""Text2.SetFocusEnd IfEnd IfEnd SubPrivate Sub Command2_Click() '“退出”或“取消”按钮 If Command2.Caption = "取消" ThenLabel3.Visible = FalseText3.Visible = FalseCommand1.Caption = "登录"Command2.Caption = "退出"Text1.Text = ""Text2.Text = ""Text1.SetFocusElseEnd 'Unload MeEnd IfEnd SubPrivate Sub Command3_Click() '“新用户”按钮Label3.Visible = TrueText3.Visible = TrueText1.Text = ""Text2.Text = ""Text3.Text = ""Command1.Caption = "确定"Command2.Caption = "取消"Text1.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = TrueEnd SubPrivate Sub Command3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = FalseEnd SubPrivate Sub Form_Load()Label3.Visible = FalseText3.Visible = FalseEnd SubPrivate Sub Timer1_Timer() '时间time1控件的time事件代码,用来'显示向左移动的欢迎字幕If Label4.Left + Label4.Width > 0 Then '当标签右边位置大于0时,标签向左移Label4.Move Label4.Left - 80Else '否则标签从头开始Label4.Left = Form1.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form1.ScaleWidthEnd IfEnd Sub主界面窗体如下:代码:Private Sub AddNew_Click()Frame1.Visible = TrueFrame2.Visible = FalseEnd SubPrivate Sub CHKPMCHX_Click()Frame2.Caption = "出库信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 出库表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CHKXHCHX_Click()Frame2.Caption = "出库信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 出库表 where 型号 = '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd SubPrivate Sub CKCZ_Click()'Form2.HideForm6.ShowEnd SubPrivate Sub CKJSHR_Click()Frame2.Caption = "出库信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 出库表 where 经手人 = '" & JSHR & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CKSHJ_Click()Frame2.Caption = "出库信息"Dim CHKRQ As StringDim n As StringCHKRQ = InputBox("出库日期,格式为:月/日/年如:12/1/2011", "请输入", 0)n = "select * from 出库表 where 出库日期 = '" & CHKRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CKZCX_Click()Frame2.Caption = "出库信息"Dim ZB As StringZB = "select * from 出库表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid1End SubPrivate Sub Command1_Click()If Text1.Text = "" Then '提示用户输入用户名MsgBox "请输入用户名!", , "登录信息提示:"Exit SubElse 'Dim usename As String '检测用户名是否已经存在 Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from 用户登录信息表 where 用户名='" & usename & "'"mandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshIf Adodc1.Recordset.EOF = False ThenMsgBox "您输入的用户已存在!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text3.Text = ""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then '提示用户密码不能为空 MsgBox "密码不能为空!", , "登录提示信息:"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请再次输入密码!", , "登录提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Text2.SetFocusExit SubElseAdodc1.Recordset.AddNew '添加新用户Adodc1.Recordset.Fields("用户名") = Trim(Text1.Text)Adodc1.Recordset.Fields("密码") = Trim(Text2.Text)Adodc1.Recordset.UpdateDim X As IntegerX = MsgBox("成功添加新用户,是否要重新登录!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbYes ThenUnload MeForm3.ShowEnd If'MsgBox ("成功添加新用户!")'Label3.Visible = False'Text3.Visible = False'Command1.Caption = "登录"'Command2.Caption = "退出"End IfFrame1.Visible = FalseFrame2.Visible = TrueText1.Text = ""Text2.Text = "'"Text3.Text = ""'Form3.ShowEnd SubPrivate Sub Command2_Click()Frame1.Visible = FalseFrame2.Visible = TrueEnd SubPrivate Sub CXDL_Click()Form3.Show'Unload MeEnd SubPrivate Sub Exit_Click()EndUnload Form1Unload Form3Unload Form4Unload Form5Unload Form6Unload Form7Unload Form8End SubPrivate Sub Form_Load()TextUserName = Trim(Form1.Text1.Text)Unload Form1Frame1.Visible = FalseCall InitGrid0Me.Height = MDIForm1.Height - 1060Me.Width = MDIForm1.Width - 560Me.Top = MDIForm1.TopMe.Left = MDIForm1.LeftEnd SubPrivate Sub GHCZ_Click()'Form2.HideForm8.ShowEnd SubPrivate Sub GHPMCX_Click()Frame2.Caption = "归还信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 归还表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHRCX_Click()Frame2.Caption = "归还信息"Dim JCR As StringDim n As StringJCR = InputBox("归还人", "请输入", 0)n = "select * from 归还表 where 归还人 = '" & JCR & "'" mandType = adCmdTextAdodc2.RecordSource = nCall InitGrid2End SubPrivate Sub GHSJCX_Click()Frame2.Caption = "归还信息"Dim JCRQ As StringDim n As StringJCRQ = InputBox("归还日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 归还表 where 归还日期 = '" & JCRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHXHCX_Click()Frame2.Caption = "归还信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 归还表 where 型号 = '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHZCX_Click()Frame2.Caption = "归还信息"Dim ZB As StringZB = "select * from 归还表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCCZ_Click()'Form2.HideForm7.ShowEnd SubPrivate Sub JCHPMCHX_Click()Frame2.Caption = "借出信息"Dim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 借出表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCHXHCHX_Click()Frame2.Caption = "借出信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 借出表 where 型号 = '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCRCX_Click()Frame2.Caption = "借出信息"Dim JCR As StringDim n As StringJCR = InputBox("借出人", "请输入", 0)n = "select * from 借出表 where 借出人 = '" & JCR & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCSHJCX_Click()Frame2.Caption = "借出信息"Dim JCRQ As StringDim n As StringJCRQ = InputBox("借出日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 借出表 where 借出日期 = '" & JCRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCZCX_Click()Frame2.Caption = "借出信息"ZB = "select * from 借出表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubPrivate Sub JSHRCHX_Click()Frame2.Caption = "归还信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 归还表 where 经手人 = '" & JSHR & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JSHRCX_Click()Frame2.Caption = "借出信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 借出表 where 经手人 = '" & JSHR & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub PMCX_Click()Frame2.Caption = "库存信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 库存表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid0End SubPrivate Sub RKCZ_Click()'Form2.HideForm5.ShowEnd SubPrivate Sub RKJSHR_Click()Frame2.Caption = "入库信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 入库表 where 经手人 = '" & JSHR & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub RKPMCHX_Click()Frame2.Caption = "入库信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)If Len(pm) > 0 Thenn = "select * from 入库表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid1End SubPrivate Sub RKSHJ_Click()Frame2.Caption = "入库信息"Dim RKRQ As StringDim n As StringRKRQ = InputBox("入库日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 入库表 where 入库日期 = '" & RKRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub RKXHCHX_Click()Frame2.Caption = "入库信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Thenn = "select * from 入库表 where 型号 = '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid1End SubPrivate Sub RKZCX_Click()Frame2.Caption = "入库信息"Dim ZB As StringZB = "select * from 入库表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid1End SubPrivate Sub Timer1_Timer()If Label4.Left + Label4.Width > 0 Then '当标签右边位置大于0时,标签向左移Label4.Move Label4.Left - 80Else '否则标签从头开始Label4.Left = Form2.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form2.ScaleWidthEnd IfIf Label6.Left + Label6.Width > 0 ThenLabel6.Move Label6.Left - 80ElseLabel6.Left = Form2.ScaleWidthEnd IfIf Label7.Left + Label7.Width > 0 ThenLabel7.Move Label7.Left - 80ElseLabel7.Left = Form2.ScaleWidthEnd IfEnd SubPrivate Sub XGMM_Click()'Form2.HideForm4.ShowEnd SubPrivate Sub XHCX_Click()Frame2.Caption = "库存信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Then 'And Val(XH) <> 0n = "select * from 库存表 where 型号 = '" & XH & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid0End SubPrivate Sub ZB_Click()Frame2.Caption = "库存信息"Dim ZB As String'Dim N As String'PM = InputBox("产品名", "请输入", 0)ZB = "select * from 库存表 " 'where 品名 = '" & PM & "'" mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid0End SubPrivate Sub InitGrid0()With DataGrid1.Columns(0).Width = 1600.Columns(1).Width = 2200.Columns(2).Width = 2200.Columns(3).Width = 1000.Columns(4).Width = 1000.Columns(5).Width = 4000End WithEnd SubPrivate Sub InitGrid1()With DataGrid1.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 1000.Columns(6).Width = 800.Columns(7).Width = 4000End WithEnd SubPrivate Sub InitGrid2()With DataGrid1'.Columns(0).Caption = "学号"' .Columns(1).Caption = "课程名"'.Columns(2).Caption = "学分"' .Columns(3).Caption = "成绩"'设置DtgCond的列宽.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 800.Columns(6).Width = 1000.Columns(7).Width = 800.Columns(8).Width = 4000End WithEnd Sub用户重新登录界面代码:Private Sub Command1_Click()Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text) '检测用户名是否存在 strSelect = "select 密码 from 用户登录信息表 where 用户名 = '" & strSno & "'"mandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshIf Adodc1.Recordset.EOF = True ThenMsgBox "用户名不存在,请重新输入!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text1.SetFocusExit SubEnd IfIf Adodc1.Recordset.Fields("密码") = Trim(Text2.Text) Then '检测密码是否正确 Unload MeForm2.Show'MsgBox "登陆成功!", , "登录提示信息:"ElseMsgBox "密码不正确,请重新输入!", , "登录提示信息:"Text2.Text = ""Text2.SetFocusEnd IfEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub修改用户密码界面代码:Private Sub Command1_Click()If Trim(Text1.Text) <> Form2.TextUserName ThenMsgBox "用户名不正确,请确认!", , "信息提示!"Text1.Text = ""Text1.SetFocusExit SubElseDim name As StringDim names As Stringname = Trim(Text1.Text)names = "select * from 用户登录信息表 where 用户名='" & name & "'" mandType = adCmdTextAdodc1.RecordSource = namesAdodc1.RefreshIf Text2.Text = "" ThenMsgBox "请输入旧密码!", , "信息提示!"Text2.SetFocusExit SubEnd IfIf Adodc1.Recordset.Fields("密码") <> Trim(Text2.Text) ThenMsgBox "旧密码不正确,请确认!", , "信息提示!"Text2.Text = ""Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入新密码!", , "信息提示!"Text3.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "请再次输入新密码!", , "信息提示!"Text4.SetFocusExit SubEnd IfIf Trim(Text3.Text) <> Trim(Text4.Text) ThenMsgBox "两次输入的新密码不一致!", , "信息提示!"Text3.Text = ""Text4.Text = ""Text3.SetFocusExit SubElseAdodc1.Recordset.Fields("密码") = Trim(Text3.Text)Adodc1.Recordset.UpdateMsgBox ("密码修改成功!")Unload Me'Form2.ShowEnd IfEnd IfEnd SubPrivate Sub Command2_Click()Unload Me'Form2.ShowEnd Sub入库管理代码:Private Sub Command1_Click()If Text1.Text = "" And Text2.Text = "" ThenMsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubText1.SetFocusElseIf Text3.Text = "" And Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text3.SetFocusExit SubEnd IfIf Text5.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text5.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.AddNew '添加 Adodc1.Recordset.Fields("品名") = Trim(Text1.Text)Adodc1.Recordset.Fields("型号") = Trim(Text2.Text)Adodc1.Recordset.Fields("数量") = Trim(Text3.Text)Adodc1.Recordset.Fields("单位") = Trim(Text4.Text)Adodc1.Recordset.Fields("经手人") = Trim(Text5.Text)Adodc1.Recordset.Fields("入库日期") = DateAdodc1.Recordset.Fields("说明") = Trim(Text7.Text)Adodc1.Recordset.UpdateEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Text1.Text)n = Val(Text3.Text)pms = "select * from 库存表 where 品名='" & pm & "'"mandType = adCmdTextForm2.Adodc2.RecordSource = pmsForm2.Adodc2.RefreshIf Form2.Adodc2.Recordset.EOF ThenWith Form2.Adodc2.Recordset.AddNew.Adodc2.Recordset.Fields("品名") = Trim(Text1.Text).Adodc2.Recordset.Fields("型号") = Trim(Text2.Text).Adodc2.Recordset.Fields("数量") = Trim(Text3.Text).Adodc2.Recordset.Fields("单位") = Trim(Text4.Text).Adodc2.Recordset.Fields("说明") = Trim(Text7.Text).Adodc2.Recordset.UpdateEnd WithElsem = Form2.Adodc2.Recordset.Fields("数量").ValueIf Form2.Adodc2.Recordset.Fields("型号") = Trim(Text2.Text) ThenForm2.Adodc2.Recordset.Fields("数量") = Val(m) + Val(n)Form2.Adodc2.Recordset.UpdateEnd IfEnd IfDim X As IntegerX = MsgBox("产品入库登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload Me'Form2.ShowElseText1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""Text6.Text = ""Text7.Text = ""Text1.SetFocusEnd IfForm2.Frame2.Caption = "入库信息"Dim ZB As StringZB = "select * from 入库表 " 'where 品名 = '" & PM & "'"mandType = adCmdTextForm2.Adodc2.RecordSource = ZBForm2.Adodc2.RefreshEnd SubPrivate Sub Command2_Click()Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""Text6.Text = ""Text7.Text = ""Text1.SetFocusEnd SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd Sub出库管理代码:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" Then MsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text2.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.AddNew '添加Adodc1.Recordset.Fields("品名") = Trim(Combo1.Text) 'Trim(Text1.Text)Adodc1.Recordset.Fields("型号") = Trim(Combo2.Text) 'Trim(Text2.Text)Adodc1.Recordset.Fields("数量") = Trim(Text1.Text)Adodc1.Recordset.Fields("单位") = Trim(Combo3.Text) 'Trim(Text4.Text)Adodc1.Recordset.Fields("经手人") = Trim(Text2.Text)Adodc1.Recordset.Fields("出库日期") = DateAdodc1.Recordset.Fields("说明") = Trim(Text4.Text)Adodc1.Recordset.UpdateEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Combo1.Text)n = Val(Text1.Text)pms = "select * from 库存表 where 品名='" & pm & "'"mandType = adCmdTextForm2.Adodc2.RecordSource = pmsForm2.Adodc2.Refreshm = Form2.Adodc2.Recordset.Fields("数量").ValueIf Form2.Adodc2.Recordset.Fields("型号") = Trim(Combo2.Text) ThenForm2.Adodc2.Recordset.Fields("数量") = Val(m) - Val(n)Form2.Adodc2.Recordset.UpdateEnd IfDim X As IntegerX = MsgBox("产品出库登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload Me'Form2.ShowEnd IfCombo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Form2.Frame2.Caption = "出库信息"Dim ZB As StringZB = "select * from 出库表 " 'where 品名 = '" & PM & "'" mandType = adCmdTextForm2.Adodc2.RecordSource = ZBForm2.Adodc2.RefreshEnd SubPrivate Sub Command2_Click()Combo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd SubPrivate Sub Form_Load()Adodc2.RefreshAdodc2.Recordset.MoveFirstDo Until Adodc2.Recordset.EOFCombo2.AddItem Adodc2.Recordset.Fields("型号")Combo1.AddItem Adodc2.Recordset.Fields("品名")Combo3.AddItem Adodc2.Recordset.Fields("单位")Adodc2.Recordset.MoveNextLoopEnd Sub借出管理代码:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" Then MsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.AddNew '添加Adodc1.Recordset.Fields("品名") = Trim(Combo1.Text) 'Trim(Text1.Text)Adodc1.Recordset.Fields("型号") = Trim(Combo2.Text) 'Trim(Text2.Text)Adodc1.Recordset.Fields("数量") = Trim(Text1.Text)Adodc1.Recordset.Fields("单位") = Trim(Combo3.Text) 'Trim(Text4.Text)Adodc1.Recordset.Fields("经手人") = Trim(Text2.Text)Adodc1.Recordset.Fields("借出人") = Trim(Text3.Text)Adodc1.Recordset.Fields("借出日期") = DateAdodc1.Recordset.Fields("说明") = Trim(Text4.Text)Adodc1.Recordset.UpdateEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Combo1.Text)n = Val(Text1.Text)pms = "select * from 库存表 where 品名='" & pm & "'"mandType = adCmdTextForm2.Adodc2.RecordSource = pmsForm2.Adodc2.Refreshm = Form2.Adodc2.Recordset.Fields("数量").ValueIf Form2.Adodc2.Recordset.Fields("型号") = Trim(Combo2.Text) ThenForm2.Adodc2.Recordset.Fields("数量") = Val(m) - Val(n)Form2.Adodc2.Recordset.UpdateEnd IfDim X As IntegerX = MsgBox("产品借出登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload MeForm2.ShowEnd IfCombo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Form2.Frame2.Caption = "借出信息"Dim ZB As StringZB = "select * from 借出表 " 'where 品名 = '" & PM & "'"mandType = adCmdTextForm2.Adodc2.RecordSource = ZBForm2.Adodc2.RefreshEnd SubPrivate Sub Command2_Click()Combo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End SubPrivate Sub Command3_Click()Unload MeForm2.ShowEnd Sub。
仓库管理 python 源码
![仓库管理 python 源码](https://img.taocdn.com/s3/m/b15471c1690203d8ce2f0066f5335a8102d266ad.png)
仓库管理系统是一个用于管理存储在仓库中的物品的系统。
以下是一个简单的仓库管理系统的Python源代码示例。
python复制代码class Item:def__init__(self, name, quantity): = nameself.quantity = quantityclass Warehouse:def__init__(self):self.items = {}def add_item(self, item):if in self.items:self.items[].quantity += item.quantityelse:self.items[] = itemdef remove_item(self, name, quantity):if name in self.items:if self.items[name].quantity >= quantity:self.items[name].quantity -= quantityelse:print("Insufficient quantity")else:print("Item not found")def print_inventory(self):for item in self.items.values():print(f"{}: {item.quantity}")warehouse = Warehouse()warehouse.add_item(Item("Apple", 100))warehouse.add_item(Item("Banana", 50))warehouse.remove_item("Apple", 20)warehouse.print_inventory()这个简单的仓库管理系统包括两个类:Item和Warehouse。
仓库管理系统(VB+Access+源代码)
![仓库管理系统(VB+Access+源代码)](https://img.taocdn.com/s3/m/00b5004a31b765ce050814d2.png)
仓库管理系统项目的建立这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。
由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。
此文可作供初学者们学习交流。
作者联系方式:E-mail1、2、3、4、EndEndSubVB6.0信息。
如下图单击“外接程序”再单击“可视化数据管理器”出现如图点击“文件”——“新建”——“MicrosoftAccess”——“Version2.0MDB”输入数据库名,“保存”出现如下图在数据窗口中右击——“新建表”,最终如下往数据表里添加数据在这里就不罗嗦了,请查阅相关书籍。
登录界面窗口的建立最终界面如下:1、Adodc1的添加过程为:单击“工程”——“部件”出现下图所示,选择“控件”下的“MicrosoftADODataControl6.0(OLEDB)”单击“确定”在工具栏中会出现“”图标,单击它并拖动到相应位置即可。
其它元件不在一一说明。
2、本窗体代码如下:PrivateSubCommand1_Click()'“登录”、“确定”按钮IfCommand1.Caption="确定"AndCommand2.Caption="取消"Then'如果为“确定”则添加新用户IfText1.Text=""Then'提示用户输入用户名MsgBox"请输入用户名!",,"登录信息提示:"ExitSubElse'DimusenameAsString'检测用户名是否已经存在EndIfEndIfEndIfEndIfIfText2.Text<>Text3.TextThenMsgBox"两次输入的密码不一致,请确认!",,"登录提示信息:"Text2.Text=""Text3.Text=""Text2.SetFocusExitSubElse'添加新用户=Trim(Text1.Text)=Trim(Text2.Text)MsgBox("添加新用户成功,现在您可以登陆系统了!")Text3.Visible=FalseCommand1.Caption="登录"Command2.Caption="退出"EndIfElse'“登录”按钮,用户登录DimstrSnoAsStringDimstrSelectAsStringstrSno=Trim(Text1.Text)'检测用户名是否存在strSelect="select密码from用户登录信息表where用户名='"&strSno&"'" mandType=adCmdTextEndIfElseEndIfEndIfCommand1.Caption="登录"Command2.Caption="退出"Text1.Text=""Text2.Text=""Text1.SetFocusElseEnd'UnloadMeEndIfEndSubPrivateSubCommand3_Click()'“新用户”按钮Label3.Visible=TrueText1.Text=""Text2.Text=""Text3.Text=""Command1.Caption="确定"Command2.Caption="取消"Text1.SetFocusEndSubPrivateSubCommand3_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle) Label6.Visible=TrueEndSub'Else'EndIfElseEndIf如下:代码:PrivateSubAddNew_Click()Frame1.Visible=TrueFrame2.Visible=FalseEndSubPrivateSubCHKPMCHX_Click()Frame2.Caption="出库信息"DimpmAsStringDimnAsStringpm=InputBox("产品名","请输入",0)n="select*from出库表where品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubCHKXHCHX_Click()Frame2.Caption="出库信息" DimXHAsStringDimnAsStringXH=InputBox("产品型号","请输入",0)n="select*from出库表where型号='"&XH&"'"EndSubEndSubEndSubmandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubCKZCX_Click()Frame2.Caption="出库信息"DimZBAsStringZB="select*from出库表"mandType=adCmdTextAdodc2.RecordSource=ZBCallInitGrid1EndSubPrivateSubCommand1_Click()IfText1.Text=""Then'提示用户输入用户名MsgBox"请输入用户名!",,"登录信息提示:"ExitSubElse'DimusenameAsString'检测用户名是否已经存在DimstrSAsStringusename=Trim(Text1.Text)MsgBox"ExitSubEndIfEndIfMsgBox"ExitSubEndIfMsgBox"ExitSubEndIfMsgBox"Text2.Text=""Text3.Text=""Text2.SetFocusExitSubElse'添加新用户=Trim(Text1.Text)=Trim(Text2.Text)eDimXAsIntegerX=MsgBox("成功添加新用户,是否要重新登录!",vbYesNo+vbQuestion+vbDefaultButton1,"提示信息!")Form3.ShowEndIf'MsgBox("成功添加新用户!")'Label3.Visible=False'Text3.Visible=False'Command1.Caption="登录"'Command2.Caption="退出"EndIfFrame1.Visible=FalseEndSubEndSubEndSubEndEndSubPrivateSubForm_Load() TextUserName=UnloadForm1Frame1.Visible=False CallInitGrid0Me.Height=MDIForm1.Height-1060 Me.Width=MDIForm1.Width-560 Me.Top=MDIForm1.TopMe.Left=MDIForm1.LeftEndSubPrivateSubGHCZ_Click()EndSubPrivateSubGHPMCX_Click()Frame2.Caption="归还信息" DimpmAsStringDimnAsStringpm=InputBox("产品名","请输入",0)n="select*from归还表where品名='"&pm&"'" mandType=adCmdTextAdodc2.RecordSource=nEndSubEndSubEndSubPrivateSubGHXHCX_Click()Frame2.Caption="归还信息" DimXHAsStringDimnAsStringXH=InputBox("产品型号","请输入",0)n="select*from归还表where型号='"&XH&"'" mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubGHZCX_Click()Frame2.Caption="归还信息"DimZBAsStringZB="select*from归还表"mandType=adCmdTextAdodc2.RecordSource=ZBAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCCZ_Click()'Form2.HideEndSubEndSubEndSubFrame2.Caption="借出信息"DimJCRAsStringDimnAsStringJCR=InputBox("借出人","请输入",0)n="select*from借出表where借出人='"&JCR&"'" mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCSHJCX_Click()Frame2.Caption="借出信息"DimJCRQAsStringDimnAsStringJCRQ=InputBox("借出日期,格式为:月/日/年如:12/1/2011","请输入",0) n="select*from借出表where借出日期='"&JCRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubJCZCX_Click()EndSubEndSubmandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid2EndSubPrivateSubPMCX_Click()Frame2.Caption="库存信息"DimpmAsStringDimnAsStringpm=InputBox("产品名","请输入",0)n="select*from库存表where品名='"&pm&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid0EndSubPrivateSubRKCZ_Click()'Form2.HideForm5.ShowEndSubPrivateSubRKJSHR_Click()Frame2.Caption="入库信息"EndSubEndIfEndSubDimnAsStringRKRQ=InputBox("入库日期,格式为:月/日/年如:12/1/2011","请输入",0) n="select*from入库表where入库日期='"&RKRQ&"'"mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshCallInitGrid1EndSubPrivateSubRKXHCHX_Click()Frame2.Caption="入库信息"XH=InputBox("产品型号","请输入",0)IfLen(XH)>0Thenn="select*from入库表where型号='"&XH&"'" mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndIfCallInitGrid1EndSubPrivateSubRKZCX_Click()EndSubElse'EndIfElseEndIfElseEndIfLabel7.MoveLabel7.Left-80ElseLabel7.Left=Form2.ScaleWidthEndIfEndSubPrivateSubXGMM_Click()'Form2.HideForm4.ShowEndSubPrivateSubXHCX_Click()DimnAsStringXH=InputBox("产品型号","请输入",0)IfLen(XH)>0Then'AndVal(XH)<>0n="select*from库存表where型号='"&XH&"'" mandType=adCmdTextAdodc2.RecordSource=nAdodc2.RefreshEndIfCallInitGrid0EndSubEndSubEndWithEndSub.Columns(2).Width=1600.Columns(3).Width=800.Columns(4).Width=800.Columns(5).Width=1000.Columns(6).Width=800.Columns(7).Width=4000EndWithEndSubPrivateSubInitGrid2()WithDataGrid1'.Columns(1).Caption="课程名"'.Columns(2).Caption="学分"'.Columns(3).Caption="成绩"'设置DtgCond的列宽.Columns(0).Width=800.Columns(1).Width=1600.Columns(2).Width=1600.Columns(3).Width=800.Columns(4).Width=800.Columns(5).Width=800.Columns(6).Width=1000EndWithEndSub代码:MsgBox"ExitSubEndIfUnloadMeForm2.Show'MsgBox"登陆成功!",,"登录提示信息:"ElseMsgBox"密码不正确,请重新输入!",,"登录提示信息:" Text2.Text=""Text2.SetFocusEndIfEndSubPrivateSubCommand2_Click()修改用户密码界面代码:PrivateSubCommand1_Click()IfTrim(Text1.Text)<>Form2.TextUserNameThen MsgBox"用户名不正确,请确认!",,"信息提示!" Text1.Text=""ExitSubElseMsgBox"ExitSubEndIfMsgBox"ExitSubEndIfMsgBox"ExitSubEndIfIfText4.Text=""ThenMsgBox"请再次输入新密码!",,"信息提示!"Text4.SetFocusExitSubEndIfIfTrim(Text3.Text)<>Trim(Text4.Text)Then MsgBox"两次输入的新密码不一致!",,"信息提示!" Text3.Text=""Text4.Text=""=Trim(Text3.Text)MsgBox("密码修改成功!") UnloadMe'Form2.ShowEndIfEndIfEndSub PrivateSubCommand2_Click() UnloadMeEndSub代码:MsgBox"ExitSubElseMsgBox"ExitSubEndIfMsgBox"ExitSubEndIf'添加=Trim(Text1.Text)=Trim(Text2.Text)=Trim(Text3.Text)=Trim(Text4.Text)=Trim(Text5.Text)=Date=Trim(Text7.Text)EndIfDimpmAsString DimpmsAsStringpm=Trim(Text1.Text)n=Val(Text3.Text)pms="select*from库存表where品名='"&pm&"'" =adCmdText=pmsIfThenWithForm2=Trim(Text1.Text)=Trim(Text2.Text)=Trim(Text3.Text)EndWithElsem=EndIfEndIfX=MsgBox("UnloadMeElseEndIf="入库信息DimZBAsStringZB="select*from入库表"'where品名='"&PM&"'" =adCmdText=ZBEndSubPrivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""Text7.Text=""Text1.SetFocusEndSubPrivateSubCommand3_Click()UnloadMe'Form2.ShowEndSub出库管理代码:MsgBox"ExitSubElseMsgBox"ExitSubEndIfMsgBox"ExitSubEndIf'添加=Date=Trim(Text4.Text)EndIfDimpmAsStringDimpmsAsStringDimnAsStringDimmAsStringpm=Trim(Combo1.Text)n=Val(Text1.Text)pms="select*from库存表where品名='"&pm&"'" =adCmdTextm=If=Trim(Combo2.Text)Then=Val(m)-Val(n)EndIfDimXAsIntegerX=MsgBox("产品出库登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1,"提示信息!") IfX=vbNoThenUnloadMe'Form2.ShowEndIfCombo1.Text=""="出库信息=adCmdText=ZBEndSubEndSubUnloadMeEndSubPrivateSubForm_Load()Adodc2.RefreshDoUntilCombo2.AddItemCombo1.AddItemCombo3.AddItemLoopEndSub借出管理代码:PrivateSubCommand1_Click()IfCombo1.Text=""AndCombo2.Text=""Then'text1.Text=""AndText2.Text=""ThenMsgBox"“品名”和“型号”不能同时为空,必须输入其中一项!",,"提示信息!"ExitSubElseIfText1.Text=""AndCombo3.Text=""Then'Text4.Text=""ThenMsgBox"请输入产品“数量”或“单位”之一!",,"提示信息!"ExitSubEndIfMsgBox"ExitSubEndIf'添加=DateEndIfpms="select*from库存表where品名='"&pm&"'"=adCmdText=pmsm=If=Trim(Combo2.Text)Then=Val(m)-Val(n)EndIfDimXAsIntegerX=MsgBox("产品借出登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1,"提示信息!") IfX=vbNoThenForm2.ShowEndIfCombo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""="借出信息"DimZBAsString=adCmdText=ZBEndSubEndSubUnloadMeForm2.ShowEndSubDoUntilLoopEndSub归还管理代码:PrivateSubCommand1_Click()IfCombo1.Text=""AndCombo2.Text=""Then'text1.Text=""AndText2.Text=""Then MsgBox"“品名”和“型号”不能同时为空,必须输入其中一项!",,"提示信息!" ExitSubElseIfText1.Text=""AndCombo3.Text=""Then'Text4.Text=""ThenMsgBox"请输入产品“数量”或“单位”之一!",,"提示信息!"Text1.SetFocusExitSubEndIfIfText2.Text=""ThenMsgBox"请经手人签名!",vbCritical,"提示信息!"Text2.SetFocusExitSubEndIfIfText3.Text=""ThenMsgBox"请输入归还人姓名!",vbCritical,"提示信息!"ExitSubEndIf'添加=DateEndIf=adCmdText=pmsm==Val(m)+Val(n)EndIfDimXAsIntegerX=MsgBox("产品归还登记成功,是否继续添加产品!",vbYesNo+vbQuestion+vbDefaultButton1,"提示信息!") IfX=vbNoThenUnloadMeForm2.ShowEndIfCombo1.Text=""Combo2.Text=""Combo3.Text=""Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""="归还信息"DimZBAsStringZB="select*from归还表"'where品名='"&PM&"'" =adCmdText=ZBEndSubPrivateSubCommand2_Click()EndSubUnloadMeForm2.ShowEndSub'i=0''DoUntil''i=i+1'LoopCallpmEndSubPrivateSubpm()DimiAsVariantDimjAsVariantDimkAsVariantDimaAsVariantDimbAsVariantDimcAsVariantDimsAsVariantDimDAsVarianti=0j=0Adodc2.Refresh DoUntila=a+","+b=b+","+b=b+","+i=i+1LoopD=Split(a,",") Ifj<iThens=D(2)'k=0'k=k+1'Else'k=k+1'EndIf'EndIfj=j+1EndIfEndSub。
仓库管理系统源代码
![仓库管理系统源代码](https://img.taocdn.com/s3/m/c55981c4f01dc281e43af013.png)
#define MODE "rb+"#include <stdio.h>#include <stdlib.h>#include <string.h>int function2();int check(char name2[20],int number2,char brand2[20],char manufacturer2[20],int quantity2,int price2,int total2);int function3();int function4();int function1() //generate a file{FILE *fp;system("del C:\\bigday.dat");fp=fopen("C:\\bigday.dat","wb");printf("\t\t\t----------------------------------------\n");printf("\t\t\t* *\n");printf("\t\t\t*仓库物资库存管理系统*\n");printf("\t\t\t* *\n");printf("\t\t\t* 欢迎进入*\n");printf("\t\t\t* 按任意键继续*\n");printf("\t\t\t----------------------------------------\n");getchar(); g etchar();fclose(fp);return 0;}int function2() //input the data{FILE *fp1,*fp2;if((fp1=fopen("C:\\bigday.dat",MODE))==0){printf("C:\\bigday.dat error");exit(1);}if((fp2=fopen("C:\\TEPM.dat","wb+"))==0){printf("C:\\TEPM.dat error");exit(1);}char name[20],name2[20];int number,number2;char brand[20],brand2[20];char manufacturer[20],manufacturer2[20];int quantity,quantity2;int price,price2;int total,total2;char tell;int i;char ch;ch=fgetc(fp1);if(ch==EOF){printf("\n");printf("\t\t\t----------------------------------------\n");printf("\t\t\t* *\n");printf("\t\t\t*仓库物资库存管理系统*\n");printf("\t\t\t* *\n");printf("\t\t\t* 继续添加*\n");printf("\t\t\t----------------------------------------\n");printf("\n请依次输入:商品的名称、型号、品牌、生产厂家,数量,价格。
仓库管理系统(VB+Access+源代码)
![仓库管理系统(VB+Access+源代码)](https://img.taocdn.com/s3/m/4e8e91266c85ec3a87c2c5ef.png)
精心整理仓库管理系统项目的建立这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。
由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。
此文可作供初学者们学习交流。
作者联系方式:E-mail1、2、3、4、EndVB6.0中可以创建Access数据库。
如下建立一个“用户表”的数据库,用来存放用户信息及一些出入库管理信息。
如下图单击“外接程序”再单击“可视化数据管理器”出现如图点击“文件”——“新建”——“Microsoft Access”——“Version 2.0 MDB”输入数据库名,“保存”出现如下图在数据窗口中右击——“新建表”,最终如下往数据表里添加数据在这里就不罗嗦了,请查阅相关书籍。
登录界面窗口的建立最终界面如下:1、Adodc1的添加过程为:单击“工程”——“部件”出现下图所示,选择“控件”下的“Microsoft ADO Data Control 6.0 (OLEDB)”单击“确定”在工具栏中会出现“”图标,单击它并拖动到相应位置即可。
其它元件不在一一说明。
2、本窗体代码如下:Private Sub Command1_Click() '“登录”、“确定”按钮If Command1.Caption = "确定" And Command2.Caption = "取消" Then '如果为“确定”则添加新用户If Text1.Text = "" Then '提示用户输入用户名MsgBox "请输入用户名!", , "登录信息提示:"Exit SubElse 'Dim usename As String '检测用户名是否已经存在Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from 用户登录信息表 where 用户名='" & usename & "'"mandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshMsgBox "您输入的用户已存在!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text3.Text = ""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then '提示用户密码不能为空MsgBox "密码不能为空!", , "登录提示信息:"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请再次输入密码!", , "登录提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Exit SubElseMsgBox ("添加新用户成功,现在您可以登陆系统了!")Label3.Visible = FalseText3.Visible = FalseCommand1.Caption = "登录"Command2.Caption = "退出"End IfElse '“登录”按钮,用户登录 Dim strSno As StringDim strSelect As StringText3.Visible = FalseCommand1.Caption = "登录"Command2.Caption = "退出"Text1.Text = ""Text2.Text = ""Text1.SetFocusElseEnd 'Unload MeEnd IfPrivate Sub Command3_Click() '“新用户”按钮 Label3.Visible = TrueText3.Visible = TrueText1.Text = ""Text2.Text = ""Text3.Text = ""Command1.Caption = "确定"Command2.Caption = "取消"Text1.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)如下:代码:Private Sub AddNew_Click()Frame1.Visible = TrueFrame2.Visible = FalseEnd SubPrivate Sub CHKPMCHX_Click()Frame2.Caption = "出库信息"pm = InputBox("产品名", "请输入", 0)n = "select * from 出库表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CHKXHCHX_Click()Frame2.Caption = "出库信息"Dim XH As StringDim n As StringCHKRQ = InputBox("出库日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 出库表 where 出库日期 = '" & CHKRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CKZCX_Click()ZB = "select * from 出库表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid1End SubPrivate Sub Command1_Click()If Text1.Text = "" Then '提示用户输入用户名 MsgBox "请输入用户名!", , "登录信息提示:"Exit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Text2.SetFocusExit SubElseeX = MsgBox("成功添加新用户,是否要重新登录!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbYes ThenUnload MeForm3.ShowEnd If'MsgBox ("成功添加新用户!")'Label3.Visible = False'Text3.Visible = False'Command1.Caption = "登录"'Command2.Caption = "退出"End IfEndEnd SubPrivate Sub Form_Load()Unload Form1Frame1.Visible = FalseCall InitGrid0Me.Height = MDIForm1.Height - 1060Me.Width = MDIForm1.Width - 560Me.Top = MDIForm1.TopMe.Left = MDIForm1.LeftPrivate Sub GHCZ_Click()'Form2.HideForm8.ShowEnd SubPrivate Sub GHPMCX_Click()Frame2.Caption = "归还信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 归还表 where 品名 = '" & pm & "'" mandType = adCmdTextEnd SubPrivate Sub GHXHCX_Click()Frame2.Caption = "归还信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 归还表 where 型号 = '" & XH & "'" mandType = adCmdTextAdodc2.RecordSource = nPrivate Sub GHZCX_Click()Frame2.Caption = "归还信息"Dim ZB As StringZB = "select * from 归还表 "mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubEnd SubPrivate Sub JCRCX_Click()Frame2.Caption = "借出信息"Dim JCR As StringDim n As StringJCR = InputBox("借出人", "请输入", 0)n = "select * from 借出表 where 借出人 = '" & JCR & "'" mandType = adCmdTextAdodc2.RecordSource = nPrivate Sub JCSHJCX_Click()Frame2.Caption = "借出信息"Dim JCRQ As StringDim n As StringJCRQ = InputBox("借出日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 借出表 where 借出日期 = '" & JCRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 借出表 where 经手人 = '" & JSHR & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub PMCX_Click()Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 库存表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid0End SubPrivate Sub RKCZ_Click()'Form2.HideEnd SubPrivate Sub RKSHJ_Click()Frame2.Caption = "入库信息"Dim RKRQ As StringDim n As StringRKRQ = InputBox("入库日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 入库表 where 入库日期 = '" & RKRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub RKXHCHX_Click()Frame2.Caption = "入库信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Thenn = "select * from 入库表 where 型号 = '" & XH & "'" mandType = adCmdTextAdodc2.RecordSource = nElseLabel6.Move Label6.Left - 80ElseLabel6.Left = Form2.ScaleWidthEnd IfIf Label7.Left + Label7.Width > 0 ThenLabel7.Move Label7.Left - 80ElseLabel7.Left = Form2.ScaleWidthEnd IfEnd SubPrivate Sub XGMM_Click()'Form2.HideForm4.ShowEnd SubPrivate Sub XHCX_Click()Frame2.Caption = "库存信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Then 'And Val(XH) <> 0n = "select * from 库存表 where 型号 = '" & XH & "'"End WithEnd SubPrivate Sub InitGrid1()With DataGrid1.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 1000.Columns(6).Width = 800.Columns(7).Width = 4000End WithEnd SubPrivate Sub InitGrid2()With DataGrid1'.Columns(0).Caption = "学号"' .Columns(1).Caption = "课程名"'.Columns(2).Caption = "学分"' .Columns(3).Caption = "成绩"'设置DtgCond的列宽Text1.Text = ""Text2.Text = ""Text1.SetFocusExit SubEnd IfUnload MeForm2.Show'MsgBox "登陆成功!", , "登录提示信息:"ElseMsgBox "密码不正确,请重新输入!", , "登录提示信息:"Text2.Text = ""Text2.SetFocusEnd IfEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub修改用户密码界面代码:ElseEnd IfIf Text3.Text = "" ThenMsgBox "请输入新密码!", , "信息提示!"Text3.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "请再次输入新密码!", , "信息提示!" Text4.SetFocusExit SubEnd IfIf Trim(Text3.Text) <> Trim(Text4.Text) ThenMsgBox "两次输入的新密码不一致!", , "信息提示!" Text3.Text = ""Text4.Text = ""Text3.SetFocusExit SubElseMsgBox ("密码修改成功!")Unload Me'Form2.ShowEnd SubEnd Sub代码:ElseText5.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Text1.Text)n = Val(Text3.Text)pms = "select * from 库存表 where 品名='" & pm & "'"With Form2End WithElseEnd IfEnd IfDim X As IntegerX = MsgBox("产品入库登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload MeElseEnd SubEnd SubUnload Me'Form2.ShowEnd Sub出库管理代码:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" ThenMsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!" Exit SubElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text2.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusDim ZB As StringZB = "select * from 出库表 " 'where 品名 = '" & PM & "'"End SubPrivate Sub Command2_Click()Combo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""End SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd SubPrivate Sub Form_Load()Adodc2.RefreshLoopEnd Sub代码:Elsepm = Trim(Combo1.Text)n = Val(Text1.Text)pms = "select * from 库存表 where 品名='" & pm & "'"End IfDim X As IntegerX = MsgBox("产品借出登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload MeForm2.ShowEnd IfCombo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Dim ZB As StringZB = "select * from 借出表 " 'where 品名 = '" & PM & "'"End SubPrivate Sub Command2_Click()End SubEnd SubLoopEnd Sub代码:ElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" Then MsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入归还人姓名!", vbCritical, "提示信息!" Text3.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringEnd SubText1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End SubPrivate Sub Command3_Click()Unload MeForm2.ShowEnd SubPrivate Sub Form_Load()' Dim i As String' i = 0' Adodc2.Refresh' i = i + 1' LoopCall pmEnd SubPrivate Sub pm()Dim i As VariantDim j As VariantDim k As Varianti = 0j = 0LoopText5.Text = s 'a + "," + D(2) + D(1) '+ " " + Val(i) + " " + Val(j) + " " + Val(k) Text6.Text = j'Combo1.AddItem D(1)End Sub。
pm仓库管理系统源代码
![pm仓库管理系统源代码](https://img.taocdn.com/s3/m/96a1838e0b4c2e3f56276373.png)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1"><!- Sitemap 1.0 -></HEAD><BODY><OBJECT type="text/site properties”〉<param name="Window Styles" value="0x800025"><param name="lmageType" value="Folder"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="仓库管理系统 "><param name="Local" value="仓库管理系统.htm"><param name="lmageNumber" value="1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="简介"><param name="Local" value="仓库管理系统.htm/#1"><param name="lmageNumber" value="1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="使用说明"><param name="Local" value="仓库管理系统.htm/#2"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="登记信息”〉<param name="Local" value="仓库管理系统.htm/#2_1"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="货物信息"><param name="Local" value="仓库管理系统.htm/#2_1_1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="仓库信息 "><param name="Local" value="仓库管理系统,htm/#2_1_2"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="供应商"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="住来客户 "><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="库存状况 "><param name="Local" value="仓库管理系</OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="单据管理"><param name="Local" value="仓库管理系统,htm/#2_2"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="入库单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="出库单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="借入单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="借出单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="调拔单"><param name="Local" value="仓库管理系统,htm/#2_2_5"><LI> <OBJECT type="text/sitemap"><param name="Name" value="报损单"><param name="Local" value="仓库管理系统,htm/#2_2_6"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="月盘点"><param name="Local" value="仓库管理系统,htm/#2_2_7"></OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="查询统计"><param name="Local" value="仓库管理系统,htm/#2_3"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="单据查询 "><param name="Local" value="仓库管理系统,htm/#2_3_1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="库存查询 "><param name="Local" value="仓库管理系统,htm/#2_3_2"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="高级查询 "><param name="Local" value="仓库管理系统,htm/#2_3_3"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="自定义查询 "><param name="Local" value="仓库管理系统,htm/#2_3_4"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="管理自定义查询 "><param name="Local" value="仓库管理系</OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="货物出入统计 "><param name="Local" value="仓库管理系统,htm/#2_3_6"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="职员操作统计"><param name="Local" value="仓库管理系统,htm/#2_3_7"></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="维护设置"><param name="Local" value="仓库管理系统,htm/#2_4"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="公司信息 "><param name="Local" value="仓库管理系统.htm/#2_4_1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="职员信息 "><param name="Local" value="仓库管理系统,htm/#2_4_2"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="查看日志 "><param name="Local" value="仓库管理系统,htm/#2_4_3"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="数据清除"><param name="Local" value="仓库管理系统,htm/#2_4_4"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="系统初始化 "><param name="Local" value="仓库管理系统,htm/#2_4_5"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="备份数据库"><param name="Local" value="仓库管理系统,htm/#2_4_6"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="还原数据库”><param name="Local" value="仓库管理系统,htm/#2_4_7"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="还原到昨天数据库 "><param name="Local" value="仓库管理系统,htm/#2_4_8"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="修改密码 "><param name="Local" value="仓库管理系统,htm/#2_4_9"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="用户管理 "><param name="Local" value="仓库管理系统,htm/#2_4_10"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="换用户登陆”><param name="Local" value="仓库管理系统.htm/#2_4_11"></OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="帮助使用"><param name="Local" value="仓库管理系统.htm/#2_5"><param name="lmageNumber" value="1"></OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="技术支持 "><param name="Local" value="仓库管理系统,htm/#3"><param name="lmageNumber" value="1"></OBJECT></UL></BODY></HTML><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1"><!-- Sitemap 1.0 --></HEAD><BODY><UL><LI>〈OBJECT type="text/sitemap"><param name="Name" value="货物信息"><param name="Name" value="货物信息"><param name="Local" value="仓库管理系统.htm/#2_1_1"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="仓库信息"><param name="Name" value="仓库信息"><param name="Local" value="仓库管理系统.htm/#2_1_2"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="供应商"><param name="Name" value="供应商"><param name="Local" value="仓库管理系统.htm/#2_1_3"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="往来客户"><param name="Name" value="往来客户"><param name="Local" value="仓库管理系统.htm/#2_1_4"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="帮助使用"><param name="Name" value="帮助使用"><param name="Local" value="仓库管理系统.htm/#2_5"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="库存状况"><param name="Name" value="库存状况"><param name="Local" value="仓库管理系统.htm/#2_1_5"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="入库单"><param name="Name" value="入库单"><param name="Local" value="仓库管理系统.htm/#2_2_1"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="出库单"><param name="Name" value="出库单"><param name="Local" value="仓库管理系统.htm/#2_2_2"> </OBJECT> <LI>〈OBJECT type="text/sitemap"><param name="Name" value="借入单"><param name="Name" value="借入单"><param name="Local" value="仓库管理系统.htm/#2_2_3"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="借出单"><param name="Name" value="借出单"><param name="Local" value="仓库管理系统.htm/#2_2_4"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="调拔单"><param name="Name" value="调拔单"><param name="Local" value="仓库管理系统.htm/#2_2_5"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="报损单"><param name="Name" value="报损单"><param name="Local" value="仓库管理系统.htm/#2_2_6"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="月盘点"><param name="Name" value="月盘点"><param name="Local" value="仓库管理系统.htm/#2_2_7"> </OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="单据查询"><param name="Name" value="单据查询"><param name="Local" value="仓库管理系统.htm/#2_3_1"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="库存查询"><param name="Name" value="库存查询"><param name="Local" value="仓库管理系统.htm/#2_3_2"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="高级查询"><param name="Name" value="高级查询"><param name="Local" value="仓库管理系统.htm/#2_3_3"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="自定义查询"><param name="Name" value="自定义查询 "><param name="Local" value="仓库管理系统.htm/#2_3_4"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="管理自定义查询 "><param name="Name" value="管理自定义查询 "><param name="Local" value="仓库管理系统.htm/#2_3_5"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="货物出入统计 "><param name="Name" value="货物出入统计 "><param name="Local" value="仓库管理系统.htm/#2_3_6"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="职员操作统计"><param name="Name" value="职员操作统计"><param name="Local" value="仓库管理系统.htm/#2_3_7"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="公司信息 "><param name="Name" value="公司信息 "><param name="Local" value="仓库管理系统.htm/#2_4_1"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="职员信息 "><param name="Name" value="职员信息 "><param name="Local" value="仓库管理系统.htm/#2_4_2"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="查看日志 "><param name="Name" value="查看日志 "><param name="Local" value="仓库管理系统.htm/#2_4_3"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="数据清除"><param name="Name" value="数据清除"><param name="Local" value="仓库管理系统.htm/#2_4_4"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="系统初始化 "><param name="Name" value="系统初始化 "><param name="Local" value="仓库管理系统.htm/#2_4_5"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="备份数据库"><param name="Name" value="备份数据库"><param name="Local" value="仓库管理系统.htm/#2_4_6"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="还原数据库 "><param name="Name" value="还原数据库 "><param name="Local" value="仓库管理系统.htm/#2_4_7"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="还原到昨天数据库 "><param name="Name" value="还原到昨天数据库 "><param name="Local" value="仓库管理系统.htm/#2_4_8"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="修改密码"><param name="Name" value="修改密码"><param name="Local" value="仓库管理系统.htm/#2_4_9"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="用户管理 "><param name="Name" value="用户管理 "><param name="Local" value="仓库管理系统.htm/#2_4_10"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="换用户登陆"><param name="Name" value="换用户登陆"><param name="Local" value="仓库管理系统.htm/#2_4_11"> </OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="技术支持 "><param name="Name" value="技术支持 "><param name="Local" value="仓库管理系统.htm/#3"></OBJECT></UL></BODY></HTML>[Option 司Binary Index = NoCompatibility = 1.1 Or later Compiled file = 仓库管理系统.chm Contents file = 仓库管理系统.hhc Default topic = 仓库管理系统.htmDisplay compile progress=No Index file =仓库管理系统.hhk Language=0x804 中文(中国) Title=仓库管理系统 1.0[File s]仓库管理系统.htm [ALIAS]H0=仓库管理系统H1 =仓库管理系统H2=仓库管理系统H2=仓库管理系统 h21 =仓库管理系统 .htm ; 0 .htm/#1 ; 1 .htm/#2 ; 2.htm/#3 ; 3.htm/#2_1 ; 21.htm/#2_1_1 ; 211.htm/#2_1_2 ; 212.htm/#2_1_3 ; 213 .htm/#2_1_4 ; 214 .htm/#2_1_5 ; 215 .htm/#2_2_1 ; 221 .htm/#2_2_2 ; 222.htm/#2_2_3 ; 223.htm/#2_2_4 ; 224.htm/#2_2_5 ; 225.htm/#2_2_6 ; 226.htm/#2_2_7 ; 227H23=仓库管理系统.htm/#2_3 ; 23 H231 =仓库管理系统 H232=仓库管理系统H233=仓库管理系统H234=仓库管理系统H235=仓库管理系统H236=仓库管理系统H237=仓库管理系统H24=仓库管理系统.htm/#2_4 ; 24H241 =仓库管理系统.htm/#2_4_1 ; 241H2410=仓库管理系统.htm/#2_4_10 ; 2410H2411 =仓库管理系统.htm/#2_4_11 ; 2411H242=仓库管理系统.htm/#2_4_2 ; 242H246=仓库管理系统.htm/#2_4_6 ; 246H211 =仓库管理系统 H212=仓库管理系统 H213=仓库管理系统 H214=仓库管理系统H215=仓库管理系统H221 =仓库管理系统 H222=仓库管理系统 H223=仓库管理系统 H224=仓库管理系统 H225=仓库管理系统 H226=仓库管理系统 H227=仓库管理系统 .htm/#2_3_1 ; 231.htm/#2_3_2 ; 232.htm/#2_3_3 ; 233 .htm/#2_3_4 ; 234 .htm/#2_3_5 ; 235 .htm/#2_3_6 ; 236 .htm/#2_3_7 ; 237H243=仓库管理系统H244=仓库管理系统H245=仓库管理系统 .htm/#2_4_3 ; 243 .htm/#2_4_4 ; 244 .htm/#2_4_5 ; 245H247=仓库管理系统,htm/#2_4_7 ; 247 H248=仓库管理系统.htm/#2_4_8 ; 248 H249=仓库管理系统.htm/#2_4_9 ; 249 H25=仓库管理系统.htm/#2_5 ; 25H3=仓库管理系统.htm/#3 ; 3[MAP]#include仓库管理系统.h [INFOTYPES]。
(仓库管理)仓库管理系统源码
![(仓库管理)仓库管理系统源码](https://img.taocdn.com/s3/m/463bae0cdd3383c4bb4cd2f9.png)
(仓库管理)仓库管理系统源码unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,StdCtrls,DB,ADODB,jpeg,ExtCtrls;typeTForm1=class(TForm)ADOConnection1:TADOConnection;ADOQuery1:TADOQuery;Edit1:TEdit;Edit2:TEdit;Button1:TButton;Button2:TButton;ADOTable1:TADOTable;Image1:TImage;Label1:TLabel;Label2:TLabel;Label3:TLabel;Label4:TLabel;Button3:TButton;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton3Click(Sender:TObject); private{Privatedeclarations}publiccount:integer;{Publicdeclarations}end;varForm1:TForm1;implementationusesUnit12,Unit19;{$R*.dfm}procedureTForm1.Button1Click(Sender:TObject); varyonghu:string;beginyonghu:=trim(edit1.T ext);//trim去除字符串空格count:=count+1;//登陆次数withadoquery1dobeginClose;;:='select*from用户信息表where用户名='''+yonghu+'''';open;if(adoQuery1.RecordCount<>0)and(edit2.T ext<>'')and(adoQuery1.FieldByName('密码').AsString=edit2.T ext)thenbeginifadoQuery1.FieldByName('是否管理员').AsString='True'thenbeginform12.SpeedButton1.Visible:=true;form12.Button13.Visible:=true;('密码正确,即将进入系统。
仓库管理系统-源代码 -VB毕业设计
![仓库管理系统-源代码 -VB毕业设计](https://img.taocdn.com/s3/m/a4f59559e009581b6ad9eb63.png)
材料入库模块源代码如下:Private Sub Co米米and1_Click()If Text1.Text <> "" And Text2.Text <> "" And DTPicker1.Value <> "" And Text4.Text <> "" And Text5.Text <> "" And DataCo米bo1.Text <> "" And Text7.Text <> "" ThenAdodc1.RefreshAdodc2.RecordSource = "select * fro米库存材料清单where 材料号='" & Text1.Text & "'" Adodc2.RefreshIf Adodc2.Recordset.BOF Then米sg$ = "确定要添加该记录吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "添加记录")If ans = vbOK ThenAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(0) = Text1.TextAdodc1.Recordset.Fields(1) = Text2.TextAdodc1.Recordset.Fields(2) = CStr(DTPicker1.V alue)Adodc1.Recordset.Fields(3) = Text4.TextAdodc1.Recordset.Fields(4) = Text5.TextAdodc1.Recordset.Fields(5) = DataCo米bo1.TextAdodc1.Recordset.Fields(6) = Text7.TextAdodc1.Recordset.Fields(7) = Text8.TextAdodc1.Recordset.Update米sgBox ("保存成功!!*_*")End IfElse 米sgBox "材料号不能重复,该材料号已存在!!", 48, "警告"End IfElse 米sgBox "资料输入不全,请重新输入!!", 64, "提示"End IfText1.SetFocusText1.Text = ""Text2.Text = ""Text4.Text = ""Text5.Text = ""DataCo米bo1.Text = ""Text7.Text = ""Text8.Text = ""End SubPrivate Sub Co米米and2_Click()Text1.Text = ""Text2.Text = ""Text4.Text = ""Text5.Text = ""DataCo米bo1.Text = ""Text7.Text = ""Text8.Text = ""End SubPrivate Sub Co米米and3_Click()Unload 米eEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;" ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "库存材料清单"Adodc1.RefreshAdodc2.ConnectionString = adoAdodc3.ConnectionString = adoAdodc3.RecordSource = "gysxx"Adodc3.RefreshEnd SubPrivate Sub Text2_GotFocus()If Not Adodc1.Recordset.BOF ThenAdodc1.Recordset.米oveFirstWhile Not Adodc1.Recordset.EOFIf Adodc1.Recordset.Fields(0) = Text1.Text Then米sgBox "该材料号已经存在,请重新输入!!", 48, "提示"Text1.Text = ""End IfAdodc1.Recordset.米oveNextWendEnd IfEnd SubPrivate Sub Text7_GotFocus()If Not Adodc3.Recordset.BOF ThenAdodc3.Recordset.米oveFirstWhile Not Adodc3.Recordset.EOFIf Adodc3.Recordset.Fields(0) = DataCo米bo1.Text ThenText7.Text = Adodc3.Recordset.Fields(1)End IfAdodc3.Recordset.米oveNextWendEnd IfEnd Sub库存管理模块源代码如下:Di米sql As StringPrivate Sub Co米米and1_Click()If DataCo米bo1.Text = "" And DataCo米bo2.Text = "" And DataCo米bo3.Text = "" Then米sgBox "请在组合框中输入你要查询的内容!!", 64, "提示"ElseIf DataCo米bo1.Text = "" And DataCo米bo2.Text = "" And DataCo米bo3.Text <> "" Then sql = "select * fro米库存材料清单where 供应商号= '" & DataCo米bo3.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text = "" And DataCo米bo2.Text <> "" And DataCo米bo3.Text = "" Then sql = "select * fro米库存材料清单where 进货日期='" & DataCo米bo2.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text = "" And DataCo米bo2.Text <> "" And DataCo米bo3.Text <> "" Then sql = "select * fro米库存材料清单where 进货日期='" & DataCo米bo2.Text & "' and 供应商号='" & DataCo米bo3.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text <> "" And DataCo米bo2.Text = "" And DataCo米bo3.Text = "" Then sql = "select * fro米库存材料清单where 材料号='" & DataCo米bo1.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text <> "" And DataCo米bo2.Text = "" And DataCo米bo3.Text <> "" Then sql = "select * fro米库存材料清单where 材料号='" & DataCo米bo1.Text & "' and 供应商号='" & DataCo米bo3.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text <> "" And DataCo米bo2.Text <> "" And DataCo米bo3.Text = "" Then sql = "select * fro米库存材料清单where 材料号='" & DataCo米bo1.Text & "' and 进货日期='" & DataCo米bo2.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshElseIf DataCo米bo1.Text <> "" And DataCo米bo2.Text <> "" And DataCo米bo3.Text <> "" Thensql = "select * fro米库存材料清单where 材料号='" & DataCo米bo1.Text & "' and 进货日期='" & DataCo米bo2.Text & "' and 供应商号='" & DataCo米bo3.Text & "'"Adodc1.RecordSource = sqlAdodc1.RefreshEnd IfIf Adodc1.Recordset.BOF Then米sgBox "对不起,该库存不存在!!", 64, "提示"End IfEnd SubPrivate Sub Co米米and2_Click()Unload 米eEnd SubPrivate Sub Co米米and3_Click()If DataGrid1.AllowUpdate = False ThenDataGrid1.AllowUpdate = TrueDataGrid1.AllowDelete = TrueCo米米and3.Caption = "锁定"米sgBox "您巳进入修改状态!"ElseDataGrid1.AllowUpdate = FalseDataGrid1.AllowDelete = TrueCo米米and3.Caption = "修改"米sgBox "您进入锁定状态!"End IfEnd SubPrivate Sub Co米米and4_Click()米sg$ = "确定要删除该库存材料记录吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "删除记录")If ans = vbOK ThenAdodc1.Recordset.DeleteAdodc1.Recordset.米oveNextEnd IfEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "库存材料清单"Adodc1.RefreshAdodc2.ConnectionString = adoAdodc2.RecordSource = "库存材料清单"Adodc2.RefreshIf er_type <> 1 ThenCo米米and3.Enabled = FalseCo米米and4.Enabled = FalseEnd IfEnd Sub美容项目定义模块源代码如下:Private Sub Co米米and1_Click()If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" ThenAdodc2.RecordSource = "select * fro米美容项目定义表where 美容项目编号='" & Text1.Text & "'"Adodc2.RefreshIf Adodc2.Recordset.BOF ThenAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(0) = Text1.TextAdodc1.Recordset.Fields(1) = Text2.TextAdodc1.Recordset.Fields(2) = Text3.TextAdodc1.Recordset.UpdateElse米sgBox "该美容项目编号已存在!!", 48, "警告"End IfElse米sgBox "资料输入不全,请重新输入!!", 64, "提示"End IfText1.Text = ""Text2.Text = ""Text3.Text = ""Text1.SetFocusEnd SubPrivate Sub Co米米and2_Click()Text1.Text = ""Text2.Text = ""Text3.Text = ""End SubPrivate Sub Co米米and3_Click()Unload 米eEnd SubPrivate Sub Co米米and4_Click()米sg$ = "确定要删除该美容项目吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "删除记录") If ans = vbOK ThenAdodc1.Recordset.DeleteAdodc1.Recordset.米oveNextEnd IfEnd SubPrivate Sub Co米米and5_Click()If DataGrid1.AllowUpdate = False ThenDataGrid1.AllowUpdate = TrueDataGrid1.AllowDelete = TrueCo米米and5.Caption = "锁定"米sgBox "您巳进入修改状态!"ElseDataGrid1.AllowUpdate = FalseDataGrid1.AllowDelete = TrueCo米米and5.Caption = "修改"米sgBox "您进入锁定状态!"End IfEnd SubPrivate Sub Text2_GotFocus()If Not Adodc1.Recordset.BOF ThenAdodc1.Recordset.米oveFirstWhile Not Adodc1.Recordset.EOFIf Adodc1.Recordset.Fields(0) = Text1.Text Then米sgBox "该美容项目编号已经存在,请重新输入!!", 48, "提示"Text1.Text = ""End IfAdodc1.Recordset.米oveNextWendEnd IfEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "美容项目定义表"Adodc1.RefreshAdodc2.ConnectionString = adoEnd Sub美容项目查询模块源代码如下:Private Sub Co米米and1_Click()If DataCo米bo1.Text = "" Then米sgBox ("输入不能为空!!")ElseAdodc2.RecordSource = "select * fro米美容项目定义表where 美容项目名称='" & DataCo 米bo1.Text & "'"Adodc2.RefreshDataGrid1.Colu米ns(0).Width = 1200DataGrid1.Colu米ns(1).Width = 1200DataGrid1.Colu米ns(2).Width = 1200End IfEnd SubPrivate Sub Co米米and2_Click()Unload 米eEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "美容项目定义表"Adodc1.RefreshAdodc2.ConnectionString = adoEnd Sub来车登记模块源代码如下:Di米sql As StringPrivate Sub Co米米and1_Click()If DTPicker1.Value <> "" And Text2.Text <> "" And Text3.Text <> "" And Text4.Text <> "" And DataCo米bo1.Text <> "" Then米sg$ = "确定要添加该登记吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "添加登记")If ans = vbOK ThenAdodc1.RefreshAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc1.Recordset.Fields(1) = Text2.TextAdodc1.Recordset.Fields(2) = Text3.TextAdodc1.Recordset.Fields(3) = Text4.TextAdodc1.Recordset.Fields(4) = DataCo米bo1.TextAdodc1.Recordset.Fields(5) = Text5.TextAdodc1.Recordset.Update米sgBox ("成功登记!!~-~")ElseExit SubEnd IfDi米sql As Stringsql = "select * fro米车辆基本信息表where 车牌号码='" & Text2.Text & "'"Adodc3.RecordSource = sqlAdodc3.RefreshIf Adodc3.Recordset.BOF ThenAdodc2.RefreshAdodc2.Recordset.AddNewAdodc2.Recordset.Fields(0) = Text2.TextAdodc2.Recordset.Fields(1) = Text3.TextAdodc2.Recordset.Fields(2) = Text4.TextAdodc2.Recordset.Fields(3) = Text5.TextAdodc2.Recordset.UpdateEnd IfElse米sgBox "资料输入不全,请重新输入!!", 64, "提示"End IfDTPicker1.SetFocusText2.Text = ""Text3.Text = ""Text4.Text = ""DataCo米bo1.Text = ""Text5.Text = ""End SubPrivate Sub Co米米and2_Click()Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""DataCo米bo1.Text = ""End SubPrivate Sub Co米米and3_Click()Unload 米eEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;" ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "来车登记表"Adodc1.RefreshAdodc2.ConnectionString = adoAdodc2.RecordSource = "车辆基本信息表"Adodc2.RefreshAdodc3.ConnectionString = adoAdodc4.ConnectionString = adoAdodc4.RecordSource = "b米xx"Adodc4.RefreshEnd Sub车辆基本信息管理模块源代码如下:Private Sub Co米米and1_Click()查询车辆基本信息.ShowEnd SubPrivate Sub Co米米and2_Click()Unload 米eEnd SubPrivate Sub Co米米and3_Click()米sg$ = "确定要删除该项信息吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "删除记录")If ans = vbOK ThenAdodc1.Recordset.DeleteAdodc1.Recordset.米oveNextEnd IfEnd SubPrivate Sub Co米米and4_Click()If DataGrid1.AllowUpdate = False ThenDataGrid1.AllowUpdate = TrueDataGrid1.AllowDelete = TrueCo米米and4.Caption = "锁定"米sgBox "您巳进入修改状态!"ElseDataGrid1.AllowUpdate = FalseDataGrid1.AllowDelete = TrueCo米米and4.Caption = "修改"米sgBox "您进入锁定状态!"End IfEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "车辆基本信息表"Adodc1.RefreshIf er_type <> 1 ThenCo米米and3.Enabled = FalseCo米米and4.Enabled = FalseEnd IfEnd Sub车辆美容信息管理模块源代码如下:Private Sub Co米米and1_Click()Di米su米1, x, z As CurrencyDi米y, n1, l, l1 As Longsu米1 = 0n1 = 0l1 = 0If CStr(DTPicker1.Value) <> "" And Text2.Text <> "" And Text3.Text <> "" And DataCo米bo1.Text <> "" And DataCo米bo5.Text <> "" And DataCo米bo6.Text <> "" Then'修改库存材料清单Di米q, q1 As Longq1 = 0If Not Adodc5.Recordset.BOF ThenAdodc5.RefreshAdodc5.Recordset.米oveFirstWhile Not Adodc5.Recordset.EOFIf Adodc5.Recordset.Fields(0) = DataCo米bo5.Text And Adodc5.Recordset.Fields(1) = DataCo米bo6.Text Thenq1 = 1If Adodc5.Recordset.Fields(4) < CLng(Text3.Text) Then米sgBox "这种材料的库存数量不够!!", 48, "警告"DataCo米bo5.Text = ""DataCo米bo6.Text = ""Text2.Text = ""Text3.Text = ""Exit SubElseq = Adodc5.Recordset.Fields(4)Adodc5.Recordset.Fields(4) = q - CLng(Text3.Text)Adodc5.Recordset.UpdateEnd IfEnd IfAdodc5.Recordset.米oveNextWendIf q1 = 0 Then米sgBox "库存中没有这种材料!!", 48, "警告"End If'修改库存材料清单完毕End IfIf q1 = 1 ThenAdodc6.RefreshIf Not Adodc6.Recordset.BOF ThenAdodc6.Recordset.米oveFirstWhile Not Adodc6.Recordset.EOF '查找一下车辆用料信息表中是否存在这种材料If Adodc6.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc6.Recordset.Fields(1) = DataCo米bo1.Text And Adodc6.Recordset.Fields(2) = DataCo米bo5.Text And Adodc6.Recordset.Fields(3) = DataCo米bo6.Text And Adodc6.Recordset.Fields(4) = Text2.Text Thenl = Adodc6.Recordset.Fields(5)l1 = 1Adodc6.Recordset.Fields(5) = l + CLng(Text3.Text) '如果存在,只修改数量Adodc6.Recordset.UpdateEnd IfAdodc6.Recordset.米oveNextWendEnd IfIf l1 = 0 Then '如果不存在,则在车辆用料信息表中添加新记录Adodc6.Recordset.AddNewAdodc6.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc6.Recordset.Fields(1) = DataCo米bo1.TextAdodc6.Recordset.Fields(2) = DataCo米bo5.TextAdodc6.Recordset.Fields(3) = DataCo米bo6.TextAdodc6.Recordset.Fields(4) = Text2.TextAdodc6.Recordset.Fields(5) = Text3.TextAdodc6.Recordset.UpdateAdodc6.RefreshEnd IfIf Not Adodc9.Recordset.BOF ThenAdodc9.Refresh '在车辆消费信息表中添加该车辆的材料费Adodc9.Recordset.米oveFirstWhile Not Adodc9.Recordset.EOFIf Adodc9.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc9.Recordset.Fields(1) = DataCo米bo1.Text Thenn1 = 1 '如果车辆消费信息表中存在当天该车的记录时Adodc6.Refresh '在车辆用料信息表中,计算该车的材料费Adodc6.Recordset.米oveFirstWhile Not Adodc6.Recordset.EOFIf Adodc6.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc6.Recordset.Fields(1) = DataCo米bo1.Text Thenx = Adodc6.Recordset.Fields(4)y = Adodc6.Recordset.Fields(5)z = x * ysu米1 = su米1 + zEnd IfAdodc6.Recordset.米oveNextWendAdodc9.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc9.Recordset.Fields(1) = DataCo米bo1.TextAdodc9.Recordset.Fields(3) = su米1Adodc9.Recordset.Fields(4) = su米1 + Adodc9.Recordset.Fields(2)Adodc9.Recordset.UpdateEnd IfAdodc9.Recordset.米oveNextWendEnd IfIf n1 = 0 Then '车辆消费信息表中无该车辆记录时Adodc9.Recordset.AddNew '向车辆消费信息表中添加材料费记录Adodc6.Refresh '车辆用料信息表Adodc6.Recordset.米oveFirstWhile Not Adodc6.Recordset.EOFIf Adodc6.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc6.Recordset.Fields(1) = DataCo米bo1.Text Thenx = Adodc6.Recordset.Fields(4)y = Adodc6.Recordset.Fields(5)z = x * ysu米1 = su米1 + zEnd IfAdodc6.Recordset.米oveNextWendAdodc9.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc9.Recordset.Fields(1) = DataCo米bo1.TextAdodc9.Recordset.Fields(3) = su米1Adodc9.Recordset.Fields(4) = su米1Adodc9.Recordset.Update '保存记录End IfEnd IfElse米sgBox "资料输入不全,请重新输入!!", 64, "提示"End IfDataCo米bo5.Text = ""DataCo米bo6.Text = ""Text2.Text = ""Text3.Text = ""DataCo米bo5.SetFocusEnd SubPrivate Sub Co米米and2_Click()DataCo米bo1.Text = ""DataCo米bo2.Text = ""DataCo米bo3.Text = ""DataCo米bo4.Text = ""Unload 米eEnd SubPrivate Sub Co米米and3_Click()修改美容项目.ShowEnd SubPrivate Sub Co米米and4_Click()Di米su米, x, z As CurrencyDi米y, n As Longsu米= 0 n = 0If DTPicker1.Value <> "" And DataCo米bo1.Text <> "" And DataCo米bo2.Text <> "" And DataCo米bo3.Text <> "" And DataCo米bo4.Text <> "" ThenAdodc4.Refresh '车辆美容信息登记表Adodc4.Recordset.AddNewAdodc4.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc4.Recordset.Fields(1) = DataCo米bo1.TextAdodc4.Recordset.Fields(2) = DataCo米bo4.TextAdodc4.Recordset.Fields(3) = DataCo米bo2.TextAdodc4.Recordset.Fields(4) = DataCo米bo3.TextAdodc4.Recordset.UpdateAdodc9.RefreshIf Not Adodc9.Recordset.BOF Then '判断一下表是否为空表Adodc9.RefreshAdodc9.Recordset.米oveFirstWhile Not Adodc9.Recordset.EOFIf Adodc9.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc9.Recordset.Fields(1) = DataCo米bo1.Text Thenn = 1Adodc4.RefreshAdodc4.Recordset.米oveFirstWhile Not Adodc4.Recordset.EOFIf Adodc4.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc4.Recordset.Fields(1) = DataCo米bo1.Text Thensu米= su米+ Adodc4.Recordset.Fields(4)End IfAdodc4.Recordset.米oveNextWendAdodc9.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc9.Recordset.Fields(1) = DataCo米bo1.TextAdodc9.Recordset.Fields(2) = su米Adodc9.Recordset.Fields(4) = su米+ Adodc9.Recordset.Fields(3)Adodc9.Recordset.Update '保存End IfAdodc9.Recordset.米oveNextWendEnd IfIf n = 0 ThenAdodc9.Recordset.AddNew '向车辆消费信息表中添加美容项目消费Adodc4.RefreshAdodc4.Recordset.米oveFirstWhile Not Adodc4.Recordset.EOFIf Adodc4.Recordset.Fields(0) = CStr(DTPicker1.Value) And Adodc4.Recordset.Fields(1) = DataCo米bo1.Text Thensu米= su米+ Adodc4.Recordset.Fields(4)End IfAdodc4.Recordset.米oveNextWendAdodc9.Recordset.Fields(0) = CStr(DTPicker1.V alue)Adodc9.Recordset.Fields(1) = DataCo米bo1.TextAdodc9.Recordset.Fields(2) = su米Adodc9.Recordset.Fields(4) = su米Adodc9.Recordset.Update '保存End IfElse 米sgBox "资料输入不全,请重新输入!!", 64, "提示"End IfDataCo米bo2.Text = ""DataCo米bo3.Text = ""DataGrid1.Colu米ns(0).Width = 1500DataGrid1.Colu米ns(1).Width = 1500DataCo米bo2.SetFocusEnd SubPrivate Sub Co米米and5_Click()修改用料.ShowEnd SubPrivate Sub Co米米and6_Click()If DataGrid1.AllowUpdate = False ThenDataGrid1.AllowUpdate = TrueDataGrid1.AllowDelete = TrueCo米米and6.Caption = "锁定"米sgBox "您巳进入修改状态!"ElseDataGrid1.AllowUpdate = FalseDataGrid1.AllowDelete = TrueCo米米and6.Caption = "修改"米sgBox "您进入锁定状态!"End IfEnd SubPrivate Sub DataCo米bo2_GotFocus()Adodc7.RecordSource = "select 美容项目,价格fro米车辆美容信息登记表where 日期='" & CStr(DTPicker1.Value) & "' and 车牌号码='" & DataCo米bo1.Text & "'"Adodc7.RefreshEnd SubPrivate Sub DataCo米bo5_GotFocus()Adodc8.RecordSource = "select 材料号,材料名称,单价,数量fro米车辆用料信息表where 日期='" & CStr(DTPicker1.Value) & "' and 车牌号码='" & DataCo米bo1.Text & "'"Adodc8.RefreshDataGrid2.Colu米ns(0).Width = 1000DataGrid2.Colu米ns(1).Width = 1000DataGrid2.Colu米ns(2).Width = 1000DataGrid2.Colu米ns(3).Width = 1000End SubPrivate Sub DataCo米bo3_GotFocus()'查询美容项目定义表,美容价格随着美容项目的选择而变If Not Adodc2.Recordset.BOF ThenAdodc2.Recordset.米oveFirstWhile Not Adodc2.Recordset.EOFIf Adodc2.Recordset.Fields(1) = DataCo米bo2.Text ThenDataCo米bo3.Text = Adodc2.Recordset.Fields(2)End IfAdodc2.Recordset.米oveNextWendEnd IfEnd SubPrivate Sub DataCo米bo6_GotFocus()If Not Adodc5.Recordset.BOF Then '根据填入的材料号,材料名称会自动出现Adodc5.Recordset.米oveFirstWhile Not Adodc5.Recordset.EOFIf Adodc5.Recordset.Fields(0) = DataCo米bo5.Text ThenDataCo米bo6.Text = Adodc5.Recordset.Fields(1)End IfAdodc5.Recordset.米oveNextWendEnd IfEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc1.RecordSource = "车辆基本信息表"Adodc1.RefreshAdodc2.ConnectionString = adoAdodc2.RecordSource = "美容项目定义表"Adodc2.RefreshAdodc3.ConnectionString = adoAdodc3.RecordSource = "b米xx"Adodc3.RefreshAdodc4.ConnectionString = adoAdodc4.RecordSource = "车辆美容信息登记表"Adodc4.RefreshAdodc5.ConnectionString = adoAdodc5.RecordSource = "库存材料清单"Adodc5.RefreshAdodc6.ConnectionString = adoAdodc6.RecordSource = "车辆用料信息表"Adodc6.RefreshAdodc9.ConnectionString = adoAdodc9.RecordSource = "车辆消费信息表"Adodc9.RefreshIf er_type <> 1 ThenCo米米and3.Enabled = FalseCo米米and5.Enabled = FalseEnd IfEnd Sub修改美容项目模块源代码如下:Private Sub Co米米and1_Click()Di米l, x, y As Longl = 0Adodc2.Refresh '在美容项目登记表中删除项目Adodc2.Recordset.米oveFirstWhile Not Adodc2.Recordset.EOFIf Adodc2.Recordset.Fields(0) = Text1.Text And Adodc2.Recordset.Fields(1) = DataCo米bo1.Text And Adodc2.Recordset.Fields(2) = DataCo米bo2.Text And Adodc2.Recordset.Fields(3) = DataCo米bo3.Text And Adodc2.Recordset.Fields(4) = DataCo米bo4.Text Thenl = 1y = Adodc2.Recordset.Fields(4)米sg$ = "确定要删除该美容项目吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "删除记录")If ans = vbOK ThenAdodc2.Recordset.DeleteAdodc2.Recordset.米oveNextAdodc2.Recordset.UpdateAdodc2.RefreshEnd IfDataGrid1.Colu米ns(0).Width = 1200DataGrid1.Colu米ns(1).Width = 1200DataGrid1.Colu米ns(2).Width = 1200DataGrid1.Colu米ns(3).Width = 1200DataGrid1.Colu米ns(4).Width = 1200End IfAdodc2.Recordset.米oveNextWendIf l = 0 Then '要删除的项目不存在时米sgBox ("数据库中没有您要删除的项目!!")End IfAdodc6.Refresh '修改车辆消费信息表中的人工费合计和总金额Adodc6.Recordset.米oveFirstWhile Not Adodc6.Recordset.EOFIf Adodc6.Recordset.Fields(0) = Text1.Text And Adodc6.Recordset.Fields(1) = DataCo米bo1.Text Thenx = Adodc6.Recordset.Fields(2)Adodc6.Recordset.Fields(2) = x - yAdodc6.Recordset.Fields(4) = Adodc6.Recordset.Fields(2) + Adodc6.Recordset.Fields(3)Adodc6.Recordset.UpdateEnd IfAdodc6.Recordset.米oveNextWendDataCo米bo2.Text = ""DataCo米bo3.Text = ""DataCo米bo4.Text = ""DataCo米bo2.SetFocusEnd SubPrivate Sub Co米米and2_Click()Unload 米eEnd SubPrivate Sub Co米米and3_Click()If DataGrid1.AllowUpdate = False ThenDataGrid1.AllowUpdate = TrueDataGrid1.AllowDelete = TrueCo米米and3.Caption = "锁定"米sgBox "您巳进入修改状态!"ElseDataGrid1.AllowUpdate = FalseDataGrid1.AllowDelete = TrueCo米米and3.Caption = "修改"米sgBox "您进入锁定状态!"End IfEnd SubPrivate Sub DataCo米bo2_GotFocus()Adodc1.RecordSource = "select * fro米车辆美容信息登记表where 日期='" & Text1.Text & "' and 车牌号码='" & DataCo米bo1.Text & "'"Adodc1.RefreshEnd SubPrivate Sub For米_Load()Di米ado As String, 米path As String米path = App.pathIf Right(米path, 1) <> "\" Then 米path = 米path + "\"ado = "Provider=米icrosoft.Jet.OLEDB.4.0;Persist Security Info=False;"ado = ado + "Data Source=" + 米path + "database.米db"Adodc1.ConnectionString = adoAdodc2.ConnectionString = adoAdodc2.RecordSource = "车辆美容信息登记表"Adodc2.RefreshAdodc3.ConnectionString = adoAdodc3.RecordSource = "车辆基本信息表"Adodc3.RefreshAdodc5.ConnectionString = adoAdodc5.RecordSource = "美容项目定义表"Adodc5.RefreshAdodc6.ConnectionString = adoAdodc6.RecordSource = "车辆消费信息表"Adodc6.Refresh'Text1.SetFocusEnd Sub修改用料模块源代码如下:Private Sub Co米米and1_Click()Di米l, x, y, z, 米, l1 As Longl = 0l1 = 0Adodc3.Refresh '在车辆用料信息表中删除信息If Not Adodc3.Recordset.BOF ThenAdodc3.Recordset.米oveFirstWhile Not Adodc3.Recordset.EOFIf Adodc3.Recordset.Fields(0) = Text1.Text And Adodc3.Recordset.Fields(1) = DataCo米bo1.Text And Adodc3.Recordset.Fields(2) = DataCo米bo2.Text And Adodc3.Recordset.Fields(3) = DataCo米bo3.Text And Adodc3.Recordset.Fields(4) = Text2.Text Thenl = 1z = Adodc3.Recordset.Fields(5)米= z - CLng(Text3.Text)If 米> 0 Then米sg$ = "确定要修改该用料信息吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "修改记录")If ans = vbOK Thenl1 = 1Adodc3.Recordset.Fields(5) = 米Adodc3.Recordset.UpdateAdodc3.Refreshy = Adodc3.Recordset.Fields(4) * CLng(Text3.Text)End IfElseIf 米= 0 Then米sg$ = "确定要删除该用料信息吗?"ans = 米sgBox(米sg$, vbOKCancel + vbDefaultButton2, "删除记录")If ans = vbOK Thenl1 = 1y = Adodc3.Recordset.Fields(4) * CLng(Text3.Text)Adodc3.Recordset.DeleteAdodc3.Recordset.米oveNextAdodc3.RefreshEnd IfElseIf 米< 0 Then米sgBox ("您要删除的数量大于该车实际用量!!")End IfDataGrid1.Colu米ns(0).Width = 1200DataGrid1.Colu米ns(1).Width = 1200DataGrid1.Colu米ns(2).Width = 1200DataGrid1.Colu米ns(3).Width = 1200DataGrid1.Colu米ns(4).Width = 1200DataGrid1.Colu米ns(5).Width = 1200If l1 = 1 ThenAdodc4.Refresh '修改车辆消费信息表中的材料费合计和总金额If Not Adodc4.Recordset.BOF ThenAdodc4.Recordset.米oveFirstWhile Not Adodc4.Recordset.EOFIf Adodc4.Recordset.Fields(0) = Text1.Text And Adodc4.Recordset.Fields(1) = DataCo米bo1.Text Thenx = Adodc4.Recordset.Fields(3)Adodc4.Recordset.Fields(3) = x - yAdodc4.Recordset.Fields(4) = Adodc4.Recordset.Fields(2) + Adodc4.Recordset.Fields(3)Adodc4.Recordset.UpdateEnd IfAdodc4.Recordset.米oveNextWendEnd IfAdodc2.Refresh '修改库存材料清单If Not Adodc2.Recordset.BOF ThenAdodc2.Recordset.米oveFirstWhile Not Adodc2.Recordset.EOFIf Adodc2.Recordset.Fields(0) = DataCo米bo2.Text And Adodc2.Recordset.Fields(1) = DataCo米bo3.Text ThenAdodc2.Recordset.Fields(4) = Adodc2.Recordset.Fields(4) + CLng(Text3.Text)Adodc2.Recordset.UpdateEnd IfAdodc2.Recordset.米oveNextWendEnd If '修改库存材料清单完毕End IfDataCo米bo2.Text = ""DataCo米bo3.Text = ""Text2.Text = ""。
仓库管理系统源代码
![仓库管理系统源代码](https://img.taocdn.com/s3/m/d18c7471a417866fb84a8ea0.png)
/********************************************仓库管理系统***********************************************************/
{
printf("\tCan not open the temp file!");
getch();
exit(1);
}
printf("please input the num you want to amend:");
getchar();
scanf("%d",&x);
y=(x-1)*sizeof(infom);
rewind(fp); /*把指针移回文件开始*/
if(fseek(fp,y,0)!=0)/*把指针指向Y*/
{
printf("can not move there!\n");
exit(1);
remove("c:\\123.dat"); /*删除文件123*/
rename("c:\\456.dat","c:\\123.dat"); /*对文件456重命名*/
}
else
printf("Can not find this record!\n");
getch();
pm仓库管理系统源代码
![pm仓库管理系统源代码](https://img.taocdn.com/s3/m/96a1838e0b4c2e3f56276373.png)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1"><!- Sitemap 1.0 -></HEAD><BODY><OBJECT type="text/site properties”〉<param name="Window Styles" value="0x800025"><param name="lmageType" value="Folder"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="仓库管理系统 "><param name="Local" value="仓库管理系统.htm"><param name="lmageNumber" value="1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="简介"><param name="Local" value="仓库管理系统.htm/#1"><param name="lmageNumber" value="1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="使用说明"><param name="Local" value="仓库管理系统.htm/#2"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="登记信息”〉<param name="Local" value="仓库管理系统.htm/#2_1"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="货物信息"><param name="Local" value="仓库管理系统.htm/#2_1_1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="仓库信息 "><param name="Local" value="仓库管理系统,htm/#2_1_2"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="供应商"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="住来客户 "><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="库存状况 "><param name="Local" value="仓库管理系</OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="单据管理"><param name="Local" value="仓库管理系统,htm/#2_2"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="入库单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="出库单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="借入单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="借出单"><param name="Local" value="仓库管理系</OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="调拔单"><param name="Local" value="仓库管理系统,htm/#2_2_5"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="报损单"><param name="Local" value="仓库管理系统,htm/#2_2_6"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="月盘点"><param name="Local" value="仓库管理系统,htm/#2_2_7"></OBJECT></UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="查询统计"><param name="Local" value="仓库管理系统,htm/#2_3"><param name="lmageNumber" value="1"></OBJECT><UL><LI> <OBJECT type="text/sitemap"><param name="Name" value="单据查询 "><param name="Local" value="仓库管理系统,htm/#2_3_1"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="库存查询 "><param name="Local" value="仓库管理系统,htm/#2_3_2"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="高级查询 "><param name="Local" value="仓库管理系统,htm/#2_3_3"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="自定义查询 "><param name="Local" value="仓库管理系统,htm/#2_3_4"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="管理自定义查询 "><param name="Local" value="仓库管理系</OBJECT> <LI> <OBJECT type="text/sitemap"><param name="Name" value="货物出入统计 "><param name="Local" value="仓库管理系统,htm/#2_3_6"></OBJECT><LI> <OBJECT type="text/sitemap"><param name="Name" value="职员操作统计"><param name="Local" value="仓库管理系统,htm/#2_3_7">。
仓库管理系统(VB+Access+源代码)
![仓库管理系统(VB+Access+源代码)](https://img.taocdn.com/s3/m/6732251b1eb91a37f1115ce2.png)
精心整理精心整理仓库管理系统项目的建立这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。
由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。
此文可作供: 1、2、3、4、 在“标题”里输入“系统”,在“名称”里输入“Sys ”(注意此处不能为汉字)点击“下一个”再点击“”“确定”退到MDI 界面点击“系统”——“退出”如下,然后编写代码。
代码如下:Private Sub Exit_Click()精心整理EndEnd Sub数据库的建立VB6.0中可以创建Access数据库。
如下建立一个“用户表”的数据库,用来存放用户信息及一些出入库管理信息。
如下图单击“外接程序”点击“”出现1、单击““”明。
2、本窗体代码如下:Private Sub Command1_Click() '“登录”、“确定”按钮If Command1.Caption = "确定" And Command2.Caption = "取消" Then '如果为“确定”则添加新用户If Text1.Text = "" Then '提示用户输入用户名MsgBox "请输入用户名!", , "登录信息提示:"Exit SubElse 'Dim usename As String '检测用户名是否已经存在Dim strS As String精心整理. . .. . .usename = Trim(Text1.Text)strS = "select * from 用户登录信息表where 用户名='" & usename & "'"mandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshMsgBox "您输入的用户已存在!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text3.Text = ""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then '提示用户密码不能为空MsgBox "密码不能为空!", , "登录提示信息:"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请再次输入密码!", , "登录提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Text2.SetFocusExit SubElseMsgBox ("添加新用户成功,现在您可以登陆系统了!")Label3.Visible = FalseText3.Visible = FalseCommand1.Caption = "登录"Command2.Caption = "退出"End IfElse '“登录”按钮,用户登录Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text) '检测用户名是否存在strSelect = "select 密码from 用户登录信息表where 用户名= '" & strSno & "'"mandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshMsgBox "用户名不存在,请重新输入!", , "登录提示信息:"Text1.Text = "". 专业专注.精心整理Text2.Text = ""Text1.SetFocusExit SubEnd IfForm1.Hide'Unload MeForm2.Show'MsgBox "登陆成功!", , "登录提示信息:"ElseMsgBox "密码不正确,请重新输入!", , "登录提示信息:"Text2.Text = ""Text1.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.Visible = TrueEnd SubPrivate Sub Command3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.Visible = FalseEnd SubPrivate Sub Form_Load()Label3.Visible = False精心整理. . .. . .Text3.Visible = FalseEnd SubPrivate Sub Timer1_Timer() '时间time1控件的time事件代码,用来'显示向左移动的欢迎字幕If Label4.Left + Label4.Width > 0 Then '当标签右边位置大于0时,标签向左移Label4.Move Label4.Left - 80Else '否则标签从头开始Label4.Left = Form1.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form1.ScaleWidthEnd IfEnd Sub主界面窗体如下:代码:Private Sub AddNew_Click()Frame1.Visible = TrueFrame2.Visible = FalseEnd SubPrivate Sub CHKPMCHX_Click()Frame2.Caption = "出库信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 出库表where 品名= '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CHKXHCHX_Click()Frame2.Caption = "出库信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 出库表where 型号= '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = n. 专业专注.精心整理Adodc2.RefreshEnd SubPrivate Sub CKCZ_Click()'Form2.HideForm6.ShowEnd SubPrivate Sub CKJSHR_Click()Frame2.Caption = "出库信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)End SubPrivate Sub Command1_Click()If Text1.Text = "" Then '提示用户输入用户名MsgBox "请输入用户名!", , "登录信息提示:"Exit SubElse 'Dim usename As String '检测用户名是否已经存在Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from 用户登录信息表where 用户名='" & usename & "'"精心整理. . .. . .mandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshMsgBox "您输入的用户已存在!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text3.Text = ""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then '提示用户密码不能为空MsgBox "密码不能为空!", , "登录提示信息:"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请再次输入密码!", , "登录提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "两次输入的密码不一致,请确认!", , "登录提示信息:"Text2.Text = ""Text3.Text = ""Text2.SetFocusExit SubElseeDim X As IntegerX = MsgBox("成功添加新用户,是否要重新登录!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbYes ThenUnload MeForm3.ShowEnd If'MsgBox ("成功添加新用户!")'Label3.Visible = False'Text3.Visible = False'Command1.Caption = "登录"'Command2.Caption = "退出"End IfFrame1.Visible = FalseFrame2.Visible = TrueText1.Text = ""Text2.Text = "'"Text3.Text = "". 专业专注.精心整理精心整理'Form3.ShowEnd SubPrivate Sub Command2_Click()Frame1.Visible = FalseFrame2.Visible = TrueEnd SubPrivate Sub CXDL_Click()Form3.Show'Unload MeEnd SubPrivate Sub Exit_Click()EndDim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 归还表 where 品名 = '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHRCX_Click(). . .. . . Frame2.Caption = "归还信息"Dim JCR As StringDim n As StringJCR = InputBox("归还人", "请输入", 0)n = "select * from 归还表where 归还人= '" & JCR & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHSJCX_Click()Frame2.Caption = "归还信息"Dim JCRQ As StringDim n As StringJCRQ = InputBox("归还日期,格式为:月/日/年如:12/1/2011", "请输入", 0)n = "select * from 归还表where 归还日期= '" & JCRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHXHCX_Click()Frame2.Caption = "归还信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)n = "select * from 归还表where 型号= '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHZCX_Click()Frame2.Caption = "归还信息"Dim ZB As StringZB = "select * from 归还表"mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCCZ_Click()'Form2.HideForm7.ShowEnd SubPrivate Sub JCHPMCHX_Click(). 专业专注.精心整理Frame2.Caption = "借出信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 借出表where 品名= '" & pm & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCHXHCHX_Click()JCRQ = InputBox("借出日期,格式为:月/日/年如:12/1/2011", "请输入", 0) n = "select * from 借出表where 借出日期= '" & JCRQ & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCZCX_Click()Frame2.Caption = "借出信息"Dim ZB As String精心整理ZB = "select * from 借出表"mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubPrivate Sub JSHRCHX_Click()Frame2.Caption = "归还信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 归还表where 经手人= '" & JSHR & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JSHRCX_Click()Frame2.Caption = "借出信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 借出表where 经手人= '" & JSHR & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub PMCX_Click()Frame2.Caption = "库存信息"Dim pm As StringDim n As Stringpm = InputBox("产品名", "请输入", 0)n = "select * from 库存表where 品名= '" & pm & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid0End SubPrivate Sub RKCZ_Click()'Form2.HideForm5.ShowEnd SubPrivate Sub RKJSHR_Click()Frame2.Caption = "入库信息"Dim JSHR As StringDim n As StringJSHR = InputBox("经手人", "请输入", 0)n = "select * from 入库表where 经手人= '" & JSHR & "'" mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub RKPMCHX_Click()Frame2.Caption = "入库信息"Dim pm As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Thenn = "select * from 入库表where 型号= '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid1End SubPrivate Sub RKZCX_Click()Frame2.Caption = "入库信息"Dim ZB As StringZB = "select * from 入库表"mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid1End SubPrivate Sub Timer1_Timer()If Label4.Left + Label4.Width > 0 Then '当标签右边位置大于0时,标签向左移Label4.Move Label4.Left - 80Else '否则标签从头开始Label4.Left = Form2.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form2.ScaleWidthEnd IfIf Label6.Left + Label6.Width > 0 ThenLabel6.Move Label6.Left - 80ElseLabel6.Left = Form2.ScaleWidthEnd IfIf Label7.Left + Label7.Width > 0 ThenLabel7.Move Label7.Left - 80ElseLabel7.Left = Form2.ScaleWidthEnd IfEnd SubPrivate Sub XGMM_Click()'Form2.HideForm4.ShowEnd SubPrivate Sub XHCX_Click()Frame2.Caption = "库存信息"Dim XH As StringDim n As StringXH = InputBox("产品型号", "请输入", 0)If Len(XH) > 0 Then 'And Val(XH) <> 0n = "select * from 库存表where 型号= '" & XH & "'"mandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid0End SubPrivate Sub ZB_Click()Frame2.Caption = "库存信息"Dim ZB As String'Dim N As String'PM = InputBox("产品名", "请输入", 0)ZB = "select * from 库存表" 'where 品名= '" & PM & "'" mandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid0'.Columns(0).Caption = "学号"' .Columns(1).Caption = "课程名"'.Columns(2).Caption = "学分"' .Columns(3).Caption = "成绩"'设置DtgCond的列宽.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 800.Columns(6).Width = 1000.Columns(7).Width = 800.Columns(8).Width = 4000End WithEnd Sub用户重新登录界面代码:Private Sub Command1_Click()Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text) '检测用户名是否存在strSelect = "select 密码from 用户登录信息表where 用户名= '" & strSno & "'"mandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshMsgBox "用户名不存在,请重新输入!", , "登录提示信息:"Text1.Text = ""Text2.Text = ""Text1.SetFocusExit SubEnd IfUnload MeForm2.Show'MsgBox "登陆成功!", , "登录提示信息:"ElseMsgBox "密码不正确,请重新输入!", , "登录提示信息:"Text2.Text = ""Text2.SetFocusEnd IfEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub修改用户密码界面代码:Private Sub Command1_Click()If Trim(Text1.Text) <> Form2.TextUserName ThenMsgBox "用户名不正确,请确认!", , "信息提示!"Text1.Text = ""Text1.SetFocusExit SubElseDim name As StringDim names As Stringname = Trim(Text1.Text)names = "select * from 用户登录信息表where 用户名='" & name & "'"mandType = adCmdTextAdodc1.RecordSource = namesAdodc1.RefreshExit SubElseMsgBox ("密码修改成功!")Unload Me'Form2.ShowEnd IfEnd IfEnd SubPrivate Sub Command2_Click()Unload Me'Form2.ShowEnd Sub入库管理代码:Private Sub Command1_Click()If Text1.Text = "" And Text2.Text = "" ThenMsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubText1.SetFocusElseIf Text3.Text = "" And Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text3.SetFocusExit SubEnd IfIf Text5.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text5.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Text1.Text)n = Val(Text3.Text)pms = "select * from 库存表where 品名='" & pm & "'"With Form2End WithElseEnd IfEnd IfDim X As IntegerX = MsgBox("产品入库登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload Me'Form2.ShowElseText1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""Text6.Text = ""Text7.Text = ""Text1.SetFocusEnd IfDim ZB As StringZB = "select * from 入库表" 'where 品名= '" & PM & "'" End SubPrivate Sub Command2_Click()Text1.Text = ""End SubEnd Sub代码:ElseExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Combo1.Text)n = Val(Text1.Text)pms = "select * from 库存表where 品名='" & pm & "'"End IfDim X As IntegerX = MsgBox("产品出库登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload Me'Form2.ShowEnd IfCombo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Dim ZB As StringZB = "select * from 出库表" 'where 品名= '" & PM & "'"End SubPrivate Sub Command2_Click()Combo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd SubPrivate Sub Form_Load()Adodc2.RefreshLoopEnd Sub借出管理代码:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" Then MsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"End IfEnd IfEnd IfText4.Text = ""Dim ZB As StringZB = "select * from 借出表" 'where 品名= '" & PM & "'"End SubPrivate Sub Command2_Click()Combo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = "". . .. . . Text3.Text = ""Text4.Text = ""End SubPrivate Sub Command3_Click()Unload MeForm2.ShowEnd SubPrivate Sub Form_Load()Adodc2.RefreshLoopEnd Sub归还管理代码:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" Then MsgBox "“品名”和“型号”不能同时为空,必须输入其中一项!", , "提示信息!"Exit SubElseIf Text1.Text = "" And Combo3.Text = "" Then ' Text4.Text = "" ThenMsgBox "请输入产品“数量”或“单位”之一!", , "提示信息!"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请经手人签名!", vbCritical, "提示信息!"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入归还人姓名!", vbCritical, "提示信息!"Text3.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Combo1.Text)n = Val(Text1.Text)pms = "select * from 库存表where 品名='" & pm & "'"End If. 专业专注.精心整理精心整理Dim X As IntegerX = MsgBox("产品归还登记成功,是否继续添加产品!", vbYesNo + vbQuestion + vbDefaultButton1, "提示信息!") If X = vbNo ThenUnload MeForm2.ShowEnd IfCombo1.Text = ""Combo2.Text = ""Combo3.Text = ""Text1.Text = ""Text2.Text = ""End SubEnd SubEnd Sub' i = 0' ' LoopEnd SubPrivate Sub pm()Dim i As VariantDim j As VariantDim k As VariantDim a As VariantDim b As VariantDim c As VariantDim s As VariantDim D As Variant. . .. . .i = 0j = 0Adodc2.Refreshi = i + 1LoopD = Split(a, ",")If j < i Thens = D(2)Combo1.AddItem s'k = 0'If k < j And D(k) <> D(j) Then'If D(k) <> D(j) Then' Combo1.AddItem D(j)' k = k + 1' Else' k = k + 1'End If'End Ifj = j + 1End IfText5.Text = s 'a + "," + D(2) + D(1) '+ " " + Val(i) + " " + Val(j) + " " + Val(k)Text6.Text = j'Combo1.AddItem D(1)End Sub. 专业专注.。
库存管理系统软件设计源代码
![库存管理系统软件设计源代码](https://img.taocdn.com/s3/m/e93905cc7f1922791688e83d.png)
using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class AdminServer{public static Admin GetAdminByName(string name){string sql = string.Format("select * from admin where name='{0}'",name);Admin a = null;DataTable dt = Web.DBHelper.GetTable(sql, "admin");foreach (DataRow row in dt.Rows){a = new Admin();a.Id = (int)row["id"]; = (string)row["name"];a.Pass = (string)row["pass"];}return a;}///<summary>///添加///</summary>///<param name="login"></param>///<returns></returns>public static bool Add(string login){string sql = string.Format("insert into Admin values('{0}','{0}')", login);return Web.DBHelper.ExecuteSql(sql);}///<summary>///删除///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){string sql = "delete from Admin where id=" + id;return Web.DBHelper.ExecuteSql(sql);}///<summary>///获取所有用户信息///</summary>///<returns></returns>public static DataTable Get(){string sql = "select * from admin";return Web.DBHelper.GetTable(sql, "admin");}///<summary>///修改密码///</summary>///<param name="pass"></param>///<param name="id"></param>///<returns></returns>public static bool EditPass(string pass, int id){string sql = string.Format("update Admin set pass='{0}' where id={1}", pass, id);return Web.DBHelper.ExecuteSql(sql);}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class ChuServer{///<summary>///装箱///</summary>///<param name="row"></param>///<returns></returns>static Chu Get(DataRow row){Chu c = new Chu();c.Buy = (string)row["buy"];c.Id = (int)row["id"];c.Num = (int)row["num"];c.People = PeopleServer.GetByID((int)row["people_ID"]);c.Price = (double)row["price"];c.Thing = ThingServer.GetByID((int)row["thing_ID"]);c.Intime = (DateTime)row["intime"];return c;}///<summary>///获取所有出库记录///</summary>///<param name="key"></param>///<param name="chuType"></param>///<returns></returns>public static List<Chu> Get(string key,int chuType,int startindex,int pagesize){string sql = string.Format("select * from chu_View where chutype={0} {1} order by id desc",chuType,key);List<Chu> cs = new List<Chu>();DataTable dt = Web.DBHelper.GetTable(sql, startindex, pagesize, "chu");foreach (DataRow row in dt.Rows)cs.Add(Get(row));return cs;}///<summary>///查询出库的数量///</summary>///<param name="key"></param>///<param name="chuType"></param>///<returns></returns>public static int GetCount(string key, int chuType){string sql = string.Format("select count(*) from chu_View where chutype={0} {1}'", chuType, key);return Convert.ToInt32(Web.DBHelper.GetScalar(sql));}///<summary>///添加出库记录///</summary>///<param name="c"></param>///<returns></returns>public static bool Add(Chu c){string sql = string.Format("insert into chuvalues('{0}',{1},{2},{3},{4},'{5}',{6})", c.Buy, c.People.Id, c.Thing.Id, c.Num, c.Price, DateTime.Now,c.ChuType);return Web.DBHelper.ExecuteSql(sql);}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;using Web;namespace S.DAL{public class ExitServer{///<summary>///添加退货入库记录///<param name="e"></param>///<param name="thingID"></param>///<param name="peopeleID"></param>///<returns></returns>public static bool Add(Exit e){string sql = string.Format("insert [Exit]values({0},{1},getdate(),'{2}',{3})",e.Thing.Id, e.Num, e.Because, e.People.Id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static Exit Get(DataRow row){Exit e = new Exit();e.Because = (string)row["Because"];e.Id = (int)row["ID"];e.InTime = (DateTime)row["InTIme"];e.Num = (int)row["Num"];e.People = PeopleServer.GetByID((int)row["People_ID"]);e.Thing = ThingServer.GetByID((int)row["Thing_ID"]);return e;}///<summary>///获取所有退款入库记录///<param name="startindex"></param>///<param name="pagesize"></param>///<param name="key"></param>///<returns></returns>public static List<Exit> Get(int startindex, int pagesize, string key){string sql = string.Format("select * from Exit_View where name like '%{0}%' order by id desc", key);DataTable dt = Web.DBHelper.GetTable(sql, startindex, pagesize, "Exit");List<Exit> e = new List<Exit>();foreach (DataRow row in dt.Rows)e.Add(Get(row));return e;}///<summary>///获取所有退款入库的数量///</summary>///<param name="key"></param>///<returns></returns>public static int GetCount(string key){string sql = string.Format("select count(*) from Exit_View where name like '%{0}%'", key);return Convert.ToInt32(Web.DBHelper.GetScalar(sql));}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class JinServer{///<summary>///添加进货///</summary>///<param name="j"></param>///<returns></returns>public static bool Add(Jin j){string sql = string.Format("insert into jinvalues({0},{1},{2},{3},'{4}',{5},'{6}')", j.Mfg.Id, j.People.Id, j.Thing.Id, j.Num,DateTime.Now,j.Price,j.CaiGou);return Web.DBHelper.ExecuteSql(sql);}///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static Jin Get(DataRow row){Jin j = new Jin();j.Id = (int)row["id"];j.Mfg = MFGServer.GetByID((int)row["mfg_ID"]);j.Num = (int)row["num"];j.People = PeopleServer.GetByID((int)row["people_ID"]);j.Thing = ThingServer.GetByID((int)row["thing_ID"]);j.Intime = (DateTime)row["intime"];j.Price = (double)row["price"];j.CaiGou = (string)row["CaiGou"];return j;}///<summary>///获取所有进货记录///</summary>///<param name="key"></param>///<param name="startindex"></param>///<param name="pagesize"></param>///<returns></returns>public static List<Jin> Get(string key,int startindex,int pagesize){string sql = string.Format("select * from jin_View {0} order by id desc",key);List<Jin> js = new List<Jin>();DataTable dt = Web.DBHelper.GetTable(sql, "jin");foreach (DataRow row in dt.Rows)js.Add(Get(row));return js;}///<summary>///获取数量///</summary>///<param name="key"></param>///<returns></returns>public static int GetCount(string key){string sql = string.Format("select count(*) from jin_View {0}", key);return Convert.ToInt32(Web.DBHelper.GetScalar(sql));}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class MFGServer{///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static MFG Get(DataRow row){MFG m = new MFG();m.Address = (string)row["address"];m.Id = (int)row["id"]; = (string)row["name"];m.People = (string)row["people"];m.Tel = (string)row["tel"];return m;}///<summary>///获取所有厂商///</summary>///<returns></returns>public static List<MFG> Get(){string sql = "select * from MFG";List<MFG> ms = new List<MFG>();DataTable dt = Web.DBHelper.GetTable(sql, "mfg");foreach (DataRow row in dt.Rows)ms.Add(Get(row));return ms;}///<summary>///获取明细///</summary>///<param name="id"></param>///<returns></returns>public static MFG GetByID(int id){string sql = string.Format("select * from MFG where id={0}",id);DataTable dt = Web.DBHelper.GetTable(sql, "mfg");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}///<summary>///修改///</summary>///<param name="m"></param>///<returns></returns>public static bool Edit(MFG m){string sql = string.Format("update mfg setaddress='{0}',name='{1}',people='{2}',tel='{3}' where id={4}",m.Address,,m.People,m.Tel,m.Id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///添加厂商///</summary>///<param name="m"></param>///<returns></returns>public static bool Add(MFG m){string sql = string.Format("insert into mfgvalues('{0}','{1}','{2}','{3}')", , m.People, m.Tel, m.Address);return Web.DBHelper.ExecuteSql(sql);}///<summary>///删除厂商///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){string sql = string.Format("delete from mfg where id={0}",id);return Web.DBHelper.ExecuteSql(sql);}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class PeopleServer{///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static People Get(DataRow row){People p = new People();p.Address = (string)row["address"]; p.Age = (int)row["age"];p.Id = (int)row["id"];p.Tel = (string)row["tel"]; = (string)row["name"];return p;}///<summary>///获取所有人员///</summary>///<returns></returns>public static List<People> Get(){string sql = "select * from people";List<People> ps = new List<People>();DataTable dt = Web.DBHelper.GetTable(sql, "people");foreach (DataRow row in dt.Rows)ps.Add(Get(row));return ps;}///<summary>///添加人员///</summary>///<param name="p"></param>///<returns></returns>public static bool Add(People p){string sql = string.Format("insert into peoplevalues('{0}',{1},'{2}','{3}')", , p.Age, p.Tel, p.Address);return Web.DBHelper.ExecuteSql(sql);}///<summary>///修改人员信息///</summary>///<param name="p"></param>///<returns></returns>public static bool Edit(People p){string sql = string.Format("update people setname='{0}',age={1},tel='{2}',address='{3}' where id={4}", , p.Age, p.Tel,p.Address, p.Id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///删除人员///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){string sql = string.Format("delete from people where id={0}",id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///获取明细///</summary>///<param name="id"></param>///<returns></returns>public static People GetByID(int id){string sql = string.Format("select * from people where id={0}",id);DataTable dt = Web.DBHelper.GetTable(sql, "people");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}}}using System;using System.Collections.Generic;using System.Text;using S.Model;using System.Data;namespace S.DAL{public class StockServer{///<summary>///添加库存物品///</summary>///<param name="thingID"></param>///<param name="wearhouseID"></param>///<returns></returns>public static bool Add(int thingID, int wearhouseID){string sql = string.Format("insert Stocks values({0},{1},0)", thingID, wearhouseID);return Web.DBHelper.ExecuteSql(sql);}///<summary>///修改库存数量///</summary>///<param name="thingID"></param>///<param name="wareHouseID"></param>///<param name="num"></param>///<param name="str"></param>///<returns></returns>public static bool EditNum(int thingID, int wareHouseID, int num, string str) {string sql = string.Format("update Stocks set Num=Num{0}{1} whereThing_ID={2} and WareHouse_ID={3}", str, num, thingID, wareHouseID);return Web.DBHelper.ExecuteSql(sql);}///<summary>///修改库存数量///</summary>///<param name="thingID"></param>///<param name="wareHouseID"></param>///<param name="num"></param>///<param name="str"></param>///<returns></returns>public static bool EditNum(int thingID, int wareHouseID, int num){string sql = string.Format("update Stocks set Num={0} where Thing_ID={1} and WareHouse_ID={2}", num, thingID, wareHouseID);return Web.DBHelper.ExecuteSql(sql);}///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static Stocks Get(DataRow row){Stocks s = new Stocks();s.Num = (int)row["Num"];s.Thing = ThingServer.GetByID((int)row["Thing_ID"]);s.Ware = WareHouseServer.GetByID((int)row["WareHouse_ID"]);return s;}///<summary>///获取所有获存///</summary>///<param name="wareHouseID">仓库编号</param>///<param name="key">and开</param>///<returns></returns>public static List<Stocks> Get(int wareHouseID, string key){string sql = string.Format("select * from Stock_View where WareHouse_ID={0} {1}", wareHouseID, key);DataTable dt=Web.DBHelper.GetTable(sql,"Stocks");List<Stocks> ss=new List<Stocks> ();foreach (DataRow row in dt.Rows)ss.Add(Get(row));return ss;}///<summary>///获取数量///</summary>///<param name="wareHouseID"></param>///<param name="thingID"></param>///<returns></returns>public static Stocks Get(int wareHouseID, int thingID){string sql = string.Format("select * from Stocks where WareHouse_ID={0} and Thing_ID={1}", wareHouseID, thingID);DataTable dt = Web.DBHelper.GetTable(sql, "Stocks");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class ThingServer{///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static Thing Get(DataRow row){Thing t = new Thing();t.Id = (int)row["id"]; = (string)row["name"];t.Type = ThingTypeServer.GetByID((int)row["ThingType_ID"]); t.GuiGe = (string)row["GuiGe"];return t;}///<summary>///获取所有物品///</summary>///<param name="key"></param>///<returns></returns>public static List<Thing> Get(string key){string sql = string.Format("select * from thing where name like '%{0}%' order by id desc",key);List<Thing> ts = new List<Thing>();DataTable dt = Web.DBHelper.GetTable(sql, "thing");foreach (DataRow row in dt.Rows)ts.Add(Get(row));return ts;}///<summary>///获取所有物品///</summary>///<param name="key"></param>///<returns></returns>public static List<Thing> GetByType(int type){string sql = string.Format("select * from thing where thingType_ID={0} order by id desc", type);List<Thing> ts = new List<Thing>();DataTable dt = Web.DBHelper.GetTable(sql, "thing");foreach (DataRow row in dt.Rows)ts.Add(Get(row));return ts;}///<summary>///添加商品信息///</summary>///<param name="t"></param>///<param name="thingID"></param>///<returns></returns>public static bool Add(Thing t, int thingtype){string sql = string.Format("insert into thing values('{0}','{1}',{2}); select @@identity", t.GuiGe, , thingtype);int id=Convert.ToInt32( Web.DBHelper.GetScalar(sql));if (id > 0){List<WareHouse> whs = WareHouseServer.Get();foreach (WareHouse w in whs)StockServer.Add(id, w.Id);return true;}return false;}///<summary>///修改商品信息///</summary>///<param name="t"></param>///<param name="thingID"></param>///<returns></returns>public static bool Edit(Thing t, int thingtype){string sql = string.Format("update thing setname='{0}',ThingType_ID={1},guige='{2}' where id={3}", , thingtype, t.GuiGe, t.Id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///删除商品信息///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){string sql = string.Format("delete from Thing where id={0}", id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///获取商品明细///</summary>///<param name="id"></param>///<returns></returns>public static Thing GetByID(int id){string sql = string.Format("select * from thing where id={0}",id);DataTable dt = Web.DBHelper.GetTable(sql, "thing");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}}}using System;using System.Collections.Generic;using System.Text;using S.Model;using System.Data;using System.Data.SqlClient;namespace S.DAL{public class ThingTypeServer{static ThingType Get(DataRow row){ThingType t = new ThingType();t.Id = (int)row["id"];t.Type = (string)row["type"];return t;}///<summary>///获取所有类别///</summary>///<returns></returns>public static List<ThingType> Get(){string sql = "select * from thingtype";List<ThingType> ts = new List<ThingType>();DataTable dt = Web.DBHelper.GetTable(sql, "thingtype");foreach (DataRow row in dt.Rows)ts.Add(Get(row));return ts;}///<summary>///获取类别祥细///</summary>///<param name="id"></param>///<returns></returns>public static ThingType GetByID(int id){string sql = string.Format("select * from thingtype where id={0}",id);DataTable dt = Web.DBHelper.GetTable(sql, "thingtype");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}}}using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using S.Model;namespace S.DAL{public class WareHouseServer{///<summary>///添加仓库///</summary>///<param name="wh"></param>///<returns></returns>public static bool Add(WareHouse wh){string sql = string.Format("insert WareHouse values('{0}',{1}); select @@identity", wh.Text, wh.Type);int id = Convert.ToInt32(Web.DBHelper.GetScalar(sql));if (id > 0){List<Thing> ts = ThingServer.Get(string.Empty);foreach (Thing t in ts)StockServer.Add(t.Id, id);return true;}return false;}///<summary>///修改仓库信息///</summary>///<param name="wh"></param>///<returns></returns>public static bool Edit(WareHouse wh){string sql = string.Format("update WareHouse set text='{0}',type={1} where id={2}",wh.Text, wh.Type, wh.Id);return Web.DBHelper.ExecuteSql(sql);}///<summary>///封装///</summary>///<param name="row"></param>///<returns></returns>static WareHouse Get(DataRow row){WareHouse wh = new WareHouse();wh.Id = (int)row["ID"];wh.Text = (string)row["Text"];wh.Type = (int)row["Type"];return wh;}///<summary>///查询所有仓库信息///</summary>///<returns></returns>public static List<WareHouse> Get(){string sql = "select * from WareHouse";List<WareHouse> wh = new List<WareHouse>();DataTable dt = Web.DBHelper.GetTable(sql, "WareHouse");foreach (DataRow row in dt.Rows)wh.Add(Get(row));return wh;}///<summary>///查看仓库祥细信息///</summary>///<param name="id"></param>///<returns></returns>public static WareHouse GetByID(int id){string sql = "select * from WareHouse where id=" + id;DataTable dt = Web.DBHelper.GetTable(sql, "WareHouse");if (dt.Rows.Count > 0)return Get(dt.Rows[0]);return null;}///<summary>///删除仓库信息///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){string sql = "delete from WareHouse where id=" + id;return Web.DBHelper.ExecuteSql(sql);}}}using System;using System.Collections.Generic;using System.Text;using S.DAL;using S.Model;using System.Data;namespace S.BLL{public class AdminMananger{public static Admin GetAdminByName(string name){return AdminServer.GetAdminByName(name);}///<summary>///添加///</summary>///<param name="login"></param>///<returns></returns>public static bool Add(string login) {return AdminServer.Add(login); }///<summary>///删除///</summary>///<param name="id"></param>///<returns></returns>public static bool Del(int id){return AdminServer.Del(id);}///<summary>///回去所有用户信息///</summary>///<returns></returns>public static DataTable Get(){return AdminServer.Get();}///<summary>///修改密码///</summary>///<param name="pass"></param>///<param name="id"></param>///<returns></returns>public static bool EditPass(string pass, int id){return AdminServer.EditPass(pass, id);}}}using System;using System.Collections.Generic;using System.Text;using S.Model;using S.DAL;namespace S.BLL{public class ChuMananger{///<summary>///获取所有出库记录///</summary>///<param name="key"></param>///<param name="chuType"></param>///<returns></returns>public static List<Chu> Get(string key, int chuType, int startindex, int pagesize){return ChuServer.Get(key, chuType, startindex, pagesize);}///<summary>///查询出库的数量///</summary>///<param name="key"></param>///<param name="chuType"></param>///<returns></returns>public static int GetCount(string key, int chuType) {return ChuServer.GetCount(key, chuType);}///<summary>///添加出库记录///</summary>///<param name="c"></param>///<returns></returns>public static bool Add(Chu c){return ChuServer.Add(c);}}}using System;using System.Collections.Generic;using System.Text;using S.Model;using S.DAL;namespace S.BLL{public class ExitManager{///<summary>///添加退货入库记录///</summary>///<param name="e"></param>///<param name="thingID"></param>///<param name="peopeleID"></param>///<returns></returns>public static bool Add(Exit e){return ExitServer.Add(e);}///<summary>///获取所有退款入库记录///</summary>///<param name="startindex"></param>///<param name="pagesize"></param>///<param name="key"></param>///<returns></returns>public static List<Exit> Get(int startindex, int pagesize, string key) {return ExitServer.Get(startindex, pagesize, key);}///<summary>///获取所有退款入库的数量///</summary>///<param name="key"></param>///<returns></returns>public static int GetCount(string key){return ExitServer.GetCount(key);}}}using System;。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
仓库管理系统源代码#include#include#include#include#includestruct cangku{int num;char name[20];char introdution[50];float square;};typedef struct cangku Cangku;int Input(Cangku t[]);void List(Cangku t[],int n); void SearchOnName(Cangku t[],int n);int DeleteRecord(Cangku t[],int n); int AlterRecord(Cangku t[],int n); int AddRecord(Cangku t[],int n); void SortOnName(Cangku t[],int n); void SortOnSquare(Cangku t[],int n); void SaveRecord(Cangku t[],int n); int LoadRecord(Cangku t[]); int LoadRecord1(Cangku t[]); void Save(Cangkut[],int n); void Load(Cangku t[],int n); void Load1(Cangku t[]);int Menu_select();void main(){Cangku ck[50];int i,l,length,w=1;int q[4]={5,2,1,0};system("cls");printf("请输入第1个密码:\n");for (i=0;i<4;i++){scanf("%d",&l);system("cls");if(l==q[i])printf("正确,继续输入第%d个密码:.\n",i+2); else{w=0;printf ("输入错误!\n");break;}}while(w){switch(Menu_select()){case 1: length=Input(ck);SaveRecord(ck,length);break;case 2: length=LoadRecord(ck); SearchOnName(ck,length); break;case 3: length=LoadRecord(ck); length=DeleteRecord(ck,length); SaveRecord(ck,length);break;case 4: length=LoadRecord(ck); length=AlterRecord(ck,length); SaveRecord(ck,length);break;case 5: length=LoadRecord(ck); length=AddRecord(ck,length); SaveRecord(ck,length);break;case 6: length=LoadRecord(ck); system("cls");List(ck,length);break;case 7: length=LoadRecord(ck); system("cls");SortOnName(ck,length);SaveRecord(ck,length);break;case 8: length=LoadRecord(ck); system("cls");SortOnSquare(ck,length);SaveRecord(ck,length);break;case 9: length=LoadRecord(ck); system("cls");Save(ck,length);break;case 0: length=LoadRecord1(ck);Load1(ck);system("cls");Load(ck,length);break;case 10: exit(0);}}}int Menu_select(){int c;printf("按任意键进入仓库管理菜单\n");getchar();system("cls");system("color F0");printf(" ******************************仓库管理*******************************\n");printf(" * 1. 录入仓库初始记录 *\n");printf(" * 2. 按仓库名称查找记录 *\n");printf(" * 3. 删除仓库记录 *\n");printf(" * 4. 修改仓库记录 *\n");printf(" * 5. 增加仓库信息 *\n");printf(" * 6. 显示全部记录 *\n");printf(" * 7. 按仓库名称排序*\n");printf(" * 8. 按仓库面积排序*\n");printf(" * 9. 备份*\n");printf(" * 0. 恢复*\n");printf(" * 10. 退出*\n");printf("******************************************************************** *\n");do{printf("\n输入您想要进行的操作选项键(0-10):"); if(scanf("%d",&c)!=1){while(getchar()!='\n')continue;}}while(c<0||c>10);return c;}int Input(Cangku t[]){int i,n;system("cls");printf("\n请输入要输入的仓库数目:\n");scanf("%d",&n);printf("开始输入仓库信息:\n");for(i=0;i<n;i++){system("cls");printf("\n第%d个仓库的编号:",i+1);scanf ("%d",&t[i].num);printf("第%d个仓库的名称:",i+1);scanf ("%s",t[i].name);printf("第%d个仓库的面积:",i+1);scanf ("%f",&t[i].square);printf("第%d个仓库的说明:",i+1);scanf ("%s",t[i].introdution); }return (n);}void List(Cangku t[],int n){int i;printf("******************************************************************** *\n");printf(" ** 编号名称面积说明\n");printf("---------------------------------------------------------------------\n");for(i=0;i<n;i++){printf("%17d%13s%20f%14s\n",t[i].num,t[i].name,t[i].square,t[i].intr odution);}printf("******************************************************************** *\n");printf ("\n");getchar();}void SearchOnName(Cangku t[],int n) {char s[20];int i,flag=0;system("cls");printf("请输入要查找的仓库名称:\n");scanf("%s",s);for(i=0;i<n;i++){if(strcmp(s,t[i].name)==0){flag=1;system("cls");printf("\n\n要查找的仓库信息如下:\n");printf("\n");printf("******************************************************************** *\n");printf(" ** 编号名称面积说明\n");printf("---------------------------------------------------------------------\n");{printf("%17d%13s%20f%14s\n",t[i].num,t[i].name,t[i].square,t[i].intr odution);}printf("******************************************************************** *\n");printf ("\n");}}if(flag==0)printf("要查找的仓库不存在!!\n");getchar();}int DeleteRecord(Cangku t[],int n){char s[20];char ch;int i,j,flag=0;system("cls");printf("请输入要删除的仓库名称\n");scanf("%s",s);for(i=0;i<n;i++){if(strcmp(s,t[i].name)==0){flag=1;system("cls");printf("\n\n要删除的仓库信息如下:\n");printf("\n");printf("******************************************************************** *\n");printf(" ** 编号名称面积说明\n");printf("---------------------------------------------------------------------\n");{printf("%17d%13s%20f%14s\n",t[i].num,t[i].name,t[i].square,t[i].intr odution);}printf("******************************************************************** *\n");printf ("\n");printf("确定删除仓库信息吗?(Y/N)\n"); ch=getchar();ch=getchar();if(ch=='Y'||ch=='y'){for(j=i;j<n-1;j++)t[j]=t[j+1];n--;i--;printf ("删除成功.\n");}}}if(flag==0)printf("要删除的仓库不存在!!\n"); getchar();return n;}int AlterRecord(Cangku t[],int n) { int i,flag=0;char s[20],ch;system("cls");printf("请输入要修改的仓库名称\n");scanf("%s",s);for(i=0;i<n;i++){if(strcmp(s,t[i].name)==0){flag=1;system("cls");printf("\n\n要修改的仓库信息如下:\n");printf("\n");printf("*********************************************************************\n" );printf(" ** 编号名称面积说明\n");printf(" ---------------------------------------------------------------------\n");{printf("%17d%13s%20f%14s\n",t[i].num,t[i].name,t[i].square,t[i].intr odution);}printf("******************************************************************** *\n");printf ("\n");printf("确定修改仓库信息吗,(Y/N)\n");ch=getchar();ch=getchar();if(ch=='y'||ch=='Y'){system("cls");printf("请输入修改后的信息:\n");printf("请输入仓库新的名称:");scanf("%s",t[i].name);printf("请输入%s仓库新的编号:",t[i].name); scanf("%d",&t[i].num);printf("请输入%s仓库新的面积:",t[i].name); scanf("%f",&t[i].square);printf("请输入%s仓库新的说明:",t[i].name); scanf("%s",t[i].introdution);}}}if(flag==0)printf("要修改的仓库不存在~~\n"); getchar();return n;}int AddRecord(Cangku t[],int n) {int i,m;system("cls");printf("\n请输入再增加的记录数:\n"); scanf("%d",&m);printf("开始追加记录\n");for(i=n;i<n+m;i++){ system("cls");printf("\n第%d个仓库的编号:",i+1); scanf("%d",&t[i].num);printf("第%d个仓库的名称:",i+1); scanf("%s",t[i].name);printf("第%d个仓库的面积:",i+1); scanf("%f",&t[i].square);printf("第%d个仓库的说明:",i+1); scanf("%s",t[i].introdution);}return (n+m);}void SortOnName(Cangku t[],int n) {int i,j;struct cangku temp ;for(j=1;j<n;j++)for(i=0;i<n-j;i++)if((strcmp(t[i].name,t[i+1].name))>0) {temp=t[i];t[i]=t[i+1];t[i+1]=temp;}printf("排序成功!!!\n");printf("排序后仓库信息列表如下:\n"); List(t,n);}void SortOnSquare(Cangku t[],int n) {int i,j;struct cangku temp ;for(j=1;j<n;j++)for(i=0;i<n-j;i++)if(t[i].square<t[i+1].square){temp=t[i];t[i]=t[i+1];t[i+1]=temp;}printf("排序成功!!!\n");printf("排序后仓库信息列表如下:\n");List(t,n);}void SaveRecord(Cangku t[],int n) {int i;FILE *fp;if((fp=fopen("record.txt","w"))==NULL) {printf("不能打开文件!\n");exit(1);}for(i=0;i<n;i++){fwrite(&t[i],sizeof(struct cangku),1,fp); }fclose(fp);}int LoadRecord(Cangku t[]){int n=0;FILE *fp;if((fp=fopen("record.txt","a+"))==NULL) {printf("不能打开文件!\n");exit(1);}while(fread(&t[n],sizeof(struct cangku),1,fp)) n++; fclose(fp);printf("从文件中成功读出记录!!!\n");return n;}int LoadRecord1(Cangku t[]) {int n=0;FILE *fp;if((fp=fopen("bkrecord.txt","a+"))==NULL){printf("不能打开文件!\n");exit(1);}while(fread(&t[n],sizeof(struct cangku),1,fp)) n++; fclose(fp);printf("从文件中成功读出记录!!!\n");return n;}void Save(Cangku t[],int n) {int i;FILE *fp;if((fp=fopen("bkrecord.txt","w"))==NULL){printf("不能打开文件!\n");exit(1);}for(i=0;i<n;i++){fwrite(&t[i],sizeof(struct cangku),1,fp);}fclose(fp);printf("备份成功.\n");getchar();}void Load1(Cangku t[]) {int n=0;FILE *fp;if((fp=fopen("bkrecord.txt","a+"))==NULL){printf("不能打开文件!\n");exit(1);}while(fread(&t[n],sizeof(struct cangku),1,fp)) n++; fclose(fp);getchar();}void Load(Cangku t[],int n) {int i;FILE *fp;if((fp=fopen("record.txt","w"))==NULL) {printf("不能打开文件!\n");exit(1);}for(i=0;i<n;i++){fwrite(&t[i],sizeof(struct cangku),1,fp); }fclose(fp);printf("恢复成功.\n");}。