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

📄 checkoptionlist.frm

📁 即时通讯
💻 FRM
字号:
VERSION 5.00
Begin VB.Form checkoptionlist 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "增加检验产品项目"
   ClientHeight    =   3540
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4290
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3540
   ScaleWidth      =   4290
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Height          =   735
      Left            =   0
      TabIndex        =   5
      Top             =   2760
      Width           =   4215
      Begin VB.CommandButton Command3 
         Caption         =   "退出"
         Height          =   370
         Left            =   2880
         TabIndex        =   8
         Top             =   240
         Width           =   800
      End
      Begin VB.CommandButton Command2 
         Caption         =   "保存"
         Height          =   370
         Left            =   1800
         TabIndex        =   7
         Top             =   240
         Width           =   800
      End
      Begin VB.CommandButton Command1 
         Caption         =   "增加"
         Height          =   370
         Left            =   720
         TabIndex        =   6
         Top             =   240
         Width           =   800
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2775
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4215
      Begin VB.TextBox Text2 
         Height          =   1815
         Left            =   960
         MaxLength       =   255
         TabIndex        =   4
         Text            =   "Text2"
         Top             =   840
         Width           =   3135
      End
      Begin VB.TextBox Text1 
         Height          =   400
         Left            =   960
         MaxLength       =   100
         TabIndex        =   3
         Text            =   "Text1"
         Top             =   240
         Width           =   3135
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "备注:"
         Height          =   180
         Left            =   480
         TabIndex        =   2
         Top             =   840
         Width           =   540
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "产品名称:"
         Height          =   180
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   900
      End
   End
End
Attribute VB_Name = "checkoptionlist"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'*    模 块 名 称 :产品检验的添加
'*    功 能 描 述 :产品检验的基本信息
'*    程序员姓名  :黄朝和
'*    最后修改人  :
'*    最后修改时间:2005/09/19
'*    备        注:
'*******************************************************
Option Explicit
Private m_checkoptionDAO As checkoptionDAO      ' 数据库操作类
Private m_recordset As ADODB.Recordset          ' 数据操作数据集对象
Public c_type As Integer                        ' 0--表示修改,1--表示增加
Private s_recordset As ADODB.Recordset
Dim ret As Boolean

Private Sub Command1_Click()
    c_type = 1
    If Not Check Then                               ' 判断输入文本的内容
                Exit Sub
    End If
        ret = m_checkoptionDAO.checkoption_new(m_recordset, Trim(Text1.text), Trim(Text2.text))
        Text1.text = ""
        Text2.text = ""
End Sub

Private Sub Command2_Click()
    If Not Check Then                               ' 判断输入文本的内容
            Exit Sub
    End If
    If c_type = 1 Then
        ret = m_checkoptionDAO.checkoption_new(m_recordset, Trim(Text1.text), Trim(Text2.text))
    ElseIf c_type = 0 Then
        ret = m_checkoptionDAO.checkoption_modify(m_recordset, Trim(Text1.Tag), Trim(Text1.text), Trim(Text2.text))
    End If
        Unload Me
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    Set m_checkoptionDAO = New checkoptionDAO
    Set m_recordset = New ADODB.Recordset
    Set s_recordset = New ADODB.Recordset
        SetToCenter Me
    If c_type = 0 Then
        Me.caption = "检验产品项目修改"
        Command1.Visible = False
        Text1.Tag = Trim(checkoption.MSHFlexGrid1.TextMatrix(checkoption.c_rowname, 0))
        Text1.text = Trim(checkoption.MSHFlexGrid1.TextMatrix(checkoption.c_rowname, 1))
        Text2.text = Trim(checkoption.MSHFlexGrid1.TextMatrix(checkoption.c_rowname, 2))
        Text2.Tag = Trim(checkoption.MSHFlexGrid1.TextMatrix(checkoption.c_rowname, 1))
    ElseIf c_type = 1 Then
        Text1.text = ""
        Text2.text = ""
    End If
End Sub
Private Function Check() As Boolean             '判断文本框内容的有效性
    Check = True
    If Len(Trim(Text1.text)) = 0 Then
        MainForm.g_msgText = "产品检验名称不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text1.SetFocus
        Check = False
        Exit Function
    End If
     If c_type = 0 Then
        Dim l As Integer
        ret = m_checkoptionDAO.checkoption_findname(s_recordset, Trim(Text2.Tag))
        Do While Not s_recordset.EOF
            If Text1.text = Trim(s_recordset.Fields("name")) Then
                MsgBox "该产品检验名称已经存在", vbOKOnly, "提示"
                Text1.SetFocus
                Check = False
                Exit Function
            End If
        s_recordset.MoveNext
        l = l + 1
        Loop
    ElseIf c_type = 1 Then
        ret = m_checkoptionDAO.checkoption_findbyname(s_recordset, Trim(Text1.text))
        If ret Then
            MsgBox "该产品检验名称已经存在", vbOKOnly, "提示"
            Text1.SetFocus
            Check = False
            Exit Function
        End If
    End If
    s_recordset.Close
End Function

⌨️ 快捷键说明

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