药品管理信息系统
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第一章系统概述
1.1 系统开发背景
随着科技的不断进步,企业都在不断的注重管理的信息化以完善企业管理,增强企业自身的竞争力。
医药业也不例外,通过较完善的信息系统实现自身企业对内部管理的方便性、合理性、快捷性、高效性等要求。
以前的手工管理效率低使最明显的缺陷,另外,数据的一致性不好维护,如某个药品信息的记录有所改动(如更改编号),那么该要品的其他记录就与此不一致,造成查询的费时费力。
要把全部数据都更改又相当不方便。
对药品库存的盘点也很不方便,而且需要较多的人来进行管理操作,而且容易出错,造成数据的不一致。
而药品业是关民生的行业,错误信息可能会造成不可收拾的严重后果。
因此,运用高效、准确的信息管理系统来替代手工管理是完善医药业管理的有效手段。
1.2.系统开发意义
利用数据库系统可以很好的对数据进行维护,减少由于数据不一致等错误带来的麻烦。
方便数据的更新和查询,降低错误率,方便药品信息的维护及库存的盘点。
还可以运用较少的人员,高效的完成对医药的管理。
由于社会的发展不断趋于信息化,各个行业都要加强自身的信息化程度以适应社会的发展。
而管理信息化正迎合了这个趋势,数据库系统在医药业的应用业实现了医药业执行工具、业务管理等的信息化,在这个信息化社会为医药业的发展增加了新的动力。
相信随着社会的不断发展对该类系统的需求会越来越高。
医药管理信息系统,即服务于个人,又服务于企业,并最终服务于社会,这是让科技为人类服务的最好例证,其开发意义显而易见。
第二章需求分析
第三章总体设计
3.1系统E-R图
3.1.1系统局部E-R图
图3.1供应商、药品实体联系图
图3.2药品、药品类别实体联系图
图3.3仓库、药品实体联系图
图3.4职工、药品实体联系图
3.1.2.系统全局E-R图
通过对系统局部ER图的优化设计系统的基本ER图如下:
图3.5
3.2关系模式
1.关系模式设计
该设计以概念结构设计中的E-R图为主要依据,设计出相关的整体逻辑结构。
根据总E-R图有五个实体但仓库实体在本系统中作用不大而且仅涉及到一个仓库,所以仓库不再单独设计一张表。
再加上一个多对多关系(本系统不考虑供应关系)总共五个关系模式:
药品信息(药品编码,药品名称,药品类别代码,售价,厂价,库存量,单位,有效期至)
药品类别索引(药品类别代码,类别说明)
供应商信息(供应商编码,供应商名称,联系人,联系电话,所在城市)
用户信息(职工号,姓名,用户名,用户口令,职位,权限)
药品销售信息(销售编码,销售日期,药品编码,药品名称,单价,数量,单位,总额,销售员编码)
2.关系模式优化
3.2.1中的关系模式中的每一个分量都是不可分的数据项所以都符合第一范式;而且所有的前四个关系模式都是由单个属性作为码,没有任何属性对码部分依赖,在药品销售信息内虽由三个属性作为码,但也不存在属性对码的部分依赖,所以上述模式都符合第二范式;药品信息、药品类别索引、供应商信息三个关系模式中不存在传递依赖,都属于第三范式。
在用户信息关系模式中,用户是按照权限分类的,职位不同权限不同,这样该关系模式就存在了非主属性对码的传递依赖:职工号→职位,职位→权限,所以应将用户信息分解为:
第四章实现
4.1数据库实现
根据3.3数据表设计的设计结果,运用DBMS SQL Server 2000 的企业管理器建立数据库表。
药品信息表(MedInfor )设置药品编码(MedicineCode)为主码,药品类别索引表(MedKindInfor)设置药品类别代码(MedKindCode)为主码,销售主表(SaleMainTable)设置销售编码(Saleno)及销售日期(SaleDate)共同作为主码,销售子表(SaleChildTable)设置销售编码(SaleNo)、销售日期(SaleDate)和药品编码(MedcineCode)共同作为主码,用户信息表(UserInfor)设置职工号(WorkNo)作为主码,供应商信息表(FirmInfor)设置供应商编码(FirmCode)为主码。
属性的字符类型及长度参照3.3数据表设计结果进行设置
每类药品可以有好多种药,每种药只有一个类别,所以药品类别索引表与药品信息表存在一对多的关系,以MedKindInfor的主码MedKindCode作主键,MedInfor的MedKindCode作外键建立关系。
销售子
表内的药品编码药参照药品信息表内的药品编码,即销售子表与药品信息表存在参照关系,以MedInfor 的MedicineCode作主键,SaleChildTable的MedicineCode作外键建立关系。
销售主表与销售子表存在依赖关系,以SaleMainTable的Saleno和SaleDate作为主键,SaleChildTable的Saleno和SaleDate作为外键建立关系。
销售主表内的职工号药参照用户信息表的职工号,即销售主表与用户信息表存在参照关系,以SaleMainTable的Workno为主键,UserInfor的WorkNo为外键建立关系。
4.2系统功能结构
系统根据用户身份的不同分为三个功能模块:销售管理模块,仓库管理模块和日常管理模块。
在销售管理模块,销售员可以根据顾客要求查询相关药品的部分信息,主要是库存量和售价的查询;还可以完成药品的销售,根据顾客所买药品的代码和数量存储销售信息,主要是对销售数量和销售总额的记录,并在销售完成后实现当前库存的更新。
在仓库管理模块,仓库管理员可以查看药品的全部信息,对药品信息进行维护,盘点库存信息,清除过期药品等。
在日常管理模块,管理者可以查看药品信息、销售记录,并对供应商信息和用户信息进行管理维护。
具体功能模块图如下:
图4.2系统功能图
4.3模块功能介绍
该系统共三个功能模块:销售管理、仓库管理和日常管理。
不同的用户可以进入不同的模块进行相应操作。
如:销售人员凭借用户名和密码只能进入销售管理系统,进入后可以进行药品的销售和查询;仓库管理员凭借用户名和密码只能进入仓库管理系统,进行药品信息的查询和维护;管理者也要通过身份验证进入日常管理界面进行用户信息和供应商信息的维护即查询及药品信息和销售信息的查询。
系统主界面如下:
图4.3系统主界面
4.3.1销售管理模块
该模块主要完成前台药品销售及前台查询功能:销售过程要将销售信息自动存储到销售信息主表及子表内,便且为了维护数据的一致性,药品库存量要随销售量动态更新,若购药量大于库存时应拒绝销售操作;查询功能主要查询顾客所需药品大概信息,可以根据药品名称或所属类别进行查询。
如下是销售管理模块的实现界面:
1.销售员登录界面
图4.4销售管理模块登录界面
该界面通过如下代码跟数据库内用户信息表连接,具体实现代码见附录
Private Sub Form_Load()
Adodc1.RecordSource = "select * from userinfor where userregname= '" & Text1 & "'" Adodc1.Refresh
End Sub
2.前台查询
(1)输入药品名称“盖中盖”所得查询结果如下
图4.5查询结果(一)
(2)选择药品类别“非处方药”所得查询结果如下
图4.6查询结果(二)
系统通过如下主要代码实现药品查询功能
按药品名查询
Adodc1.RecordSource = "select medicinecode 药品编码,medicinename 药品名称,price 售
价,stocknum 库存量,unit单位,usefullife 有效期至from MedInfor where medicinename= '" & Text1 & "'"
Adodc1.Refresh
按药品类别查询
Select Case Combo1.Text
Case "处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '1'"
Adodc1.Refresh
Case "非处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '2'"
Adodc1.Refresh
3.前台销售
(1)101003号药品,销售量为13时的销售界面
系统主要通过如下主要代码实现销售功能
更新库存
Adodc1.Recordset.Update
Text11.Text = Val(Text11.Text) - Val(Text2.Text)
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
计算总额
Text17.Text = Val(Text9.Text) * Val(Text2.Text)
x = x + Val(Text17.Text)
Text6.Text = x
4.3.2仓库管理模块
该模块主要完成药品信息的维护和查询,其中查询功能可以分别按药品代码、药品名称、药品类别或过期药品来查询。
如下是仓库管理模块的实现界面:
1.仓库管理员登录界面
图4.9管理员登录界面
2.药品信息查询
(1)输入代码“101003”的查询结果界面
图4.10按药品编码的查询结果结果界面
(2)输入药品名称“白加黑”的查询结果界面
图4.11按药品名称的查询结果界面
(3)选择药品类别“处方药”的查询结果界面
图4.12按药品类别的查询结果界面
(4)按过期药品查询的结果界面
图4.13按过期药品的查询结果界面
系统主要通过如下主要代码实现查询功能
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medicinecode= '" & Text1 & "'"
Adodc1.Refresh
.
4.3.3日常管理模块
该模块可以进行用户信息和供应商信息的维护及查询,主要是对药品信息、销售信息、用户信息和供应商信息的查询。
如下是日常管理模块的实现界面:
1.管理者登录界面
图4.14管理员登录界面
2.药品信息查询(类似与仓库管理的药品信息查询)
3. 销售记录查询
(一)销售主表查询界面
图4.15查询销售主表的结果界面
(二)销售子表查询界面
图4.16查询销售子表的结果界面
(三)全部信息查询界面
图4.17查询全部信息的结果界面
4.供应商信息查询
(一)输如供应商编码“1002”得查询结果界面
图4.18按供应商编码的查询结果界面
(二)输入所在城市名“上海”得查询结果界面
图4.19按供应商所在城市的查询结果界面
系统主要通过如下主要代码实现查询功能
Adodc1.RecordSource = " select saleno as 销售编码,amount as 总额,saledate as 销售日期,workno as 销售员编号from salemaintable where saleno='" & Trim(Text12.Text) & "'" Adodc1.Refresh
.
第五章设计总结
在课程设计阶段,首先对医药管理进行了了解,仔细分析了该管理对系统功能的要求,并根据这些功能要求对系统进行定义,确定系统必须做什么。
但由于对医药管理了解不多,需求分析难免不够完善,但是基本需求都考虑到了,并用文档准确记录了系统的需求。
之后着手对系统的设计工作,首先是概念结构设计,根据需求分析结果总结系统内实体及联系并绘制系统的局部ER图和全局ER图。
然后是逻辑结构设计,结合需求分析与概念结构设计把设计好的ER图转换为DBMS(SQL Server 2000)所支持的数据模型所符合的逻辑结构。
最后运用开发工具VB6.0进行功能的编码实现。
该系统最终能够基本实现绝大多数功能,但是也有很多不做之处,如药品进库信息功能,对新进药品进行入库存储,但是由于进价跟有效期的变化不能只是对该药品的库存量更改。
进价可以运用加成定价法更改,但有效期尚未想到解决方案。
希望老师给与意见及帮助,使系统功能更加完善。
在这次课程设计中虽然遇到过很多的困难,但我从中学到了很多有用的知识,通过不断的翻阅资料,各个问题的解决使我对系统的设计越来越感兴趣。
相信我从这次课程设计所学到的东西可以让我在以后的学习及工作中受益无限。
附录
实验程序源代码
1.登录界面代码:(以销售员登录为例,仓库管理员和日常管理者登录与此类似,不再赘述)
在主界面菜单“销售管理“内编写代码如下:
Private Sub A1_Click()
登录.Show
登录.Adodc1.RecordSource = "select * from userinfor where power=' 销售'"
登录.Adodc1.Refresh
登录.Option1.Value = True
登录.Option1.Visible = True
登录.Option2.Value = False
登录.Option2.Visible = False
登录.Option3.Value = False
登录.Option3.Visible = False
A = 1:
B = 0:
C = 0
End Sub
在Text2的GotFocus事件内编写如下代码以确定用户的准确性
Private Sub Text2_GotFocus()
Adodc1.RecordSource = "select * from userinfor where userregname= '" & Text1 & "'" Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "无此用户,请重新输入!", , "提示"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
在Command1的Click事件内编写如下代码检验用户密码Private Sub Command1_Click()
Dim x As String, y As String
Text1.SetFocus
If Val(Text2.Text) = Val(Text4.Text) Then
MsgBox "输入正确", , "提示"
Text1.Text = ""
Text2.Text = ""
Unload Me
If A = 1 Then
FrmMain.A2.Enabled = True
FrmMain.A3.Enabled = True
End If
Else
MsgBox "密码错误", , "提示"
End If
End Sub
2.前台查询窗体代码
Private Sub Command1_Click()
If Option1 Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medicinename= '" & Text1 & "'"
Adodc1.Refresh
End If
If Option2 Then
Select Case Combo1.Text
Case "处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '1'"
Adodc1.Refresh
Case "非处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '2'"
Adodc1.Refresh
Case "中药饮片"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '3'"
Adodc1.Refresh
Case "中药材"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '4'"
Adodc1.Refresh
Case "医疗器械"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor where medkindcode= '5'"
Adodc1.Refresh
Case "非药品(保健品)"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期from MedInfor where medkindcode= '6'"
Adodc1.Refresh
End Select
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息!", , "提示"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,stocknum as 库存量,unit as 单位,usefullife as 有效期至from MedInfor "
Adodc1.Refresh
End If
End Sub
3.销售界面代码
Private Sub Command1_Click()
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,price as 售价,unit as 单位,stocknum as 库存量from medinfor where medicinecode='" & Text1 & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then MsgBox "无此信息!", , "提示"
If Val(Text11.Text) - Val(Text2.Text) < 0 Then
MsgBox "库存不足", , "提示"
Text1.Text = "": Text2.Text = "": Text1.SetFocus
Else
On Error Resume Next
Adodc2.Recordset.AddNew
Text12.Text = Text4.Text
Text13.Text = Text7.Text
Text14.Text = Text8.Text
Text15.Text = Text9.Text
Text16.Text = Text10.Text
Text17.Text = Val(Text9.Text) * Val(Text2.Text) Text18.Text = Text2.Text
Adodc2.Recordset.Update
Adodc2.Recordset.MoveLast
Adodc1.Recordset.Update
Text11.Text = Val(Text11.Text) - Val(Text2.Text) Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
x = x + Val(Text17.Text)
End If
End Sub
Private Sub Command2_Click()
Static y As Integer
y = Val(Text4.Text) + 1
Text4.Text = y
Text5.Text = Date$
Text6.Text = x
Adodc3.Recordset.AddNew
Text19.Text = Text4.Text
Text20.Text = Text3.Text
Text21.Text = Date$
Text22.Text = Text6.Text
Adodc3.Recordset.Update
Adodc3.Recordset.MoveLast
Text6.SetFocus
End Sub
Private Sub Text6_LostFocus()
x = 0
End Sub
4.药品信息查询代码(仓库管理和日常管理的药品查询都用此代码)Option Explicit
Private Sub Command1_Click()
On Error Resume Next
If Command1.Caption = "新增" Then
Command1.Caption = "确认"
Adodc1.Recordset.AddNew
Text4.SetFocus
Else
Command1.Caption = "新增"
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
End If
End Sub
Private Sub Command2_Click()
On Error Resume Next
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End Sub
Private Sub Command3_Click()
On Error Resume Next
If Command3.Caption = "修改" Then
Command3.Caption = "确认"
Adodc1.Recordset.Update
Text4.SetFocus
Else
Command3.Caption = "修改" Adodc1.Recordset.Update Command1.Enabled = True Command2.Enabled = True Command5.Enabled = True End If
End Sub
Private Sub Command4_Click() Command3.Caption = "修改" Command1.Caption = "添加" On Error GoTo RefreshErr Adodc1.Refresh
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub
Private Sub Command5_Click() Frame1.Visible = True
End Sub
Private Sub Command6_Click()
If Option1 Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medicinecode= '" & Text1 & "'"
Adodc1.Refresh
End If
If Option2 Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medicinename= '" & Text2 & "'"
Adodc1.Refresh
End If
If Option3 Then
Select Case Combo1.Text
Case "处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '1'" Adodc1.Refresh
Case "非处方药"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '2'" Adodc1.Refresh
Case "中药饮片"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '3'" Adodc1.Refresh
Case "中药材"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '4'" Adodc1.Refresh
Case "医疗器械"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '5'" Adodc1.Refresh
Case "非药品(保健品)"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where medkindcode= '6'" Adodc1.Refresh
End Select
End If
If Option4 Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor where usefullife <' " &
Trim(Text13) & " ' "
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息!", , "提示"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor "
Adodc1.Refresh
End If
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor "
Adodc1.Refresh
MsgBox "当前记录为第一条", , "提示"
End If
End Sub
Private Sub Command8_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名
称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号from MedInfor "
Adodc1.Refresh
MsgBox "当前记录为最后一条", , "提示"
End If
End Sub
Private Sub Option4_Click()
Combo1.Enabled = False
Text13.Text = Date$
End Sub
5.销售记录查询代码
Option Explicit
Private Sub Command1_Click()
If Option1 Then
Adodc1.RecordSource = " select saleno as 销售编码,amount as 总额,saledate as 销售日期,workno as 销售员编号from salemaintable where saleno='" & Trim(Text12.Text) & "'" Adodc1.Refresh
End If
If Option2 Then
Adodc1.RecordSource = " select saleno as 销售编码,medicinecode AS 药品编
码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单价,amount as 总额from salechildtable where saleno='" & Trim(Text12.Text) & "'"
Adodc1.Refresh
End If
If Option3 Then
Adodc1.RecordSource = " select salemaintable.saleno as 销售编码,medicinecode AS 药品编码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单
价,salechildtable.amount as 总额,saledate as 销售日期,workno as 销售员编号from salemaintable,salechildtable where salemaintable.saleno=salechildtable.saleno "
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无次信息", , "提示"
Adodc1.RecordSource = " select salemaintable.saleno as 销售编码,medicinecode AS 药品编码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单
价,salechildtable.amount as 总额,saledate as 销售日期,workno as 销售员编号from salemaintable,salechildtable where salemaintable.saleno=salechildtable.saleno "
Adodc1.Refresh
End If
End Sub
6.供应商信息维护代码及查询代码
对供应商信息的添加、删除等功能实现代码类似于药品信息的添加、删除等操作,在此就不再赘述Private Sub Command6_Click()
If Option1 Then
Adodc1.RecordSource = "select * from firminfor where firmcode= '" & Text6 & "'"
Adodc1.Refresh
End If
If Option2 Then
Adodc1.RecordSource = "select * from firminfor where firmname= '" & Text7 & "'"
Adodc1.Refresh
End If
If Option3 Then
On Error Resume Next
Adodc1.RecordSource = " Select * From FirmInfor Where city= '" & Trim(Text8.Text) & "'" Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息", , "提示"
Adodc1.RecordSource = "firminfor"
Adodc1.Refresh
End If
End Sub
7.用户信息的维护及查询代码
对用户信息的添加、删除等功能实现代码类似于药品信息的添加、删除等操作,在此就不再赘述
Private Sub Command5_Click()
Adodc1.RecordSource = "select workno as 职工号,userregname as 用户名,position as 职
位,power as 权限,name as 姓名from userinfor where name='" & Text6.Text & "' and position='" & Text7 & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "无此信息!", , "提示"
Adodc1.RecordSource = "select workno as 职工号,userregname as 用户名,position as 职位,power as 权限,name as 姓名from userinfor"
Adodc1.Refresh
Text6.Text = ""
Text7.Text = ""
Text6.SetFocus
End If
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select workno as 职工号,userregname as 用户名,position as 职位,power as 权限,name as 姓名from userinfor"
Adodc1.Refresh
End Sub
参考文献
萨师煊、王珊.数据库系统概论.北京:高等教育出版社,2000年
张海藩.软件工程导论.北京:清华大学出版社,2003年
龚沛曾、陆慰民、杨志强.Visual Basic程序设计教程.北京:高等教育出版社,2000年白尚旺、党伟超.PowerDesigner软件工程技术.北京:电子工业出版社,2004年。