⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmqnameplate.frm

📁 网上销售源代码
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form frmMQNamePlate 
   Caption         =   "品牌管理"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   11115
   ScaleWidth      =   15240
   WindowState     =   2  'Maximized
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid fg 
      Height          =   8625
      Left            =   30
      TabIndex        =   0
      Top             =   600
      Width           =   15105
      _ExtentX        =   26644
      _ExtentY        =   15214
      _Version        =   393216
      Cols            =   4
      FormatString    =   $"frmMQNamePlate.frx":0000
      _NumberOfBands  =   1
      _Band(0).Cols   =   4
   End
   Begin MSComctlLib.Toolbar tlbOperate 
      Height          =   540
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   15090
      _ExtentX        =   26617
      _ExtentY        =   953
      ButtonWidth     =   820
      ButtonHeight    =   953
      AllowCustomize  =   0   'False
      Wrappable       =   0   'False
      Style           =   1
      ImageList       =   "ImgOperation"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   18
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "新增"
            Style           =   3
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "新增"
            Key             =   "add"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "edit"
            Object.ToolTipText     =   "修改"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "del"
            Object.ToolTipText     =   "删除"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "搜索"
            Key             =   "search"
            ImageIndex      =   11
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "刷新"
            Key             =   "refresh"
            ImageIndex      =   12
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "首页"
            Key             =   "first"
            ImageIndex      =   13
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "前页"
            Key             =   "prev"
            ImageIndex      =   14
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "下页"
            Key             =   "next"
            ImageIndex      =   15
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "末页"
            Key             =   "last"
            ImageIndex      =   16
         EndProperty
         BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "预览"
            Key             =   "preview"
            Object.ToolTipText     =   "预览"
            ImageIndex      =   17
         EndProperty
         BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "打印"
            Key             =   "printout"
            Object.ToolTipText     =   "打印"
            ImageIndex      =   18
         EndProperty
         BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "关闭"
            Key             =   "quit"
            Object.ToolTipText     =   "关闭"
            ImageIndex      =   19
         EndProperty
         BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
      EndProperty
      OLEDropMode     =   1
   End
   Begin MSComctlLib.ImageList ImgOperation 
      Left            =   6510
      Top             =   390
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   19
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":00AC
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":5FEE
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":6CC8
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":89D2
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":95A4
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":C2AE
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":C5C8
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":CA1A
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":103DC
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":10976
            Key             =   ""
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":10F10
            Key             =   ""
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":117EA
            Key             =   ""
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":11944
            Key             =   ""
         EndProperty
         BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":11CDE
            Key             =   ""
         EndProperty
         BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":12078
            Key             =   ""
         EndProperty
         BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":12412
            Key             =   ""
         EndProperty
         BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":127AC
            Key             =   ""
         EndProperty
         BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":12AC6
            Key             =   ""
         EndProperty
         BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMQNamePlate.frx":133A0
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmMQNamePlate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public mintCurPage      As Integer      '当前页
Public mintPageSize     As Integer      '每页多少行
Public mrstDriveRoom    As Recordset

Private Sub fg_DblClick()
If fg.TextMatrix(fg.Row, 1) = "" Then
    Exit Sub
End If

frmNamePlate.txtGoodsBandID.Text = fg.TextMatrix(fg.Row, 1)
frmNamePlate.txtGoodsBandName.Text = fg.TextMatrix(fg.Row, 1)
frmNamePlate.txtRemark.Text = fg.TextMatrix(fg.Row, 1)
frmNamePlate.txtGoodsBandID.Enabled = False
frmNamePlate.txtGoodsBandName.Enabled = False
frmNamePlate.txtRemark.Enabled = False


frmNamePlate.tlbOperate.Buttons("update").Enabled = False
frmNamePlate.tlbOperate.Buttons("cancel").Enabled = False
If mrstDriveRoom.PageCount = 1 Then
    frmNamePlate.tlbOperate.Buttons("first").Enabled = False
    frmNamePlate.tlbOperate.Buttons("prev").Enabled = False
    frmNamePlate.tlbOperate.Buttons("next").Enabled = False
    frmNamePlate.tlbOperate.Buttons("last").Enabled = False
    frmNamePlate.tlbOperate.Buttons("cancel").Enabled = False
Else
    
End If

frmNamePlate.Show 1

End Sub

Private Sub Form_Load()
    mintCurPage = 1
    mintPageSize = 1
    
    Initfg
    
    QuerySalesRoom
        
End Sub

