当前位置:跳过导航链接计算机毕业设计首页 : VB计算机毕业设计 : 详细内容

VB销售管理系统(7)

来源:xiaoniu168.com 作者:本站原创 添加时间:2012-02-07 点击数:20098

计算机毕业设计功能介绍:

4.3.1 基础数据管理
由于部门人员、客户信息和商品信息维护类似,下面以商品信息维护程序实现为例进行说明。
(1)frmAddSplb(商品类别维护)
此模块可以对商品类别进行维护,添加、修改和删除操作。添加、修改时判断类别名称是否为空、重复;删除时判断商品类别下是否有商品信息。

以下是引用片段:

其代码实现如下:
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

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第8页为计算机毕业论文商品信息维护功能介绍......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网
计算机毕业设计客服
计算机毕业论文客服在线 计算机毕业论文客服在线
计算机毕业论文在线,计算机毕业设计在线