管理物品采购管理系统源代码.docx

上传人:b****7 文档编号:11472803 上传时间:2023-03-01 格式:DOCX 页数:11 大小:22.02KB
下载 相关 举报
管理物品采购管理系统源代码.docx_第1页
第1页 / 共11页
管理物品采购管理系统源代码.docx_第2页
第2页 / 共11页
管理物品采购管理系统源代码.docx_第3页
第3页 / 共11页
管理物品采购管理系统源代码.docx_第4页
第4页 / 共11页
管理物品采购管理系统源代码.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

管理物品采购管理系统源代码.docx

《管理物品采购管理系统源代码.docx》由会员分享,可在线阅读,更多相关《管理物品采购管理系统源代码.docx(11页珍藏版)》请在冰豆网上搜索。

管理物品采购管理系统源代码.docx

管理物品采购管理系统源代码

[管理]物品采购管理系统源代码

数据库原理与应用课程设计

设计题目:

物品采购管理

院系:

信息工程学院

班级:

组别:

组长:

组员:

起止日期:

指导教师:

源代码:

物品添加模块程序代码

修改用户密码程序

PrivateSubCommand1_Click()

Adodc1.RecordSource=frmLogin.Adodc1.RecordSource

Adodc1.Refresh

SetText4.DataSource=Adodc1

Text4.DataField="密码"

IfText1=""Then

MsgBox"请输入原密码~",,"修改密码"

ExitSub

ElseIfText1.Text<>Adodc1.Recordset.Fields("密码")Then

MsgBox"原密码错误~",,"修改密码"

ExitSub

ElseIfText2=""OrText3=""Then

MsgBox"请输入新密码~~",,"修改密码"

ExitSub

ElseIfText2<>Text3Then

MsgBox"密码不一致~~",,"修改密码"

ExitSub

Else

Text4.Text=Text2.Text

Adodc1.Recordset.MoveFirst

MsgBox"密码修改成功~~",,"修改密码"

UnloadMe

EndIf

EndSub

5..2.3入库模块的实现

PrivateSubCommand1_Click()设备入库程序

DimI,JAsInteger

DimSTRAsString

IfText1.Text=""OrText2=""OrCombo1.Text=""OrText4=""OrText5=""Or

Text6=""OrText7=""Then

MsgBox"请输入完整信息~"

ExitSub

Else将记录存入入库记录表

设备入库表.datPrimaryRS.Recordset.Fields("设备号")=Text1.Text

设备入库表.datPrimaryRS.Recordset.Fields("入库数量")=Text2.Text

设备入库表.datPrimaryRS.Recordset.Fields("入库时间")=Combo1.Text

设备入库表.datPrimaryRS.Recordset.Fields("供应商")=Text4.Text

设备入库表.datPrimaryRS.Recordset.Fields("供应商电话")=Text5.Text

设备入库表.datPrimaryRS.Recordset.Fields("价格")=Text6.Text

设备入库表.datPrimaryRS.Recordset.Fields("采购员")=Text7.Text

MsgBox"已经成功入库~"

EndIf

设备入库表.Adodc1.RecordSource="select*from现有库存表where设备号='"&Text1.Text&"'"

设备入库表.Adodc1.Refresh

设备入库表.DataGrid1.Refresh

If设备入库表.Adodc1.Recordset.RecordCount>0Then

将记录加入现有库存表中

设备入库表.Text9.Text=CInt(设备入库表.Text9.Text)+CInt(Text2.Text)

设备入库表.Text9.Refresh

J=设备入库表.Text9

设备入库表.Adodc1.Recordset.MoveFirst

设备入库表.Adodc1.Recordset.Fields.Refresh

设备入库表.DataGrid1.Refresh

MsgBox"现有库存量为:

"&J

Else

STR="现有库存表中无此设备~"&vbCrLf&"请在设备代码表和现有库存表中手动添加记录~~"

MsgBoxSTR

Loadfrm现有库存表

frm现有库存表.Show

Callfrm现有库存表.Command1_Click

FrmAddNewEqu.Text1.Text=frmInput.Text1.Text

FrmAddNewEqu.Text2.Text=frmInput.Text2.Text

Loadfrm设备代码表

frm设备代码表.Show

EndIf

EndSub

PrivateSubcmdDelete_Click()删除入库表中记录

OnErrorGoToDeleteErr

DimYesNoAsString

YesNo=MsgBox("删除",vbYesNo,"删除记录")

IfYesNo=vbYesThen

WithdatPrimaryRS.Recordset

.Delete

.MoveNext

If.EOFThen.MoveLast

EndWith

Else

ExitSub

EndIf

DeleteErr:

MsgBoxErr.Description

EndSub

PrivateSubcmdUpdate_Click()更新纪录程序

OnErrorGoToUpdateErr

datPrimaryRS.Recordset.UpdateBatchadAffectAll

ExitSub

UpdateErr:

