constructtable.frm

来自「一个关于电脑管理汽车的软件」· FRM 代码 · 共 260 行

FRM
260
字号
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Object = "{40D97E01-4259-4398-B597-183C348B488F}#1.0#0"; "BSE.ocx"
Begin VB.Form ConstructTable 
   Caption         =   "施工项目作业"
   ClientHeight    =   7800
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   11415
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   7800
   ScaleWidth      =   11415
   Begin BSE_Engine.BSE BSE1 
      Left            =   1440
      Top             =   6360
      _ExtentX        =   6588
      _ExtentY        =   1085
   End
   Begin VB.Frame frameInfo 
      Height          =   855
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   11775
      Begin VB.CommandButton Command1 
         Height          =   495
         Index           =   0
         Left            =   4200
         Picture         =   "ConstructTable.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   3
         ToolTipText     =   "搜索"
         Top             =   240
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Height          =   495
         Index           =   5
         Left            =   7200
         Picture         =   "ConstructTable.frx":014A
         Style           =   1  'Graphical
         TabIndex        =   2
         ToolTipText     =   "审核"
         Top             =   240
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Height          =   495
         Index           =   6
         Left            =   7800
         Picture         =   "ConstructTable.frx":0294
         Style           =   1  'Graphical
         TabIndex        =   1
         ToolTipText     =   "打印"
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label10 
         Caption         =   "施工项目作业"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   4
         Top             =   360
         Width           =   1575
      End
   End
   Begin MSComctlLib.ListView lstBillDocu 
      Height          =   3615
      Left            =   0
      TabIndex        =   5
      Top             =   1680
      Width           =   9855
      _ExtentX        =   17383
      _ExtentY        =   6376
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   8388608
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   4
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "Name"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "Address"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "City, State, Zip"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "Notes"
         Object.Width           =   2540
      EndProperty
   End
End
Attribute VB_Name = "ConstructTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click(Index As Integer)
 Dim TempSQL As String
 Dim TempRS As MYSQL_RS
 Dim FindBS As Long
 Dim FinishBS As Boolean
 FinishBS = False
 If lstBillDocu.SelectedItem Is Nothing Then Exit Sub
 If MsgBox("确定此维修单完工?", vbOKCancel, VarInitData.SysPrompt) = vbOK Then
  
  Set TempRS = New MYSQL_RS
  TempSQL = VarInitData.DisplaySQLVal(34) & " Where billnum = " & Quote(lstBillDocu.SelectedItem.Text) '& " and datacontxt = " & Quote(lstBillDocu.SelectedItem.SubItems(5))
  TempRS.OpenRs TempSQL, gCnn
  With TempRS
   If .RecordCount = 1 Then
    .Fields("typebs") = 2
    .Update
    FinishBS = True
   ElseIf .RecordCount > 1 Then
    .MovePrevious
    FindBS = .FindNext("datacontxt", lstBillDocu.SelectedItem.SubItems(5))
    If FindBS > 0 Then
     .Fields("typebs") = 2
     .Update
    End If
   End If
   .CloseRecordset
   .ReleaseMemory
  End With
  Set TempRS = Nothing
  
  If FinishBS = True Then
   Set TempRS = New MYSQL_RS
   TempSQL = VarInitData.DisplaySQLVal(33) & " Where billnum = " & Quote(lstBillDocu.SelectedItem.Text) '& " and datacontxt = " & Quote(lstBillDocu.SelectedItem.SubItems(5))
   TempRS.OpenRs TempSQL, gCnn
   With TempRS
    .Fields("typebs") = 2
    .Update
    .CloseRecordset
    .ReleaseMemory
   End With
   Set TempRS = Nothing
  End If
  lstBillDocu.ListItems.Remove lstBillDocu.SelectedItem.Index
 End If
End Sub

Private Sub Form_Load()
 Dim i As Integer
 
 VarInitData.InitBSE BSE1
 InitListView
 AddToListView
 
End Sub

Private Sub Form_Resize()
 If Me.ScaleHeight > 0 And Me.ScaleWidth > 0 Then
  frameInfo.left = Me.ScaleLeft
  frameInfo.top = Me.ScaleTop
  frameInfo.Width = Me.ScaleWidth
  lstBillDocu.top = frameInfo.top + frameInfo.Height
  lstBillDocu.left = 70
  lstBillDocu.Width = Me.ScaleWidth - 140
  lstBillDocu.Height = Me.ScaleHeight - frameInfo.Height '- 200
 End If

End Sub
Private Sub InitListView()
 lstBillDocu.ColumnHeaders.Clear
 With lstBillDocu.ColumnHeaders
  .Add , , "单号"
  .Add , , "车牌号码"
  .Add , , "VIN号码"
  .Add , , "接车日期"
  .Add , , "类别"
  .Add , , "施工项目"
  .Add , , "主修人"
 End With
End Sub
Private Sub AddToListView()
 Dim TempSQL As String
 Dim TempRS As MYSQL_RS
 Dim TempRS2 As MYSQL_RS
 Dim i As Long, TempIndex As Long
  Set TempRS = New MYSQL_RS
  TempSQL = VarInitData.DisplaySQLVal(33) '& " Where billnum = " & Quote(Label2(0))
  TempRS.OpenRs TempSQL, gCnn
  With TempRS
   Do Until .EOF
    If .Fields("typebs") = 1 Then
      Set TempRS2 = New MYSQL_RS
      TempSQL = VarInitData.DisplaySQLVal(34) & " Where billnum = " & Quote(.Fields("billnum"))
      TempRS2.OpenRs TempSQL, gCnn
      Do Until TempRS2.EOF
      If TempRS2.Fields("typebs") = 1 Then
       lstBillDocu.ListItems.Add
       TempIndex = lstBillDocu.ListItems.Count
       With lstBillDocu.ListItems(TempIndex)
        .Text = TempRS.Fields("billnum")
        .SubItems(1) = TempRS.Fields("carno")
        .SubItems(2) = TempRS.Fields("vin_no")
        .SubItems(3) = TempRS.Fields("meetcardate")
        .SubItems(4) = TempRS2.Fields("sort")
        .SubItems(5) = TempRS2.Fields("datacontxt")
        .SubItems(6) = TempRS2.Fields("maintainman")
       End With
      End If
      TempRS2.MoveNext
      Loop
      TempRS2.CloseRecordset
      TempRS2.ReleaseMemory
      Set TempRS2 = Nothing

    End If
    .MoveNext
   Loop
   .CloseRecordset
   .ReleaseMemory
  End With
  Set TempRS = Nothing
  
 
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
 If BSE1.EngineStarted Then BSE1.EndSubClassing
End Sub

⌨️ 快捷键说明

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