addstockbill.frm

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

FRM
658
字号
      Begin VB.Label Label1 
         Caption         =   "单号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   13
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "供应单位:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   12
         Top             =   960
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "进货日期:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   11
         Top             =   1440
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "支付方式:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   10
         Top             =   1920
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "负责人:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   4
         Left            =   240
         TabIndex        =   9
         Top             =   2400
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "验货人:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   5
         Left            =   240
         TabIndex        =   8
         Top             =   2880
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "总数量:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   6
         Left            =   240
         TabIndex        =   7
         Top             =   4680
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "总项数:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   7
         Left            =   240
         TabIndex        =   6
         Top             =   5640
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "总金额:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   255
         Index           =   12
         Left            =   240
         TabIndex        =   5
         Top             =   5160
         Width           =   1215
      End
   End
   Begin BSE_Engine.BSE BSE1 
      Left            =   840
      Top             =   6840
      _ExtentX        =   6588
      _ExtentY        =   1085
   End
End
Attribute VB_Name = "AddStockBill"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private VarOption As Integer



Private Sub cmdCancel_Click()
 Unload Me
End Sub

Private Sub cmdOk_Click()
 Dim TempRS As MYSQL_RS
 Dim i As Integer
 Dim TempSQL As String
    Set TempRS = New MYSQL_RS
    If StockTable.ModifyBS = True Then
     SQL = "Select * From stocktable Where billnum = " & Quote(Trim(StockTable.lstAddress.ListItems(StockTable.lstAddressIndex).Text))
    Else
     TempSQL = "Select * From counttable where countname =" & Quote("进货单号")
     TempRS.OpenRs TempSQL, gCnn
     TempRS.Fields("count").Value = TempRS.Fields("count").Value + 1
     TempRS.Update
     TempRS.CloseRecordset
     TempRS.ReleaseMemory
     Set TempRS = Nothing
     
     Set TempRS = New MYSQL_RS
     SQL = "Select * From stocktable" 'Where AKey = " & Val(txtAKey)
    End If
    TempRS.OpenRs SQL, gCnn
    If StockTable.ModifyBS = False Then
     If TempRS.RecordCount > 0 Then
      TempRS.MoveLast
      TempRS.MoveNext
     End If
    End If
    With TempRS
     If .EOF Then .AddNew
     .Fields("billnum") = lblBillNum(0).Caption
     .Fields("provide") = TexGoods(0)
     .Fields("stockdate") = DTPicker1.Value
     .Fields("payway") = Combo1(0).Text
     .Fields("principal") = Trim(Combo1(1).Text)
     .Fields("checkman") = Trim(Combo1(2).Text)
     .Fields("gcount") = Val(lblBillNum(1).Caption)
     .Fields("gmoney") = Val(lblBillNum(2).Caption)
     .Fields("gitemcount") = Val(lblBillNum(3).Caption)
     .Fields("operateman") = lblBillNum(4).Caption
     .Fields("invoicetype") = Trim(Combo1(3).Text)
     .Fields("invoiceno") = TexGoods(1)
     .Fields("billtype") = VarOption
          
     .Update
    End With
    Set TempRS = Nothing
    TempSQL = VarInitData.DisplaySQLVal(1)
    VarInitData.LoadData StockTable.lstAddress, TempSQL
    StockTable.ModifyBS = False
    Unload Me
End Sub


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

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

Private Sub Form_Activate()
 Dim TempRS As MYSQL_RS
 Dim TempVar As Integer
 Dim TempSQL As String
 Dim i As Integer
 ClearFrame
 If StockTable.ModifyBS = False Then
  Set TempRS = New MYSQL_RS
  TempSQL = "Select * From counttable where countname =" & Quote("进货单号")
  TempRS.OpenRs TempSQL, gCnn
  TempVar = TempRS.Fields(1).Value
  TempRS.CloseRecordset
  TempRS.ReleaseMemory
  Set TempRS = Nothing
  lblBillNum(0).Caption = VarInitData.DealVarNo(CStr(TempVar), 6, "J")
  lblBillNum(4).Caption = CurrentOperate
 Else
  With StockTable.lstAddress.ListItems(StockTable.lstAddress.SelectedItem.Index)
   lblBillNum(0) = .Text
   TexGoods(0) = .SubItems(1)
   DTPicker1 = .SubItems(2)
   Combo1(0) = .SubItems(3)
   Combo1(1) = .SubItems(4)
   Combo1(2) = .SubItems(5)
   lblBillNum(1) = .SubItems(6)
   lblBillNum(2) = .SubItems(7)
   lblBillNum(3) = .SubItems(8)
   lblBillNum(4) = .SubItems(9)
   Combo1(3) = .SubItems(10)
   TexGoods(1) = .SubItems(11)
   TempVar = Val(.SubItems(12))
   If TempVar > 0 Then
    Option1(TempVar - 1).Value = True
   End If
  End With
 End If
 TempSQL = VarInitData.DisplayDynSQLVal(VarInitData.SureNameFrIndex(6))
 VarInitData.LoadData Combo1(0), TempSQL, 1
 Combo1(3).AddItem ""
 Combo1(3).AddItem "普通发票"
 Combo1(3).AddItem "增值税票"
End Sub


Public Sub ClearFrame()
 Dim i As Integer
 With Me
  For i = 0 To 1
   .TexGoods(i).Text = ""
  Next i
  For i = 0 To 3
   .Combo1(i).Text = ""
  Next i
  For i = 1 To 3
   .lblBillNum(i).Caption = "0"
  Next i
  For i = 0 To 1
   .Option1(i).Value = False
  Next i
  DTPicker1.Value = Date
 End With
End Sub

Private Sub Form_Load()
 VarInitData.InitBSE BSE1, 0
End Sub

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

End Sub

Private Sub Option1_Click(Index As Integer)
 VarOption = Index + 1
End Sub

⌨️ 快捷键说明

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