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

📄 productypesingleform.frm

📁 即时通讯
💻 FRM
字号:
VERSION 5.00
Begin VB.Form productypesingleform 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form1"
   ClientHeight    =   3480
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   3960
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3480
   ScaleWidth      =   3960
   Begin VB.Frame Frame2 
      Height          =   735
      Left            =   0
      TabIndex        =   6
      Top             =   2760
      Width           =   3975
      Begin VB.CommandButton c_cancel 
         Caption         =   "退出"
         Height          =   375
         Left            =   2880
         TabIndex        =   10
         Top             =   240
         Width           =   735
      End
      Begin VB.CommandButton c_save 
         Caption         =   "保存"
         Default         =   -1  'True
         Height          =   375
         Left            =   1680
         TabIndex        =   9
         Top             =   240
         Width           =   735
      End
      Begin VB.CommandButton c_new 
         Caption         =   "新增"
         Height          =   375
         Left            =   360
         TabIndex        =   8
         Top             =   240
         Width           =   735
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2895
      Left            =   0
      TabIndex        =   0
      Top             =   -120
      Width           =   3975
      Begin VB.TextBox Text1 
         Height          =   1305
         Index           =   2
         Left            =   1560
         MaxLength       =   255
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   7
         Top             =   1200
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   1
         Left            =   1560
         MaxLength       =   20
         TabIndex        =   5
         Top             =   720
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   0
         Left            =   1560
         MaxLength       =   4
         TabIndex        =   4
         Top             =   240
         Width           =   2055
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "备注"
         Height          =   180
         Index           =   2
         Left            =   1080
         TabIndex        =   3
         Top             =   1320
         Width           =   360
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "产品类别名称"
         Height          =   180
         Index           =   1
         Left            =   360
         TabIndex        =   2
         Top             =   720
         Width           =   1080
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "产品序号"
         Height          =   180
         Index           =   0
         Left            =   720
         TabIndex        =   1
         Top             =   360
         Width           =   720
      End
   End
End
Attribute VB_Name = "productypesingleform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'*    模 块 名 称 :产品类别设置用户操作界面
'*    功 能 描 述 :产品类别设置用户操作界面
'*    程序员姓名  : 石春晓
'*    最后修改人  : 石春晓
'*    最后修改时间:2005/09/05
'**************************************
Option Explicit
Public m_operatorType As Integer       ' 操作类型 0 - 新增 1 - 修改
Public m_productypeid  As String        ' 修改时其它窗体传递过来的参数
Private m_productypeDAO As productypeDAO ' 数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Public f As String


Private Sub c_cancel_Click()
    Unload Me
End Sub

Private Sub c_new_Click()
    Call Check
    If m_operatorType = 0 Then
        If f = "0" Then
           Exit Sub
        Else
           Call Newproductype
           Call clear
        End If
    ElseIf m_operatorType = 1 Then
        If f = "0" Then
            Exit Sub
        Else
            Call Modifyproductype
            clear
            m_operatorType = 0
        End If
    End If

End Sub

Private Sub c_save_Click()
    Call Check
    If m_operatorType = 0 Then
        If f = "0" Then
           Exit Sub
        Else
           Call Newproductype
        End If
    ElseIf m_operatorType = 1 Then
        If f = "0" Then
           Exit Sub
        Else
           Call Modifyproductype
        End If
    End If
    Unload Me
End Sub

Private Sub Form_Load()
    Set m_productypeDAO = New productypeDAO
    Set m_recordset = New ADODB.Recordset
    
'
'    Me.Height = 4320
'    Me.Width = 4080
    SetToCenter Me
    If m_operatorType = 0 Then
        Me.caption = "产品类别_新增"
        
        clear
    Else
        Me.caption = "产品类别_修改"
        
        FindByIdRefresh
    End If
End Sub
'**************************************
'*    功 能 描 述 :产品类别数据处理函数
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Private Sub Newproductype()
    '
    Dim ret As Boolean
    
    Call Check
    
    ret = m_productypeDAO.Newproductype(m_recordset, Trim(Text1(0).text), Trim(Text1(1).text), _
                   Trim(Text1(2).text))
End Sub
'**************************************
'*    功 能 描 述 :修改产品类别处理函数
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Private Sub Modifyproductype()
    '
    Dim ret As Boolean
    
    Call Check
    
    ret = m_productypeDAO.Modifyproductype(m_recordset, Trim(Text1(0).text), Trim(Text1(1).text), _
                   Trim(Text1(2).text), m_productypeid)
End Sub
'**************************************
'*    功 能 描 述 :检验数据的合法性
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Private Sub Check()
    f = "1"
    If Trim(Text1(1).text) = "" Then
        MainForm.g_msgText = "类别名称不能为空!"
        HMsgBox MainForm.g_msgText, 0, 1
        Text1(1).SetFocus
        f = "0"
        Exit Sub
        
    End If
    If Trim(Text1(0).text) = "" Or Not IsNumeric(Trim(Text1(0).text)) Then
        MainForm.g_msgText = "序号不能为空或者序号类型不正确!"
        HMsgBox MainForm.g_msgText, 0, 1
        Text1(0).SetFocus
        f = "0"
        Exit Sub
    End If
End Sub
'**************************************
'*    功 能 描 述 :根据产品类别ID找到产品类别资料并显示在界面上
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Private Sub FindByIdRefresh()
    Dim ret As Boolean
    
    ret = m_productypeDAO.FindById(m_recordset, m_productypeid)
    
    If ret Then
      With m_recordset
            Text1(0).text = Trim(.Fields("产品序号"))
            Text1(1).text = Trim(.Fields("产品类别名称"))
            Text1(2).text = Trim(.Fields("备注"))
            m_recordset.Close
      End With
    Else
        MainForm.g_msgText = "产品类别ID不正确,请重新操作!"
        HMsgBox MainForm.g_msgText, 0, 1
        Unload Me
    End If
End Sub
'**************************************
'*    功 能 描 述 :清除界面上文本框里的所有内容
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Private Sub clear()
            Text1(0).text = ""
            Text1(1).text = ""
            Text1(2).text = ""

End Sub






⌨️ 快捷键说明

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