s!cendcode
cEcount=rst.Fields!nowecount
Ifrst.Fields(14)<>NullThen
DTPicker1.Value=rst.Fields(14)
EndIf
txtUserName(10)=rst.Fields!cFeeMoney
EndIf
rst.Close
EndSub
PrivateSubForm_Unload(CancelAsInteger)
MDIme.loadAdd
EndSub
8.数据修改界面设计:
数据修改代码设计:
DimchangeEAsDouble
DimcEcountAsDouble
PrivateSubcmdAsure_Click()
IfTrim(MDIme.dcvalue.BoundText)<>""Then
DimcnnAsNewADODB.Connection
DimsqlAddAsString
cnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_
App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"
cnn.CursorLocation=adUseClient
cnn.Open
sqlAdd="updatepanelinfosetholderid='"&txtUserName(0)&"',holder='"&txtUserName(1)&"',LEndPCode='"&txtUserName(2)&"',CopyDate=#"&dtpWdate.Value&"#,lightscale="&txtUserName(3)&",lsfee="&txtUserName(4)&",lmoney="&txtUserName(5)&",bmoney="&txtUserName(6)&",cname='"&txtUserName(7)&"',memotext='"&txtUserName(8)&"',cEndCode="&txtUserName(9)&",cFeeMoney="&Val(txtUserName(10))&",nowecount="&changeE&",atimes="&Me.Text1&""
sqlAdd=sqlAdd&"whereholderid='"&Trim(MDIme.dcvalue.BoundText)&"'"
cnn.ExecutesqlAdd
sqlAdd="update用户类型setUNITPRICE="&Me.txtUserName(5)&"whereATypeID="&dcob用途.BoundText
cnn.Close
MsgBox"数据修改完成!",vbInformation
EndIf
EndSub
PrivateSubCommand1_Click()
UnloadMe
EndSub
PrivateSubdcob用途_Click(AreaAsInteger)
DimrstAsNewADODB.Recordset
Ifdcob用途.BoundText<>""Then
rst.Open"select*from用户类型whereATypeID="&dcob用途.BoundText&"",gCnn,adOpenStatic,adLockBatchOptimistic
Me.txtUserName(5)=Format(rst.Fields(2),"###0.00")
rst.Close
Else
MsgBox"请先添加用户电表类型信息!",vbInformation
ExitSub
EndIf
EndSub
PrivateSubForm_Load()
DimrstAsNewADODB.Recordset
DimsqlEditAsString
sqlEdit="select*frompanelinfo"
sqlEdit=sqlEdit&"whereholderid='"&Trim(MDIme.txtUserName(0))&"'anddelflag<>true"
rst.OpensqlEdit,gCnn,adOpenKeyset,adLockBatchOptimistic
IfNotrst.EOFThen
txtUserName(0)=rst.Fields(1)
txtUserName(1)=rst.Fields(2)
txtUserName(2)=rst.Fields(3)
dtpWdate.Value=rst.Fields(4)
txtUserName(3)=Format(rst.Fields(5),"####0.00")
txtUserName(4)=Format(rst.Fields(6),"####0.00")
txtUserName(5)=Format(rst.Fields(7),"####0.00")
txtUserName(6)=Format(rst.Fields(8),"####0.00")
txtUserName(7)=rst.Fields(9)
txtUserName(8)=rst.Fields(10)
txtUserName(9)=rst.Fields!cendcode
Text1.Text=rst.Fields!Atimes
changeE=rst.Fields!cendcode
cEcount=rst.Fields!nowecount
Ifrst.Fields(14)<>NullThen
DTPicker1.Value=rst.Fields(14)
EndIf
txtUserName(10)=rst.Fields!cFeeMoney
EndIf
DimrstJBAsNewADODB.Recordset
SetrstJB.ActiveConnection=gCnn
rstJB.CursorLocation=adUseClient
rstJB.LockType=adLockBatchOptimistic
rstJB.CursorType=adOpenKeyset
rstJB.Open"select*from用户类型whereatypeid="&rst.Fields!AtypeID
Setdcob用途.DataSource=rstJB
Setdcob用途.RowSource=rstJB
dcob用途.BoundColumn="ATYPEID"
dcob用途.ListField="ATYPE"
IfrstJB.RecordCount<>0Then
dcob用途.Text=rstJB.Fields(1)
Me.txtUserName(5)=Format(rstJB.Fields(2),"###0.00")
EndIf
rst.Close
EndSub
PrivateSubForm_Unload(CancelAsInteger)
MDIme.loadData(txtUserName(0))
EndSub
PrivateSubtxtUserName_Change(IndexAsInteger)
IfIndex=9Then
changeE=cEcount+(Val(txtUserName(9))-changeE)
EndIf
EndSub
PrivateSubUpDown1_Change()
Me.Text1=UpDown1.Value
EndSub
9.开始收费界面设计:
开始收费代码设计:
PrivateSubCmdPrint_Click()
GoTol
DimLongColorAsLong
IfMsgBox("打印机准备好了吗?",vbYesNo+vbInformation)<>vbYesThen
ExitSub
EndIf
Me.CmdPrint.Visible=False
LongColor=Me.BackColor
Me.BackColor=vbWhite
txtPrint.BackColor=vbWhite
Me.PrintForm
Me.BackColor=LongColor
Me.CmdPrint.Visible=True
ExitSub
l:MsgBoxErr.Description
EndSub
PrivateSubCommand1_Click()
DimrstFeeEndAsNewADODB.Recordset
DimcmdExeAsNewADODB.Command
DimreMoneyAsString
DimsqlStringAsString
IfTrim(txtFee)=""OrTrim(txtM)=""Then
MsgBox"请先输入数据!",vbInformation
ExitSub
EndIf
reMoney=ConvertMe(Trim(txtFee))
DimChangeAsString
Change=Val(txtM)-Val(txtFee)
IfChange<0Then
IfMsgBox("实收电费比应收现金大,您确定要这样收取?",vbYesNo+vbInformation)=vbNoThen
ExitSub
EndIf
EndIf
Me.txtHoldernum=MDIme.txtUserName(0)
Me.holderName=MDIme.dcvalue.Text
Me.lblEAmount=MDIme.txtUserName(1)&"度"
Me.endA=MDIme.txtUserName(2)&"度"
Me.lblHandInMoney="¥"&Format(txtFee,"####0.00")
Me.lblSum="¥"&Format(txtM.Text,"####0.00")
Me.lblfinaldate=Date
IfChange>=0Then
Me.lblMoneyOfCard="¥"&Format(Change,"####0.00")
Else
Me.lblMoneyOfCard=0
EndIf
rstFeeEnd.Open"select*frompanelinfowhereholderid='"&MDIme.txtUserName(0)&"'anddelflag<>true",gCnn,adOpenStatic,adLockBatchOptimistic
DimrusrTypeAsNewADODB.Recordset
IfrstFeeEnd.RecordCount<>0Then
rusrType.Open"select*from用户类型whereAtypeID="&rstFeeEnd.Fields!AtypeID,gCnn,adOpenStatic,adLockBatchOptimistic
IfrusrType.RecordCount<>0Then
Me.lblusrYype=rusrType.Fields!AType
rusrType.Close
Else
MsgBox"用户类型不能为空!",vbCritical
rusrType.Close
UnloadMe
EndIf
EndIf
Me.Label11=rstFeeEnd.Fields!Atimes
Me.Label11=Me.Label11&"/"&Format(rstFeeEnd.Fields!lMoney,"##0.00")
rstFeeEnd.Fields!nowecount=0
Me.startA=rstFeeEnd.Fields!LEndPCode&"度"
rstFeeEnd.Fields!lecount=rstFeeEnd.Fields!lecount+rstFeeEnd.Fields!nowecount
'MsgBoxMDIme.txtUserName(7)
rstFeeEnd.Fields!lsFee=Val(MDIme.txtUserName(7))-Val(txtM)
rstFeeEnd.UpdateBatchadAffectCurrent
rstFeeEnd.Close
sqlString="insertintofeels(holderid,holder,feemoney,qianfee,feedate,zhinajin,memols,cname,Ecount)values('"&MDIme.txtUserName(0)&"','"&MDIme.dcvalue.Text&"',"&Val(txtFee.Text)&","&Val(txtM.Text)&",#"&Format(Now,"yyyy-mm-dd")&"#,"&Val(txtznj)&",'"&txtPrint&"','"&Guser&"',"&MDIme.txtUserName(1)&")"
cmdExe.ActiveConnection=gCnn
cmdExe.CommandText=sqlString
cmdExe.Execute
txtPrint.Visible=True
Me.CmdPrint.Visible=True
Frame2.Visible=False
EndSub
PrivateSubCommand3_Click()
UnloadMe
EndSub
PrivateSubForm_Load()
Me.Caption=MDIme.dcvalue.Text&"用户(住户编号:"&MDIme.txtUserName(0)&")开始交费"
txtFee.Text=MDIme.txtUserName(7)
EndSub
PrivateSubForm_Unload(CancelAsInteger)
MDIme.loadData(MDIme.txtUserName(0))
EndSub
PrivateSubtxtFee_KeyPress(KeyAsciiAsInteger)
IfKeyAscii<>8AndKeyAscii<>46AndKeyAscii<48OrKeyAscii>57ThenKeyAscii=0
EndSub
上一篇:
VB电脑销售系统(论文和程序)
下一篇:
高容量手机电池产品开发论文