1、U8开发单据和单据列表总结8711、单据页面初始化:点击“部门费用拆分表”执行后台代码块:先定义变量icbc_deptfy,在类模块clsVoucher_CO (clsVoucher_co.cls)中Enum VoucherTypeSAicbc_deptfy =jiang=End Enum定义变量部门预算,在类模块clsVoucherLoad_BO(clsVoucherLoad_BO.cls)中Public Enum enuSAVType 部门费用拆分表 = 100016 =jiang=End Enum调用clsproductfacade模块中下面的callFunction方法Public F
2、unction CallFunction(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String) As ObjectSelect Case cMenuId Case MT0101, MT0102, MT0103, MT0201, MT0202 gd_frmMain.m_oMenu_OnCommand cMenuId, cMenuName, cAuthId, cCmdLine End Select调用frmMain(主窗体.frm)中下面的m_oM
3、enu_OnCommand方法Public Sub m_oMenu_OnCommand(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String)添加代码:Select Case cMenuId Case MT0201 部门费用拆分表 miBJD_Click icbc_deptfy, cAuthId, , strVouchID 调用方法miBJD_ClickPublic Sub miBJD_Click(strVouType As VoucherTyp
4、eSA, strTaskId As String, Optional iMode As Integer, Optional SBVID As String, Optional cSBVCode As String, Optional mDom As DOMDocument)添加代码: Select Case strVouType Case icbc_deptfy =jiang= strFrmCaption = MLRsSvr.GetString(U8.ICBC.Mt.0299) 部门费用拆分表 tmpTaskID = MT020101 权限ID sType = 100016 模板编号调用frm
5、VouchNew(单据模板.frm)中ShowVoucher方法Public Function ShowVoucher(VoucherType As VoucherTypeSA, Optional vVoucherId As Variant, Optional iMode As Integer)添加代码: Select Case VoucherType Case icbc_deptfy 部门费用拆分表 strVouchType = 100016 strCardNum = KM01 Me.caption = MLRsSvr.GetString(U8.ICBC.Mt.0299) 部门费用拆分表调用
6、clsVoucher_CO (clsVoucher_CO.cls)中的GetVouchInf方法Public Function GetVouchInf(m_enmVoucherType As VoucherTypeSA, _ Select Case m_enmVoucherType Case icbc_deptfy 部门费用拆分表 sVouchType = 100016 sCardNum = KM01 bVouchFirst = False strTable = icbc_acv调用frmVouchNew(单据模板.frm)中SetButtonStatus方法Private Sub SetBu
7、ttonStatus(ButtonKey As String)Select Case LCase(ButtonKey) Case modify Select Case LCase(strVouchType) Case 100016 tbrvoucher.buttons(Modify).Enabled = False tbrvoucher.buttons(Save).Enabled = True tbrvoucher.buttons(Cancel).Enabled = True tbrvoucher.buttons(AddRow).Enabled = True tbrvoucher.button
8、s(DelRow).Enabled = True tbrvoucher.buttons(Erase).Enabled = False tbrvoucher.buttons(Add).Enabled = False tbrvoucher.buttons(UnSure).Enabled = False tbrvoucher.buttons(Sure).Enabled = False tbrvoucher.buttons(ToFirst).Enabled = False tbrvoucher.buttons(ToPrevious).Enabled = False tbrvoucher.buttons
9、(ToNext).Enabled = False tbrvoucher.buttons(ToLast).Enabled = FalseEnd Select Case add Select Case LCase(strVouchType) Case 100016 tbrvoucher.buttons(Add).Enabled = False tbrvoucher.buttons(Save).Enabled = True tbrvoucher.buttons(Cancel).Enabled = True tbrvoucher.buttons(AddRow).Enabled = True tbrvo
10、ucher.buttons(DelRow).Enabled = True tbrvoucher.buttons(Modify).Enabled = False tbrvoucher.buttons(Erase).Enabled = False tbrvoucher.buttons(UnSure).Enabled = False tbrvoucher.buttons(Sure).Enabled = False tbrvoucher.buttons(ToFirst).Enabled = False tbrvoucher.buttons(ToPrevious).Enabled = False tbr
11、voucher.buttons(ToNext).Enabled = False tbrvoucher.buttons(ToLast).Enabled = False End Select Case cancel, save Select Case LCase(strVouchType) Case 100016 ComboVTID.Visible = True ComboDJMB.Visible = True Labeldjmb.caption = MLRsSvr.GetString(U8.ICBC.Mt.0302) 打印模版: tbrvoucher.buttons(ToFirst).Visib
12、le = True tbrvoucher.buttons(ToPrevious).Visible = True tbrvoucher.buttons(ToNext).Visible = True tbrvoucher.buttons(ToLast).Visible = True tbrvoucher.buttons(Save).Visible = True tbrvoucher.buttons(Cancel).Visible = True tbrvoucher.buttons(DelRow).Visible = True tbrvoucher.buttons(AddRow).Visible =
13、 True tbrvoucher.buttons(Output).Visible = True 输出 tbrvoucher.buttons(Modify).Visible = True 修改 tbrvoucher.buttons(Save).Enabled = False tbrvoucher.buttons(Cancel).Enabled = False tbrvoucher.buttons(AddRow).Enabled = False tbrvoucher.buttons(DelRow).Enabled = False tbrvoucher.buttons(Modify).Enabled
14、 = True tbrvoucher.buttons(Erase).Enabled = True tbrvoucher.buttons(Add).Enabled = True tbrvoucher.buttons(Ordercode).Visible = False tbrvoucher.buttons(ImportPur).Visible = False tbrvoucher.buttons(ImportExcel).Visible = False tbrvoucher.buttons(MakeFACardNumber).Visible = False tbrvoucher.buttons(
15、MakeFACard).Visible = False tbrvoucher.buttons(UnSure).Enabled = True tbrvoucher.buttons(Sure).Enabled = True tbrvoucher.buttons(ToFirst).Enabled = True tbrvoucher.buttons(ToPrevious).Enabled = True tbrvoucher.buttons(ToNext).Enabled = True tbrvoucher.buttons(ToLast).Enabled = True End Select调用ClsVo
16、ucher_CO (clsVoucher_ CO.cls)中的 GetVoucherData方法Public Function GetVoucherData(DomHead As DOMDocument, DomBody As DOMDocument, Optional VouchID As Variant) As String添加代码: Select Case m_enmVoucherType Case icbc_deptfy 部门费用拆分表 clsVouchDMO.GetVoucherDataWEB domhead, dombody, m_Conn, 部门费用拆分表, False, str
17、ErrMsg, VouchID调用clsVouchDMO(clsVouchDMO.cls)中的 getkey方法Private Function getkey(ByVal uvdVouchType As enuSAVType, ByVal bReturn As Boolean, CN As ADODB.Connection) As Boolean添加代码: Select Case uvdVouchType =jiang= Case 部门费用拆分表 strVouchType = 100016 sKeyHead = id sKeyBody = id sMViewHead = icbc_acv sM
18、ViewBody = icbc_acvs sViewHead = v_icbc_acv sViewBody = v_icbc_acvs sBodyID = autoid调用ModVoucher(ModVoucher.bas)中的GetVouchInfo方法Public Function GetVouchInfo(strVouchType As String, strMainIDName As String, _strSubIDName As String, Optional errMsg As String, Optional cMainTable As String, _Optional c
19、SubTable As String) As Boolean添加代码: Select Case strVouchType =jiang= Case 100016 部门费用拆分表 strMainIDName = id strSubIDName = id cMainTable = icbc_acv cSubTable = icbc_acvs调用frmVouchNew(单据模板.frm)中ChangeButtonsState方法注:根据单据的要求,设置工具栏按钮的初始化时的状态改变button的状态Private Sub ChangeButtonsState()添加代码: Select Case s
20、trVouchType =jiang= Case 100016, 300016, 100018 已审核 If .headerText(auditinguser) Then Me.tbrvoucher.buttons(UnSure).Visible = True Me.tbrvoucher.buttons(Sure).Visible = False Me.tbrvoucher.buttons(Modify).Enabled = False Me.tbrvoucher.buttons(Erase).Enabled = False 未审核 Else Me.tbrvoucher.buttons(Sur
21、e).Visible = True Me.tbrvoucher.buttons(UnSure).Visible = False Me.tbrvoucher.buttons(Modify).Enabled = True Me.tbrvoucher.buttons(Erase).Enabled = True End If Select Case strVouchType Case 100016, 300016 If voucher.headerText(archiveno) = Then Me.tbrvoucher.buttons(Modify).Enabled = False Me.tbrvou
22、cher.buttons(Erase).Enabled = False Me.tbrvoucher.buttons(MakeFACard).Enabled = False End If End Select调用ModVoucher(ModVoucher.bas)中的GetstrCardNum方法Public Function GetstrCardNum(strVouchType As String, Optional bRed As Boolean = False, Optional bGetTrue As Boolean = False) As String添加代码:Select Case
23、strVouchType =jiang= Case 100016 部门费用拆分表 GetstrCardNum = KM01End Select2、点击“新增”按钮调用frmVouchNew(单据模板.frm)中的VoucherTask方法Private Function VoucherTask(sKey As String) As BooleanSelect Case strVouchType 部门费用拆分表 Case 100016 Select Case sKey Case MLRsSvr.GetString(U8.ICBC.Mt.0013) strID = MT020102 Case ML
24、RsSvr.GetString(U8.ICBC.Mt.0014) strID = MT020103 Case MLRsSvr.GetString(U8.ICBC.Mt.0018) strID = MT020104Case MLRsSvr.GetString(U8.ICBC.Mt.0026), MLRsSvr.GetString(U8.ICBC.Mt.0027) strID = MT020105 End SelectEnd Select调用clsSystem(clsSystem.cls)中的GetVoucherTaskID方法Public Function GetVoucherTaskID(sK
25、ey As String, sVouchType As String, Optional bRed As Boolean) As String添加代码: Select Case sVouchType =jiang=start20061230 部门费用拆分表 Case 100016 Select Case sKey Case GetResString(U8.ICBC.Mt.0013) strID = MT020102 Case GetResString(U8.ICBC.Mt.0014) strID = MT020103 Case GetResString(U8.ICBC.Mt.0018) str
26、ID = MT020104 Case GetResString(U8.ICBC.Mt.0026),GetResString(U8.ICBC.Mt.0027) strID = MT020105 End Select调用frmVouchNew(单据模板.frm)中getVoucherCodeName方法Private Function getVoucherCodeName() As String添加代码: Select Case strVouchType Case 100016, 300016 KeyCode = archiveno 3、录入数据,点击“保存”按钮,保存单据调用ClsVoucher
27、_CO (clsVoucher_CO.cls)中的 Save方法Public Function Save(ByVal DomHead As DOMDocument, ByVal DomBody As DOMDocument, ByVal VoucherState As Integer, Optional vNewID As Variant, Optional DomConfig As DOMDocument) As String添加代码: =jiang=验证单据表体记录是否为0Select Case m_enmVoucherType Case icbc_deptfy clsVouchLoad.
28、VouchSave m_Conn, 部门费用拆分表, domhead, dombody, VoucherState, strError, vNewID, DomConfigEnd Select 调用ClsVouchLoad_BO(clsVouchLoad_BO.cls)中VouchSave的方法Public Function VouchSave(m_Conn As Connection, ByVal uvdVouchType As enuSAVType, _ByVal DomHead As DOMDocument, ByVal domBody As DOMDocument, _ByVal Vo
29、ucherState As Integer, sErrMsg As String, Optional vNewID As Variant, Optional DomConfig As DOMDocument) As Boolean添加代码: Select Case uvdVouchType =jiang= Case 100016 bSuccess = True strMTblName = icbc_acv strSTblName = icbc_acvs 4、单据的删除功能点击“删除”按钮调用clsVouchload_bo(clsVouchload_bo.cls)中的VouchDelete方法Public Function VouchDelete(strVouchType As String, ByVal DBConn As ADODB.Connection, sTableName As String, DomHead As DOMDocument) As String添加代码:Select Case strVouchT
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1