VB电表管理信息系统 第6页
Private Sub exit_Click()
End
End Sub
Private Sub insert_Click()
frmInsert.Show 1
End Sub
Private Sub jiaonadianfei_Click()
frmFee.Show
End Sub
Private Sub M_USERYTPE_Click()
FRMUSERTYPE.Show 1
End Sub
Private Sub MDIForm_Load()
loadAdd
End Sub
Public Sub loadAdd()
If rst.State = 1 Then
rst.Close
End If
rst.Open " select * from panelinfo where delflag<>true ", gCnn, adOpenKeyset, adLockBatchOptimistic
If rst.RecordCount <> 0 Then
Set dcvalue.RowSource = rst
dcvalue.BoundColumn = "holderID"
dcvalue.ListField = "holder"
Set dcNum.DataSource = rst
Set dcNum.RowSource = rst
dcNum.ListField = "holderid"
If Not rst.EOF Then
dcNum.Text = rst.Fields!holderid
dcvalue.Text = rst.Fields(2)
txtUserName(0) = rst.Fields(1)
txtUserName(1) = rst.Fields!nowecount
txtUserName(2) = rst.Fields!cendcode
dtpwdate.Value = rst.Fields(4)
txtUserName(3) = Format(rst.Fields!lMoney, "##0.00")
txtUserName(4) = Format(rst.Fields!bmoney, "###.0.00")
txtUserName(6) = rst.Fields!lsFee
txtUserName(5) = Val(txtUserName(1)) * Val(txtUserName(3)) * (Val(rst.Fields!lightScale) / 100) + Val(txtUserName(1)) * Val(txtUserName(4)) * (1 - rst.Fields!lightScale / 100)
txtUserName(8) = rst.Fields(9)
txtUserName(7) = Val(txtUserName(5)) + Val(txtUserName(6))
rst.Fields!cFeeMoney = txtUserName(7)
rst.UpdateBatch adAffectCurrent
End If
End If
End Sub
Public Sub loadData(Hid As String)
Dim rst As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Dim Atimes As Integer
Dim sqlAdd As String
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= " & DbPassword & " ;Data Source= " & _
App.Path & "\data\dbdb.mdb;Persist Security Info=False"
cnn.CursorLocation = adUseClient
cnn.Open
If Trim(Hid) <> "" Then
rst.Open " select * from panelinfo where holderid='" & Hid & "' and delflag<>true ", cnn, adOpenStatic, adLockBatchOptimistic
Else
rst.Open " select * from panelinfo where delflag<>true ", cnn, adOpenStatic, adLockBatchOptimistic
End If
If Not rst.EOF Then
dcNum.Text = rst.Fields!holderid
dcvalue.Text = rst.Fields(2)
txtUserName(0) = rst.Fields(1)
txtUserName(1) = rst.Fields!nowecount
txtUserName(2) = rst.Fields!cendcode
dtpwdate.Value = rst.Fields(4)
txtUserName(3) = Format(rst.Fields!lMoney, "####0.00")
txtUserName(4) = Format(rst.Fields!bmoney, "####0.00")
txtUserName(6) = Format(rst.Fields!lsFee, "####0.00")
'txtUserName(5) = Format(txtUserName(1) * txtUserName(3) * (rst.Fields!lightScale / 100) + txtUserName(1) * txtUserName(4) * (1 - rst.Fields!lightScale / 100), "####0.00")
If rst.Fields!Atimes = 0 Then
Atimes = 1
Else
Atimes = rst.Fields!Atimes
End If
txtUserName(5) = Format(Val(txtUserName(1)) * txtUserName(3) * Atimes, "####0.00")
txtUserName(8) = rst.Fields(9)
txtUserName(7) = Format(Val(txtUserName(5)) + Val(txtUserName(6)), "####0.00")
rst.Fields!cFeeMoney = txtUserName(7)
rst.UpdateBatch adAffectCurrent
End If
rst.Close
cnn.Close
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
gCnn.Close
Set gcon = Nothing
End Sub
Private Sub mgcf_Click()
frmFeefind.Show
End Sub
Private Sub mhf_Click()
frmdaoru.Show
End Sub
Private Sub msf_Click()
frmFind1.Show
End Sub
Private Sub qianfeilm_Click()
frmList.qfFlg = True
frmList.Show
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>