鉴于大家对VB类作品十分关注,我们编辑小组在此为大家搜集整理了“VB超市进销存管理系统”一文,供大家参考学习!
客服咨询,网学网竭诚为您服务,本站永久域名:myeducs.cn |
4.3 主要功能模块 4.3.1 基础数据管理 由于部门人员、客户信息和商品信息维护类似,下面以商品信息维护程序实现为例进行说明。 (1)frmAddSplb(商品类别维护) 此模块可以对商品类别进行维护,添加、修改和删除操作。添加、修改时判断类别名称是否为空、重复;删除时判断商品类别下是否有商品信息。如图: 图4.3 商品类别维护 其代码实现如下: Private Sub btn添加_Click() ''判断信息的正确性 ''更新商品类别表中的信息记录 ''1 If Trim(Me.Text3.Text) = "" Then MsgBox "类别名称不能为空!" Exit Sub End If If ExecSql("select * from splb where lbid <>''" & Trim(Me.Text2.Text) & "'' and lbmc=''" & Trim(Me.Text3.Text) & "''").RecordCount > 0 Then MsgBox "类别名称不能重复!" Exit Sub End If ''2 Dim strresult As String strresult = Exec_SqL("update splb set lbmc= ''" & Trim(Me.Text3.Text) & "'' where lbid=''" & Me.Text2.Text & "''") If strresult <> "OK" Then MsgBox strresult End If frmSpxx.UserControl12_Click Unload Me End Sub Private Sub Form_Activate() ''得到商品类表表中最大的类别编号 If Me.Text2.Tag = "" Then Me.Text2.Text = Format(GetMaxNum("select max(lbid) from splb"), "000000") End If End Sub Private Sub Form_Resize() ''动态改变窗体的样式和标题 Call FormFace(Me, TopPicture, KKShape) Call TopCaption(Me.TopPicture, Label2.Caption) End Sub Private Sub TopPicture_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ''准备窗体移动标志 intOldX = X intOldy = Y boolMouseFlag = True End Sub Private Sub TopPicture_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ''存储窗提议动前的left,top Dim intLeft, intTop As Integer intLeft = Me.Left intTop = Me.Top If Me.WindowState = 2 Then Exit Sub If boolMouseFlag = True Then Me.Left = intLeft + (X - intOldX) Me.Top = intTop + (Y - intOldy) End If End Sub Private Sub TopPicture_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) ''还原当前的窗体移动标志 boolMouseFlag = False End Sub Private Sub UserControl11_Click() ''关闭窗体 Unload Me End Sub Private Sub UserControl12_Click() ''删除商品类别(如果商品类别下有商品信息,则不允许删除) Dim strresult As String If ExecSql("select * from spxx where lbid=''" & Me.Text2.Text & "''").RecordCount > 0 Then MsgBox "此部门下有商品信息,不能删除!" Exit Sub End If strresult = Exec_SqL("delete from splb where lbid=''" & Me.Text2.Text & "''") If strresult <> "OK" Then MsgBox strresult End If frmSpxx.UserControl12_Click Unload Me End Sub Private Sub UserControl13_Click() ''判断信息的正确性 ''添加一条商品类别纪录 ''1 If Trim(Me.Text3.Text) = "" Then MsgBox "类别名称不能为空!" Exit Sub End If If ExecSql("select * from splb where lbid=''" & Trim(Me.Text2.Text) & "''").RecordCount > 0 Then MsgBox "类别代码不能重复!" Exit Sub End If If ExecSql("select * from splb where lbmc=''" & Trim(Me.Text3.Text) & "''").RecordCount > 0 Then MsgBox "类别名称不能重复!" Exit Sub End If ''2 Dim strresult As String strresult = Exec_SqL("insert into splb (lbid,lbmc) values (''" & Trim(Me.Text2.Text) & "'',''" & Trim(Me.Text3.Text) & "'')") If strresult <> "OK" Then MsgBox strresult End If frmSpxx.UserControl12_Click Unload Me End Sub |
本站发布的计算机毕业设计均是完整无错的全套作品,包含开题报告+程序+论文+源代码+翻译+答辩稿PPT |
本文选自计算机毕业设计http://myeducs.cn |