quotebill.frm

来自「一个关于电脑管理汽车的软件」· FRM 代码 · 共 1,533 行 · 第 1/4 页

FRM
1,533
字号
            ForeColor       =   &H00800000&
            Height          =   255
            Index           =   14
            Left            =   8880
            TabIndex        =   30
            Top             =   1440
            Width           =   495
         End
      End
      Begin MSComctlLib.ListView lstAddress 
         Height          =   6495
         Left            =   120
         TabIndex        =   45
         Top             =   480
         Width           =   9015
         _ExtentX        =   15901
         _ExtentY        =   11456
         View            =   3
         LabelEdit       =   1
         LabelWrap       =   -1  'True
         HideSelection   =   0   'False
         FullRowSelect   =   -1  'True
         GridLines       =   -1  'True
         _Version        =   393217
         ForeColor       =   8388608
         BackColor       =   -2147483628
         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
      Begin MSComctlLib.ListView lstBillDocu 
         Height          =   3615
         Left            =   -74880
         TabIndex        =   46
         Top             =   3240
         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
End
Attribute VB_Name = "QuoteBillTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Dim NewRecord As Boolean
Dim LastSortIndex As Long, LastSortDir As Long
Private VarOption As Integer
Public lstAddressIndex As Long
Public ModifyBS As Boolean
Public lstBillDocuIndex As Long
Public BillStateBS As Integer
Public OrgRS As ChangeHistory







Private Sub cmbCheckMan_KeyDown(KeyCode As Integer, Shift As Integer)
 cmbCheckMan.Text = ""
End Sub

Private Sub cmbCheckMan_KeyUp(KeyCode As Integer, Shift As Integer)
 cmbCheckMan.Text = ""
End Sub

Private Sub cmbInvoiceType_KeyDown(KeyCode As Integer, Shift As Integer)
 cmbInvoiceType.Text = "'"
End Sub

Private Sub cmbInvoiceType_KeyUp(KeyCode As Integer, Shift As Integer)
 cmbInvoiceType.Text = ""
End Sub

Private Sub CmbPayWay_KeyDown(KeyCode As Integer, Shift As Integer)
 CmbPayWay.Text = ""
End Sub

Private Sub CmbPayWay_KeyUp(KeyCode As Integer, Shift As Integer)
 CmbPayWay.Text = ""
End Sub

Private Sub cmbPrincipal_KeyDown(KeyCode As Integer, Shift As Integer)
 cmbPrincipal.Text = ""
End Sub

Private Sub cmbPrincipal_KeyUp(KeyCode As Integer, Shift As Integer)
 cmbPrincipal.Text = ""
End Sub

Private Sub cmdFind_Click()
 VarInitData.SearchClientData = 6
 ClientDataFind.Show 1
End Sub

Private Sub Command1_Click(Index As Integer)
 Dim i As Integer
 Dim TempRS As MYSQL_RS
 Dim TempVar As Long
 Dim TempSQL As String
 Dim TempBillType As Integer
 Select Case Index
  Case 0
    VarInitData.SellBS = True
    SearchGoods12.Show 1
  Case 1
    BillStateBS = 1
    For i = 0 To 3
     With Command3(i)
      .left = Command1(i).left
      .top = Command1(i).top
      .Visible = True
     End With
    Next i
    For i = 0 To 6
     Command1(i).Visible = False
    Next i
    Frame2.Enabled = True
    ClearFrame2
    
    lblOperateMan = CurrentOperate

    If SSStock.Tab = 1 Then
     SSStock.TabEnabled(0) = False
     SSStock_Click 0
    Else
     SSStock.Tab = 1
     SSStock.TabEnabled(0) = False
    End If
  Case 2
   If lstAddressIndex > 0 And lstAddress.ListItems.Count > 0 Then
    BillStateBS = 2
    For i = 0 To 3
     With Command3(i)
      .left = Command1(i).left
      .top = Command1(i).top
      .Visible = True
     End With
    Next i
    For i = 0 To 6
     Command1(i).Visible = False
    Next i
    Frame2.Enabled = True
    SSStock.Tab = 1
    SSStock.TabEnabled(0) = False
   End If
  Case 3
    If lstAddressIndex > 0 And lstAddress.ListItems.Count > 0 Then
     If MsgBox("确定删除这条记录吗?", vbOKCancel, VarInitData.SysPrompt) = vbOK Then
      TempSQL = "Delete From quotebilltable Where billnum = " & Quote(Trim(lstAddress.ListItems(lstAddressIndex).Text))
      gCnn.Execute TempSQL
      TempSQL = "Delete From quotebilltable2 Where billnum = " & Quote(Trim(lstAddress.ListItems(lstAddressIndex).Text))
      gCnn.Execute TempSQL
      TempSQL = VarInitData.DisplaySQLVal(27)
      VarInitData.LoadData lstAddress, TempSQL
      ClearFrame2
      lstBillDocu.ListItems.Clear
     End If
    End If
  Case 4
   TempSQL = VarInitData.DisplaySQLVal(27)
   VarInitData.LoadData lstAddress, TempSQL
  Case 5
   ChangeToSellBill
  Case 6
   If lstAddress.SelectedItem Is Nothing Then Exit Sub
   VarCrystal.DispalyQuoteReport lstAddress.SelectedItem.Text, 27

 End Select
 VarInitData.DealListView lstAddress, lstAddressIndex