MsgBoxErr.Description

EndSub

5..2.4出库模块实现

PrivateSubCommand1_Click()设备出库程序

Dimi,J,kAsInteger

DimSTRAsString

frm设备出库表.Adodc1.RecordSource="select*from现有库存表where设备号='"&Text1.Text&"'"

frm设备出库表.Adodc1.Refresh

frm设备出库表.DataGrid1.Refresh

IfIsNumeric(Text2)=FalseThen

MsgBox"数量必须是数字~"

ExitSub

EndIf

IfText1.Text=""OrText2=""OrCombo1.Text=""OrText4=""OrText5=""OrText6=""

OrText7=""Then

MsgBox"请输入完整信息~"

ExitSub

ElseIffrm设备出库表.Adodc1.Recordset.RecordCount<=0Then

STR="现有库存表中无此设备~请检查输入是否正确~~"

MsgBoxSTR

ExitSub

Else

frm设备出库表.datPrimaryRS.Recordset.Fields("设备号")=Text1.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("出库数量")=Text2.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("出库时间")=Combo1.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("经手人")=Text4.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("领取人")=Text5.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("使用部门")=Text6.Text

frm设备出库表.datPrimaryRS.Recordset.Fields("用途")=Text7.Text

MsgBox"已经成功存入设备出库表库~"

EndIf

Iffrm设备出库表.Adodc1.Recordset.RecordCount>0Then

k=CInt(frm设备出库表.Text9.Text)-CInt(Text2.Text)

Ifk>=0Then

frm设备出库表.Text9.Text=CInt(frm设备出库表.Text9.Text)-CInt(Text2.Text)

frm设备出库表.Text9.Refresh

J=frm设备出库表.Text9

frm设备出库表.Adodc1.Recordset.MoveFirst

frm设备出库表.Adodc1.Recordset.Fields.Refresh

frm设备出库表.DataGrid1.Refresh

MsgBox"现有库存量为:

"&J

Else

MsgBox"现有库存量不足~请输入合适数量~~"

ExitSub

EndIf

Else

STR="现有库存表中无此设备~请检查输入是否正确~~"

MsgBoxSTR

EndIf

EndSub

PrivateSubcmdDelete_Click()删除出库记录

OnErrorGoToDeleteErr

DimYesNoAsString

YesNo=MsgBox("删除",vbYesNo,"删除记录")

IfYesNo=vbYesThen

WithdatPrimaryRS.Recordset

.Delete

.MoveNext

If.EOFThen.MoveLast

EndWith

Else

ExitSub

EndIf

DeleteErr:

MsgBoxErr.Description

EndSub

更新记录程序同入库的更新程序相同,在此略

5.2.5设备采购模块实现,程序略

主要程序

PrivateSubcmdAdd_Click()添加设备

OnErrorGoToAddErr

datPrimaryRS.Recordset.AddNew

ExitSub

AddErr:

MsgBoxErr.DescriptionEndSub

5.2.8库存报警模块实现

主要程序

PrivateSubCommand1_Click()显示高于最大警戒库存的设备

datPrimaryRS.RecordSource="select*from现有库存表where现有库存>最大库存"

datPrimaryRS.Refresh

grdDataGrid.Refresh

IfdatPrimaryRS.Recordset.RecordCount>0Then

Beep

MsgBox"表中设备已过量~"

Else

MsgBox"没有设备库存过量~"

EndIf

EndSub

PrivateSubCommand2_Click()显示低于于最小警戒库存的设备

datPrimaryRS.RecordSource="select*from现有库存表where现有库存<最小库存"

datPrimaryRS.Refresh

grdDataGrid.Refresh

IfdatPrimaryRS.Recordset.RecordCount>0Then

Beep

MsgBox"表中设备库存量已过警戒线~请采购~~"

Else

MsgBox"没有设备库存量过少~"

EndIf

Endsub

PrivateSubTimer1_Timer()自动报警程序

frmAlarm.datPrimaryRS.RecordSource="select*from现有库存表where现有库存>最大库存"

frmAlarm.datPrimaryRS.Refresh

IffrmAlarm.datPrimaryRS.Recordset.RecordCount>0Then

Beep

MsgBox"有设备库存超过警戒库存~"&vbCrLf&"请查看库存报警记录"

Timer1.Enabled=False

frmAlarm.Show

ExitSub

EndIf

EndSub

PrivateSubTimer2_Timer()

frmAlarm.datPrimaryRS.RecordSource="select*from现有库存表where现有库存<最小库存"

frmAlarm.datPrimaryRS.Refresh

IffrmAlarm.datPrimaryRS.Recordset.RecordCount>0Then

Beep

MsgBox"有设备库存低于警戒库存~"&vbCrLf&"请查看库存报警记录"

Timer2.Enabled=False

frmAlarm.Show

ExitSub

EndIf

EndSub

5.2.9操作日志模块实现

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育 > 初中作文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1