电脑库存管理系统数据库课程设计说明书.doc
《电脑库存管理系统数据库课程设计说明书.doc》由会员分享,可在线阅读,更多相关《电脑库存管理系统数据库课程设计说明书.doc(14页珍藏版)》请在冰点文库上搜索。
数据库课程设计
说明书
学院、系:
软件学院
专业:
软件工程
学生姓名:
赵霸
学号:
0926010210
设计题目:
电脑配件库存管理系统
起迄日期:
2011年5月30日~2011年6月17日
指导教师:
李华玲
2012年6月17日
1.需求分析
(1)软件的功能:
实现对各种电脑配件的添加、修改和删除功能;实现对各种电脑配件的进货、退货和出货的管理。
(2)软件的目的:
为了研究电脑配件库存管理系统软件的软件功能和开发方法,为以后的程序开发者提供可靠的依据。
(3)软件的任务:
完成贫困生管理系统的设计与实现,主要包括以下基本内容:
1)电脑配件资料的添加、修改与删除;
2)电脑配件的进货、退货与出货管理;
3)电脑配件的库存管理与信息统计;
4)各种信息统计分析功能;
5)完成程序的最终调试,必须能正常运行。
(4)软件的成果:
实现了对电脑配件的库存管理与信息统计以及各种信息统计分析功能。
2.总体设计
a.程序所包括的功能:
添加功能、删除功能、进货功能、出货功能、退货功能和查询功能等。
b.添加功能包括:
添加电脑配件名称、添加各种电脑配件的进货量和出货量。
c.删除功能包括:
删除电脑配件名称。
d.进货功能包括:
输入各种电脑配件的进货量。
e.出货功能包括:
输入各种电脑配件的出货量。
f.退货功能包括:
将某种或某些电脑配件的名称以及库存量从表中删除。
g.查询功能包括:
查询某种或某些电脑配件的进货量、进货时间、出货量、出货时间。
电脑配件
仓库库
配件名称
ID
库存量
进货时间
出货时间
存入
进货量
出货量
E-R图设计
进货表
出货表
3.详细设计
(1)添加功能的核心代码及窗口:
PrivateSubCommand1_Click()
Dimstr()AsString
Dimvalue()AsString
'OnErrorResumeNext
IfText1.Text<>""Then
WithForm1.Adodc1
.RecordSource="select*from[type]"
.Refresh
.Recordset.AddNew
.Recordset.Fields("pname")=Text1.Text
.Recordset.Fields("number")=0
.Recordset.Update
EndWith
MsgBox"添加成功"
Form3.Enabled=True
Form3.resetlv
UnloadMe
Else
MsgBox"添加失败"
EndIf
EndSub
(2)删除功能的核心代码及窗口:
PrivateSubCommand1_Click()
Dimh,lAsInteger
Form1.Adodc1.Refresh
Form1.Adodc1.Recordset.MoveFirst
WhileNotForm1.Adodc1.Recordset.EOF
IfForm1.Adodc1.Recordset("ID")=lv1.SelectedItem.TextThen
WithForm1.Adodc1
.Recordset.DeleteadAffectCurrent
.Recordset.Update
EndWith
EndIf
Form1.Adodc1.Recordset.MoveNext
Wend
resetlv
EndSub
(3)进货功能的核心代码及窗口:
PrivateSubCommand1_Click()
DimtotalAsInteger
DimnumAsInteger
num=CInt(Text1.Text)
IfText1.Text<=0Then
Else
Form1.Adodc1.RecordSource="selectintime,num,typeidfrom[in]"
Form1.Adodc1.Refresh
WithForm1.Adodc1.Recordset
.AddNew
.Fields("intime")=Date
.Fields("num")=num
.Fields("typeid")=Form4.lv1.SelectedItem.Text
.Update
EndWith
WithForm1.Adodc1
.RecordSource="select*from[type]"
.Refresh
EndWith
Form1.Adodc1.Recordset.MoveFirst
WhileNotForm1.Adodc1.Recordset.EOF
IfForm1.Adodc1.Recordset("ID")=Form4.lv1.SelectedItem.TextThen
total=num+CInt(Form1.Adodc1.Recordset("number"))
WithForm1.Adodc1.Recordset
.Update"number",total
.Update
EndWith
EndIf
Form1.Adodc1.Recordset.MoveNext
Wend
MsgBox"进货成功"
Form4.resetlv
Form4.Enabled=True
UnloadMe
EndIf
EndSub
(4)出货功能的核心代码及窗口:
PrivateSubCommand1_Click()
DimtotalAsInteger
DimnumAsInteger
num=CInt(Text1.Text)
IfText1.Text<=0Then
Else
Form1.Adodc1.RecordSource="selectotime,num,typeidfrom[out]"
Form1.Adodc1.Refresh
WithForm1.Adodc1.Recordset
.AddNew
.Fields("otime")=Date
.Fields("num")=num
.Fields("typeid")=Form4.lv1.SelectedItem.Text
.Update
EndWith
WithForm1.Adodc1
.RecordSource="select*from[type]"
.Refresh
EndWith
Form1.Adodc1.Recordset.MoveFirst
WhileNotForm1.Adodc1.Recordset.EOF
IfForm1.Adodc1.Recordset("ID")=Form4.lv1.SelectedItem.TextThen
total=CInt(Form1.Adodc1.Recordset("number"))-num
WithForm1.Adodc1.Recordset
.Update"number",total
.Update
EndWith
EndIf
Form1.Adodc1.Recordset.MoveNext
Wend
MsgBox"出货成功"
Form4.resetlv
Form4.Enabled=True
UnloadMe
EndIf
EndSub
(5)退货功能的核心代码及窗口:
PrivateSubCommand1_Click()
Dimh,lAsInteger
Form1.Adodc1.Refresh
Form1.Adodc1.Recordset.MoveFirst
WhileNotForm1.Adodc1.Recordset.EOF
IfForm1.Adodc1.Recordset("ID")=lv1.SelectedItem.TextThen
WithForm1.Adodc1
.Recordset.DeleteadAffectCurrent
.Recordset.Update
EndWith
EndIf
Form1.Adodc1.Recordset.MoveNext
Wend
resetlv
EndSub
(6)查询功能的核心代码及窗口:
a.查询某种或某些电脑配件的进货量和进货时间的核心代码及窗口
PrivateSubCommand1_Click()
DimcountAsInteger
DimiAsInteger
lv1.ListItems.Clear
lv1.ColumnHeaders.Clear
WithForm1.Adodc1
.RecordSource="select[in].id,intime,num,pnamefrom[in],typewheretype.id=typeid"
.Refresh
EndWith
count=Form1.Adodc1.Recordset.RecordCount
Form1.Adodc1.Recordset.MoveFirst
lv1.ColumnHeaders.Add,,"ID"
lv1.ColumnHeaders.Add,,"配件名称"
lv1.ColumnHeaders.Add,,"进货时间"
lv1.ColumnHeaders.Add,,"进货量"
i=1
WhileNotForm1.Adodc1.Recordset.EOF
lv1.ListItems.Add,,Form1.Adodc1.Recordset("ID")
lv1.ListItems(i).SubItems
(1)=Form1.Adodc1.Recordset("PNAME")
lv1.ListItems(i).SubItems
(2)=Form1.Adodc1.Recordset("intime")
lv1.ListItems(i).SubItems(3)=Form1.Adodc1.Recordset("num")
i=i+1
Form1.Adodc1.Recordset.MoveNext
Wend
EndSub
b.查询某种或某些电脑配件的出货量和出货时间的核心代码及窗口
PrivateSubCommand3_Click()
DimcountAsInteger
DimiAsInteger
lv1.ListItems.Clear
lv1.ColumnHeaders.Clear
WithForm1.Adodc1
.RecordSource="selectout.id,pname,otime,numfromtype,outwhereout.typeid=type.id"
.Refresh
EndWith
count=Form1.Adodc1.Recordset.RecordCount
Form1.Adodc1.Recordset.MoveFirst
lv1.ColumnHeaders.Add,,"ID"
lv1.ColumnHeaders.Add,,"配件名称"
lv1.ColumnHeaders.Add,,"出货时间"
lv1.ColumnHeaders.Add,,"出货量"
i=1
WhileNotForm1.Adodc1.Recordset.EOF
lv1.ListItems.Add,,Form1.Adodc1.Recordset("ID")
lv1.ListItems(i).SubItems
(1)=Form1.Adodc1.Recordset("PNAME")
lv1.ListItems(i).SubItems
(2)=Form1.Adodc1.Recordset("otime")
lv1.ListItems(i).SubItems(3)=Form1.Adodc1.Recordset("num")
i=i+1
Form1.Adodc1.Recordset.MoveNext
Wend
EndSub
4.心得体会
本次课程设计,通过理论联系实际,巩固所学的知识,提高处理实际问题的能力,本次主要的设计任务是计算机在电脑配件库存管理方面的应用。
今年学习了数据库系统概论,让我对数据库理论知识有了一定的了解,但实践出真知,唯有把理论与实践相结合,才能将知识发挥最大的用处,为期三周的课程设计,我上网查询了一些数据库应用知识并对程序设计报告所需的资料进行了较深入的了解,通过亲自设计数据库,提高了我的动手能力。
虽然这次设计的电脑配件库存数据库还有很多不足的地方,这次课程设计,让我了解到了自己的不足,我会继续努力,完善自我。
学院准备的课程设计,对提高我们的实践能力很有帮助。
13