End Sub



Private Sub Command3_Click(Index As Integer)
 Dim TempSQL As String
 Dim TempCount As Long, TempMoney As Long
 Dim TempMoney2 As Long, TemplstCount As Long
 Dim i As Long, j As Long, TempFindIndex As Long
 Dim TempRS As MYSQL_RS
 Select Case Index
  Case 0 '增加新的记录"
  ' If lblBillNum.Caption <> "" Then
    AddRow5.Show 1
  ' End If
  Case 1 '删除记录
   If lstBillDocu.ListItems.Count > 0 And lstBillDocuIndex > 0 Then
    If MsgBox("确定删除这条记录吗?", vbOKCancel, VarInitData.SysPrompt) = vbOK Then
     lstBillDocu.ListItems.Remove lstBillDocuIndex
     OrgRS.DeleteKeyRS lstBillDocuIndex
     With QuoteBillTable
      TemplstCount = .lstBillDocu.ListItems.Count
      .lblGItemCount = TemplstCount
      TempCount = 0
      TempMoney = 0
      TempMoney2 = 0
      For i = 1 To TemplstCount
       TempCount = TempCount + Val(.lstBillDocu.ListItems(i).SubItems(3))
       TempMoney = TempMoney + Val(.lstBillDocu.ListItems(i).SubItems(4))
       TempMoney2 = TempMoney2 + Val(.lstBillDocu.ListItems(i).SubItems(5))
      Next i
      .lblGCount = TempCount
      .lblGMoney = TempMoney
      .lblGMoney2 = TempMoney2
    End With
    End If
   End If
  Case 2 '保存
   If lblProvide = "" Then
    MsgBox "购物单位不能为空", , VarInitData.SysPrompt
    Exit Sub
   End If
   SaveToSellBill
   VarOption = 0
   If lstBillDocu.ListItems.Count > 0 And lstBillDocuIndex > 0 Then
    If OrgRS.KeyCount > 0 Or OrgRS.DelKeyCount > 0 Then
     TempSQL = "select * from quotebilltable2" & " Where billnum = " & Quote(Trim(lblBillNum.Caption))
     Set TempRS = New MYSQL_RS
     TempRS.OpenRs TempSQL, gCnn
     With TempRS
      If OrgRS.DelKeyCount > 0 Then
       For j = 1 To OrgRS.DelKeyCount
        .MoveFirst
        .MovePrevious
        TempFindIndex = .FindNext("AKey", CStr(OrgRS.DelKeyRSValue(j)))
        If TempFindIndex > -1 Then
          .Delete
          .Update
        End If
       Next j
      End If
      i = 0
      If OrgRS.KeyCount > 0 Then
       .MoveFirst
       .MovePrevious
       For j = 1 To OrgRS.KeyCount
         TempFindIndex = .FindNext("AKey", CStr(OrgRS.KeyRSValue(j)))
         If TempFindIndex > -1 Then
          i = i + 1
          SaveToSellBillDocu TempRS, lstBillDocu, i
         End If
       Next j
      End If
      .CloseRecordset
      .ReleaseMemory
      Set TempRS = Nothing
     End With
    End If
     TempSQL = "select * from quotebilltable2" '& " Where billnum = " & Quote(Trim(lblBillNum.Caption))
     Set TempRS = New MYSQL_RS
     TempRS.OpenRs TempSQL, gCnn
    With TempRS
     If .RecordCount > 0 Then
      .MoveLast
      .MoveNext
     End If
     i = i + 1
     TempCount = lstBillDocu.ListItems.Count
     If i <= TempCount Then
      For j = i To TempCount
      ' .MoveNext
       SaveToSellBillDocu TempRS, lstBillDocu, j
      Next j
     End If
     .CloseRecordset
     .ReleaseMemory
     Set TempRS = Nothing
    End With
   End If
   Frame2.Enabled = False
   BillStateBS = 0
   For i = 0 To 3
    Command3(i).Visible = False
   Next i
   For i = 0 To 6
    Command1(i).Visible = True
   Next i
   SSStock.TabEnabled(0) = True
   SSStock.Tab = 0
  Case 3
   VarOption = 0
   Frame2.Enabled = False
   BillStateBS = 0
   For i = 0 To 3
    Command3(i).Visible = False
   Next i
   For i = 0 To 6
    Command1(i).Visible = True
   Next i
   SSStock.TabEnabled(0) = True
   SSStock.Tab = 0
 End Select
 VarInitData.DealListView lstBillDocu, lstBillDocuIndex

End Sub

Private Sub Form_Activate()
    VarInitData.DealListView lstAddress, lstAddressIndex

End Sub

Private Sub Form_Load()
  Dim i As Integer
  Dim TempSQL As String
  
    VarInitData.InitBSE BSE1
    Frame2.Visible = False
    Frame2.Enabled = False
    lstBillDocu.Visible = False
    lstAddress.Visible = True

⌨️ 快捷键说明

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