meetcarbillfind.frm

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

FRM
341
字号
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 MeetCarBillFind 
   BackColor       =   &H8000000D&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "维修工作单选择"
   ClientHeight    =   4950
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8115
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4950
   ScaleWidth      =   8115
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1080
      TabIndex        =   4
      Top             =   0
      Width           =   3495
   End
   Begin VB.ComboBox Combo1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   4920
      TabIndex        =   3
      Top             =   0
      Width           =   2535
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取 消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   1
      Top             =   4440
      Width           =   1215
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确 定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2400
      TabIndex        =   0
      Top             =   4440
      Width           =   1215
   End
   Begin MSComctlLib.ListView lstBillDocu 
      Height          =   3855
      Left            =   0
      TabIndex        =   2
      Top             =   480
      Width           =   8055
      _ExtentX        =   14208
      _ExtentY        =   6800
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   0
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         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
   Begin BSE_Engine.BSE BSE1 
      Left            =   480
      Top             =   4200
      _ExtentX        =   6588
      _ExtentY        =   1085
   End
   Begin VB.Label Label10 
      BackColor       =   &H8000000D&
      Caption         =   "查询条件:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   375
      Left            =   0
      TabIndex        =   5
      Top             =   120
      Width           =   1695
   End
End
Attribute VB_Name = "MeetCarBillFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim NewRecord As Boolean
Dim LastSortIndex As Long, LastSortDir As Long
Private VarOption As Integer
Private ModifyBS As Boolean
Public lstBillDocuIndex As Long
Private SearchGoodsKey As String










Private Sub CarDocuFind_Change()

End Sub

Private Sub cmdCancel_Click()
 Unload Me
End Sub

Private Sub cmdOk_Click()
 Dim i As Long
 Dim TempRS As MYSQL_RS
 Dim TempSQL As String
 Dim TemplstCount As Long, TempCount As Long, TempMoney As Long
 Dim TempRebate As Double
 If Not lstBillDocu.SelectedItem Is Nothing Then
  With lstBillDocu.SelectedItem
     MaintainPartBill.lblProvide = .Text
     MaintainPartBill.lblCarno = .SubItems(3)

  End With
  TempSQL = VarInitData.DisplaySQLVal(33) & "Where billnum = " & Quote(lstBillDocu.SelectedItem.Text)
  Set TempRS = New MYSQL_RS
  TempRS.OpenRs TempSQL, gCnn
  TempRebate = TempRS.Fields("partrebate")
  TempRS.CloseRecordset
  TempRS.ReleaseMemory
  Set TempRS = Nothing
  
  TempSQL = VarInitData.DisplaySQLVal(35) & "Where billnum = " & Quote(lstBillDocu.SelectedItem.Text)
  Set TempRS = New MYSQL_RS
  TempRS.OpenRs TempSQL, gCnn
  With TempRS
   Do Until .EOF
    MaintainPartBill.lstBillDocu.ListItems.Add
    i = MaintainPartBill.lstBillDocu.ListItems.Count
    LoadToDrawBillDocu TempRS, MaintainPartBill.lstBillDocu, i, TempRebate
    .MoveNext
   Loop
   .CloseRecordset
   .ReleaseMemory
  End With
  Set TempRS = Nothing
  
  With MaintainPartBill
   TemplstCount = .lstBillDocu.ListItems.Count
   .lblGItemCount = TemplstCount
   TempCount = 0
   TempMoney = 0
   For i = 1 To TemplstCount
    TempCount = TempCount + Val(.lstBillDocu.ListItems(i).SubItems(3))
    TempMoney = TempMoney + Val(.lstBillDocu.ListItems(i).SubItems(5))
   Next i
   .lblGCount = TempCount
   .lblGMoney = VarFunction.DefFormat(TempMoney)
   If .lstBillDocu.ListItems.Count > 0 Then .lstBillDocuIndex = 1
   'VarInitData.DealListView MaintainPartBill.lstBillDocu, MaintainPartBill.lstBillDocuIndex
  End With

 End If
 Unload Me
End Sub

Private Sub Combo1_Click()
 Select Case Combo1.ListIndex
   Case 0
    SearchGoodsKey = "carno"
   Case 1
    SearchGoodsKey = "meetcarman"
   Case 2
    SearchGoodsKey = "meetcardate"
   Case 3
    SearchGoodsKey = "vin_no"
 End Select
 VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End Sub

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
 Combo1.Text = ""
End Sub

Private Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
 Combo1.Text = ""
End Sub

Private Sub Form_Activate()
 VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End Sub

Private Sub Form_Load()
  Dim i As Integer
  Dim TempSQL As String
    VarInitData.InitBSE BSE1, 0
    Combo1.AddItem "牌照号码"
    Combo1.AddItem "接车员"
    Combo1.AddItem "接车日期"
    Combo1.AddItem "VIN号码"
    SearchGoodsKey = "carno"
    Combo1.ListIndex = 0
    TempSQL = "Select billnum, meetcarman, meetcardate, carno, plandate, budgetcost, earnest, vin_no from meetcartable"
    VarInitData.LoadData lstBillDocu, TempSQL
    
End Sub







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

End Sub

Private Sub lstBillDocu_ItemClick(ByVal Item As MSComctlLib.ListItem)
 lstBillDocuIndex = Item.Index
 
End Sub



Private Sub Text1_Change()
 Dim TempSQL As String
 If Text1.Text <> "" Then
  TempSQL = VarInitData.DisplaySQLVal(33) & " Where " & SearchGoodsKey & " like " & Quote(Text1.Text & "%")
  VarInitData.LoadData lstBillDocu, TempSQL
 Else
  VarInitData.LoadData lstBillDocu, VarInitData.DisplaySQLVal(33)
 End If
 'VarInitData.DealListView lstBillDocu, lstBillDocuIndex
End Sub
Private Sub LoadToDrawBillDocu(VarRS As MYSQL_RS, lstBillDocu As ListView, ByVal i As Long, ByVal VarRebate As Double)
 Dim TempDouble As Double
  With VarRS
   lstBillDocu.ListItems(i).Text = .Fields("goodscoding")
   lstBillDocu.ListItems(i).SubItems(1) = .Fields("goodsname")
   lstBillDocu.ListItems(i).SubItems(2) = .Fields("goodsstandard")
   lstBillDocu.ListItems(i).SubItems(3) = .Fields("goodscount")
   lstBillDocu.ListItems(i).SubItems(4) = .Fields("unit")
  ' lstBillDocu.ListItems(i).SubItems(5) = .Fields("goodsprice")
   TempDouble = VarRebate '.Fields("partrebate")
  ' TempLong = .Fields("workrebate")
   If TempDouble <= 0 Then TempDouble = 100
   'TempLong = 100
   lstBillDocu.ListItems(i).SubItems(5) = VarFunction.DefFormat(.Fields("money") * TempDouble / 100)
   lstBillDocu.ListItems(i).SubItems(6) = .Fields("sellprice")
   lstBillDocu.ListItems(i).SubItems(7) = .Fields("brand")
   lstBillDocu.ListItems(i).SubItems(8) = .Fields("goodssort")
   lstBillDocu.ListItems(i).SubItems(9) = .Fields("producehere")
   lstBillDocu.ListItems(i).SubItems(10) = .Fields("replacecoding")
   '.Update
  End With
  
End Sub




⌨️ 快捷键说明

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