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

📄 form_openinfo_list.frm

📁 2008年版
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   End
   Begin VB.Label Label9 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "发布机构"
      ForeColor       =   &H000000C0&
      Height          =   255
      Left            =   540
      TabIndex        =   28
      Top             =   2010
      Width           =   1215
   End
   Begin VB.Label Label10 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "产生日期"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   495
      Left            =   540
      TabIndex        =   27
      Top             =   2370
      Width           =   1215
   End
   Begin VB.Label Label12 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "公开类别"
      ForeColor       =   &H000000C0&
      Height          =   255
      Left            =   5100
      TabIndex        =   26
      Top             =   2370
      Width           =   1455
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "载体类型"
      ForeColor       =   &H00000000&
      Height          =   495
      Left            =   540
      TabIndex        =   25
      Top             =   3930
      Width           =   1335
   End
   Begin VB.Label Label8 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "记录形式"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   4860
      TabIndex        =   24
      Top             =   3930
      Width           =   1815
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "关键词"
      ForeColor       =   &H000000C0&
      Height          =   735
      Left            =   540
      TabIndex        =   23
      Top             =   4530
      Width           =   1215
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "-"
      Height          =   135
      Left            =   3300
      TabIndex        =   21
      Top             =   570
      Width           =   255
   End
   Begin VB.Label Label4 
      Caption         =   "Label4"
      Height          =   15
      Left            =   4380
      TabIndex        =   20
      Top             =   690
      Width           =   135
   End
   Begin VB.Label Label17 
      BackStyle       =   0  'Transparent
      Caption         =   "-"
      Height          =   255
      Left            =   4260
      TabIndex        =   19
      Top             =   570
      Width           =   255
   End
   Begin VB.Label Label16 
      BackStyle       =   0  'Transparent
      Caption         =   "备注"
      ForeColor       =   &H00000000&
      Height          =   345
      Left            =   780
      TabIndex        =   18
      Top             =   5610
      Width           =   795
   End
   Begin VB.Label Label18 
      BackStyle       =   0  'Transparent
      Height          =   405
      Left            =   2010
      TabIndex        =   17
      Top             =   600
      Width           =   585
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "公开信息著录"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   3240
      TabIndex        =   0
      Top             =   60
      Width           =   2235
   End
End
Attribute VB_Name = "form_Openinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCode As String '公开信息 索取号 update关键字
Private Sub Combo1_KeyPress(KeyAscii As Integer)
    KeyAscii = 0
End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)
    KeyAscii = 0
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
    KeyAscii = 0
End Sub

Private Sub Command1_Click()
On Error GoTo e:
    
    If Text1.text = "" Then MsgBox "索取号不能为空!", 64, "": Text1.SetFocus: Exit Sub
    If Text13.text = "" Then MsgBox "索取号不能为空!", 64, "": Text13.SetFocus: Exit Sub
    If Text14.text = "" Then MsgBox "索取号不能为空!", 64, "": Text14.SetFocus: Exit Sub
    If Text2.text = "" Then MsgBox "信息名称不能为空!", 64, "": Text2.SetFocus: Exit Sub
    If Text5.text = "" Then MsgBox "发布机构不能为空!", 64, "": Text5.SetFocus: Exit Sub
    If Text7.text = "" Then MsgBox "内容描述不能为空!", 64, "": Text7.SetFocus: Exit Sub
    If Combo1.text = "" Then MsgBox "公开类别不能为空!", 64, "": Combo1.SetFocus: Exit Sub
    If Text10.text = "" Then MsgBox "关键词不能为空!", 64, "": Text10.SetFocus: Exit Sub
    If DTPicker2.Value < DTPicker1.Value Then MsgBox "失效日期必须超出产生日期!", 64, "": Exit Sub
    '**********************************公开类别增加
    If flag = "Insert" Then
        strSql = "select count(*) as ff from t_openinfo_record " + _
        "where str_catchNum_K='" & Trim(Text1.text + "-" + Text13.text + "-" + Text14.text) & "'"
        rs.Open strSql, conn
        If xml("ff") <> "0" Then MsgBox "索取号已存在!", 64, "": Text1.SetFocus: rs.Close: Exit Sub
        rs.Close
        strSql = "insert into t_openinfo_record(" + _
        "str_catchNum_K  ,str_fileTopic      ,str_fileNum        ,dt_generateDate" + _
        ",str_releaseOrg     ,str_category   ,str_description ,str_mediaType" + _
        ",str_infoType   ,str_keywords   ,str_contentURL ,dt_Annulment" + _
        ",str_describer  ,dt_descriptDate    ,str_memo" + _
        ")values(" + _
        "'" & Trim(Text1.text + "-" + Text13.text + "-" + Text14.text) & "','" & Text2.text & "','" & Text3.text & "','" & DTPicker1.Value & "'" + _
        ",'" & Text5.text & "','" & cob1(Combo1.text) & "','" & Text7.text & "','" & cob2(Combo2.text) & "'" + _
        ",'" & cob3(Combo3.text) & "','" & Text10.text & "','" & Text9.text & "','" & DTPicker2.Value & "'" + _
        ",'" & Text8.text & "','" & DTPicker3.Value & "','" & Text6.text & "')"
    End If
    '**********************************公开类别修改
    If flag = "Modify" Then
        strSql = "update t_openinfo_record set " + _
        "str_catchNum_K='" & Trim(Text1.text + "-" + Text13.text + "-" + Text14.text) & "'," + _
        "str_fileTopic='" & Text2.text & "'," + _
        "str_fileNum='" & Text3.text & "'," + _
        "dt_generateDate='" & DTPicker1.Value & "'," + _
        "str_releaseOrg='" & Text5.text & "'," + _
        "str_category='" & cob1(Combo1.text) & "'," + _
        "str_description='" & Text7.text & "'," + _
        "str_mediaType='" & cob2(Combo2.text) & "'," + _
        "str_infoType='" & cob3(Combo3.text) & "'," + _
        "str_keywords='" & Text10.text & "'," + _
        "str_contentURL='" & Text9.text & "'," + _
        "dt_Annulment='" & DTPicker2.Value & "'," + _
        "str_describer='" & Text8.text & "'," + _
        "dt_descriptDate='" & DTPicker3.Value & "'," + _
        "str_memo='" & Text6.text & "' " + _
        "where str_catchNum_K='" & strCode & "'"
    End If
    conn.Execute (strSql)
    MsgBox "保存成功!", vbInformation, ""
    Call form_Openinfo_grid.Refresh
Exit Sub
e:
MsgBox "数据格式不正确!", 64, ""
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Command3_Click()
    cd1.ShowOpen
    Text9.text = cd1.FileName
End Sub

Private Sub Form_Load()
    Combo1.Clear '公开类别
    Combo1.AddItem "主动公开"
    Combo1.AddItem "依申请公开"
    
    Combo2.Clear '载体类型
    Combo2.AddItem "纸质"
    Combo2.AddItem "胶卷"
    Combo2.AddItem "磁带"
    Combo2.AddItem "磁盘"
    Combo2.AddItem "光盘"
    Combo2.AddItem "其他"
    
    Combo3.Clear '记录形式
    Combo3.AddItem "文本"
    Combo3.AddItem "图表"
    Combo3.AddItem "照片"
    Combo3.AddItem "影音"
    Combo3.AddItem "其它"
    
    DTPicker1.Value = Date
    DTPicker2.Value = Date
    DTPicker3.Value = Date
    Dim strCatch As String, str1 As String, str2 As String, str3 As String
    Dim i As Integer, j As Integer
    '************************************以下为修改
    If flag = "Insert" Then Exit Sub
    strCatch = form_Openinfo_grid.ListView1.SelectedItem.text
    i = InStr(strCatch, "-")
    If i > 0 Then str1 = Left(strCatch, i - 1)
    j = InStrRev(strCatch, "-")
    If i > 0 And j > 0 Then str2 = Mid(strCatch, i + 1, j - i - 1)
    If j > 0 Then str3 = Mid(strCatch, j + 1)
    Text1.text = str1
    Text13.text = str2
    Text14.text = str3
    strSql = "select * from t_openinfo_record where str_catchNum_K='" & strCatch & "'"
    rs.Open strSql, conn
    If Not rs.EOF Then
        Text3.text = xml("str_fileNum")
        Text2.text = xml("str_fileTopic")
        Text5.text = xml("str_releaseOrg")
        If IsDate(xml("dt_generateDate")) Then DTPicker1.Value = xml("dt_generateDate")
        Combo1.text = cobb1(xml("str_category"))
        Text7.text = xml("str_description")
        Combo2.text = cobb2(xml("str_mediaType"))
        Combo3.text = cobb3(xml("str_infoType"))
        Text10.text = xml("str_keywords")
        If IsDate(xml("dt_Annulment")) Then DTPicker2.Value = xml("dt_Annulment")
        Text9.text = xml("str_contentURL")
        Text6.text = xml("str_memo")
        Text8.text = xml("str_describer")
        If IsDate(xml("dt_descriptDate")) Then DTPicker3.Value = xml("dt_descriptDate")
    End If
    rs.Close
    strCode = Trim(Text1.text + "-" + Text13.text + "-" + Text14.text)
End Sub
Function cob1(str As String) As String
Select Case str
Case "主动公开": cob1 = "A"
Case "依申请公开": cob1 = "B"
Case Else: cob1 = ""
End Select
End Function
Function cobb1(str As String) As String
Select Case str
Case "A": cobb1 = "主动公开"
Case "B": cobb1 = "依申请公开"
Case Else: cobb1 = ""
End Select
End Function
Function cob2(str As String) As String
Select Case str
Case "纸质": cob2 = "A"
Case "胶卷": cob2 = "B"
Case "磁带": cob2 = "C"
Case "磁盘": cob2 = "D"
Case "光盘": cob2 = "E"
Case "其他": cob2 = "F"
Case Else: cob2 = ""
End Select
End Function
Function cobb2(str As String) As String
Select Case str
Case "A": cobb2 = "纸质"
Case "B": cobb2 = "胶卷"
Case "C": cobb2 = "磁带"
Case "D": cobb2 = "磁盘"
Case "E": cobb2 = "光盘"
Case "F": cobb2 = "其他"
Case Else: cobb2 = ""
End Select
End Function
Function cob3(str As String) As String
Select Case str
Case "文本": cob3 = "A"
Case "图表": cob3 = "B"
Case "照片": cob3 = "C"
Case "影音": cob3 = "D"
Case "其它": cob3 = "E"
Case Else: cob3 = ""
End Select
End Function
Function cobb3(str As String) As String
Select Case str
Case "A": cobb3 = "文本"
Case "B": cobb3 = "图表"
Case "C": cobb3 = "照片"
Case "D": cobb3 = "影音"
Case "E": cobb3 = "其它"
Case Else: cobb3 = ""
End Select
End Function

⌨️ 快捷键说明

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