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

📄 frmdocman.frm

📁 用vb编的一个软件项目开发系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form FrmDocMan 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "项目文档管理"
   ClientHeight    =   7020
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8895
   Icon            =   "FrmDocMan.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7020
   ScaleWidth      =   8895
   StartUpPosition =   2  '屏幕中心
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   3600
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_DocApp 
      Caption         =   "追加文档"
      Height          =   400
      Left            =   4505
      MouseIcon       =   "FrmDocMan.frx":1272
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   6360
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_View 
      Caption         =   "查看文档"
      Height          =   400
      Left            =   5921
      MouseIcon       =   "FrmDocMan.frx":157C
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   6360
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Del 
      Caption         =   "删 除"
      Height          =   400
      Left            =   3089
      MouseIcon       =   "FrmDocMan.frx":1886
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   6360
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Modi 
      Caption         =   "修 改"
      Height          =   400
      Left            =   1673
      MouseIcon       =   "FrmDocMan.frx":1B90
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   6360
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Add 
      Caption         =   "添 加"
      Height          =   400
      Left            =   257
      MouseIcon       =   "FrmDocMan.frx":1E9A
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   6360
      Width           =   1300
   End
   Begin VB.ComboBox ComboType 
      Height          =   300
      ItemData        =   "FrmDocMan.frx":21A4
      Left            =   1560
      List            =   "FrmDocMan.frx":21BA
      Style           =   2  'Dropdown List
      TabIndex        =   0
      Top             =   240
      Width           =   1575
   End
   Begin VB.CommandButton Cmd_Back 
      Caption         =   "返 回"
      Height          =   400
      Left            =   7337
      MouseIcon       =   "FrmDocMan.frx":21FA
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   6360
      Width           =   1300
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "FrmDocMan.frx":2504
      Height          =   5415
      Left            =   0
      TabIndex        =   1
      Top             =   720
      Width           =   8895
      _ExtentX        =   15690
      _ExtentY        =   9551
      _Version        =   393216
      AllowUpdate     =   0   'False
      AllowArrows     =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   -120
      Top             =   6720
      Visible         =   0   'False
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=SoftSys"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "SoftSys"
      OtherAttributes =   ""
      UserName        =   "sa"
      Password        =   "sa"
      RecordSource    =   "SELECT * FROM Document"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   1800
      Top             =   6720
      Visible         =   0   'False
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=SoftSys"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "SoftSys"
      OtherAttributes =   ""
      UserName        =   "sa"
      Password        =   "sa"
      RecordSource    =   "SELECT * FROM Document"
      Caption         =   "Adodc2"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "文档类型:"
      Height          =   180
      Left            =   480
      TabIndex        =   8
      Top             =   300
      Width           =   900
   End
End
Attribute VB_Name = "FrmDocMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Doc()
  Adodc1.RecordSource = "SELECT DocId As 文档编号, Title As 标题, Author As 作者," _
        + " SaveTime As 保存时间 FROM Document WHERE DocType=" + Trim(ComboType.ListIndex + 1) _
        + " And ProjId=" + Trim(CurProj.ProjId) + " ORDER BY DocId DESC"
  Adodc1.Refresh
End Sub

Private Sub Cmd_Add_Click()
  FrmDocEdit.Modify = False
  FrmDocEdit.ComboType.Text = ComboType.Text
  FrmDocEdit.lblAuthor = CurUser.Ename
  FrmDocEdit.lblSaveTime = Format(Now, "yyyy-mm-dd")
  FrmDocEdit.Show 1
  Refresh_Doc
End Sub

Private Sub Cmd_Back_Click()
  Unload Me
End Sub

Private Sub Cmd_Del_Click()
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择要删除的文档信息"
    Exit Sub
  End If
  If Trim(Adodc1.Recordset.Fields(2)) <> CurUser.Ename Then
    MsgBox "只有作者才能删除此文档信息"
    Exit Sub
  End If
  If MsgBox("是否删除此文档?", vbYesNo, "请确认") = vbYes Then
    MyRep.Delete (Adodc1.Recordset.Fields(0))
    Refresh_Doc
  End If
End Sub

Private Sub Cmd_DocApp_Click()
  Dim DiskFile As String '用来保存选择的文件
  '如果没有选择文档,则返回
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择文档信息"
    Exit Sub
  End If
  'Adodc2用来保存调用SaveDoc,保存文档
  Adodc2.RecordSource = "SELECT * FROM Document WHERE DocId=" + Trim(Adodc1.Recordset.Fields(0))
  Adodc2.Refresh
  '使用CommonDialog控件读取文档文件
  CommonDialog1.Filter = "DOC文件(*.Doc)|*.Doc"
  '初始化文件名
  CommonDialog1.FileName = ""
  CommonDialog1.ShowOpen
  DiskFile = CommonDialog1.FileName
  If DiskFile = "" Then
    MsgBox "请选择文档文件"
    Exit Sub
  End If
  '保存文档名称
  Call MyDoc.UpdatefName(Adodc1.Recordset.Fields(0), DiskFile)
  '存储文档
  Call SaveDoc(DiskFile, Adodc2, 5)
  MsgBox "文档保存成功"
End Sub

Private Sub Cmd_Modi_Click()
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择要修改的文档"
    Exit Sub
  End If
  If Trim(Adodc1.Recordset.Fields(2)) <> CurUser.Ename Then
    MsgBox "只有作者才能修改此报告"
    Exit Sub
  End If
  
  FrmDocEdit.Modify = True
  FrmDocEdit.OriId = Adodc1.Recordset.Fields(0)
  FrmDocEdit.ComboType.Text = ComboType.Text
  FrmDocEdit.OriTitle = Trim(Adodc1.Recordset.Fields(1))
  FrmDocEdit.txtTitle = Trim(Adodc1.Recordset.Fields(1))
  FrmDocEdit.lblAuthor = Trim(Adodc1.Recordset.Fields(2))
  FrmDocEdit.lblSaveTime = Trim(Adodc1.Recordset.Fields(3))
  FrmDocEdit.Show 1
  Refresh_Doc
End Sub

Private Sub Cmd_View_Click()
  '判断是否选择了要查看的文档
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择要查看的文档"
    Exit Sub
  End If
  '读取要查看文档的记录信息到Adodc2
  Adodc2.RecordSource = "SELECT * FROM Document WHERE DocId=" + Trim(Adodc1.Recordset.Fields(0))
  Adodc2.Refresh
  '读取文档记录信息到MyDoc
  MyDoc.GetInfo (Adodc1.Recordset.Fields(0))
  If MyDoc.fName = "" Then
    MsgBox "没有保存文档"
    Exit Sub
  End If
  '调用ShowDoc函数,显示文档内容
  Call ShowDoc(Adodc2)
End Sub

Private Sub ComboType_Click()
  Refresh_Doc
End Sub

Private Sub Form_Load()
  ComboType.ListIndex = 0
  Refresh_Doc
End Sub


⌨️ 快捷键说明

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