Private Sub tlbOperate_ButtonClick(ByVal Button As MSComctlLib.Button)
     Select Case Button.Key
        Case "add"
            '添加
            frmNamePlate.P_SID = ""
            frmNamePlate.tlbOperate.Buttons("first").Enabled = False
            frmNamePlate.tlbOperate.Buttons("prev").Enabled = False
            frmNamePlate.tlbOperate.Buttons("next").Enabled = False
            frmNamePlate.tlbOperate.Buttons("last").Enabled = False
            frmNamePlate.Show 1
            
        Case "edit"
            frmNamePlate.P_SID = Me.fg.TextMatrix(fg.Row, 1)
            frmNamePlate.txtGoodsBandID.Text = Me.fg.TextMatrix(fg.Row, 1)
            frmNamePlate.txtGoodsBandName.Text = Me.fg.TextMatrix(fg.Row, 2)
            frmNamePlate.txtRemark.Text = Me.fg.TextMatrix(fg.Row, 3)
            frmNamePlate.txtGoodsBandID.Enabled = False
            frmNamePlate.tlbOperate.Buttons("first").Enabled = False
            frmNamePlate.tlbOperate.Buttons("prev").Enabled = False
            frmNamePlate.tlbOperate.Buttons("next").Enabled = False
            frmNamePlate.tlbOperate.Buttons("last").Enabled = False
            frmNamePlate.Show 1
                        
        Case "del"
            '删除
            If fg.TextMatrix(fg.Row, 1) = "" Then
                Exit Sub
            End If
            
            If MsgBox("确实要删除品牌编号为" & fg.TextMatrix(fg.Row, 1) & "的数据吗?", vbYesNo, "询问") = vbYes Then
                Del (fg.TextMatrix(fg.Row, 1))
           End If
           
        Case "search"
            '搜索
            QuerySalesRoom
            
        Case "refresh"
            '刷新
            QuerySalesRoom
            
        Case "first"
            '首页
            mintCurPage = 1
            gFillFg fg, mrstDriveRoom, Me.tlbOperate.Buttons, mintCurPage, mintPageSize
            ShowID
            
        Case "prev"
            '前页
            If mintCurPage <= mrstDriveRoom.PageCount Then
                mintCurPage = mintCurPage - 1
                gFillFg fg, mrstDriveRoom, Me.tlbOperate.Buttons, mintCurPage, mintPageSize
                ShowID
            End If
            
        Case "next"
            '下页
            If mintCurPage + 1 <= mrstDriveRoom.PageCount Then
                mintCurPage = mintCurPage + 1
                gFillFg fg, mrstDriveRoom, Me.tlbOperate.Buttons, mintCurPage, mintPageSize
                ShowID
            End If
            
        Case "last"
            '末页
            mintCurPage = -1
            gFillFg fg, mrstDriveRoom, Me.tlbOperate.Buttons, mintCurPage, mintPageSize
            ShowID
            
        Case "preview"
            '预览
        
        Case "printout"
            '打印
            
        Case "quit"
            Unload Me
     End Select
End Sub

Public Sub Del(id As String)
'删除数据
On Error GoTo ErrShow
Dim sql As String
Dim Ars As New ADODB.Recordset

SQLDB.BeginTrans

    '查询是否以使用了品牌
    sql = "Select * from Cargo Where GoodsBandID='" & id & "'"
    Set Ars = SQLDB.Execute(sql)
    If Not Ars.EOF Then
        MsgBox id & "已被使用,不能删除", vbInformation, "提示"
        SQLDB.RollbackTrans
        Exit Sub
    End If
    
    sql = "Delete GoodsBand Where GoodsBandID='" & id & "'"
    SQLDB.Execute sql
SQLDB.CommitTrans

Initfg
QuerySalesRoom
MsgBox "删除成功", vbInformation, "提示"
Exit Sub
ErrShow:
    SQLDB.RollbackTrans
    MsgBox "删除" & id & "区域出错" & Err.Description, vbInformation, "提示"
    Exit Sub
End Sub

Public Sub QuerySalesRoom()
'查询所有门市信息
Dim sql As String

sql = "select GoodsBandID as 品牌编号,GoodsBandName as 品牌名称,Remark as 备注 from GoodsBand order by id desc"
Set mrstDriveRoom = SQLDB.Execute(sql)
gFillFg fg, mrstDriveRoom, Me.tlbOperate.Buttons, mintCurPage, mintPageSize

fg.TextMatrix(0, 0) = "序号"
ShowID
End Sub

Public Sub Initfg()
    fg.Clear
    fg.Rows = 2
    fg.Cols = 4
    fg.FormatString = "序号  |<品牌编号                                          |<品牌名称                                                |<备注                                              "
    
    ShowID
End Sub

Public Sub ShowID()
Dim i As Integer

    '计算网格有多少行
    For i = 1 To fg.Rows - 1
        fg.TextMatrix(i, 0) = i
    Next
End Sub




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -