⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 VB财务软件系统下载源代码提供自由下载使用学习
💻
📖 第 1 页 / 共 2 页
字号:
         Locked          =   -1
      End
      Begin VB.Label label1 
         AutoSize        =   -1  'True
         Caption         =   "系统启用日期"
         Height          =   180
         Index           =   8
         Left            =   840
         TabIndex        =   19
         Top             =   1380
         Width           =   1080
      End
      Begin VB.Label label1 
         AutoSize        =   -1  'True
         Caption         =   "已记账日期"
         Height          =   180
         Index           =   9
         Left            =   840
         TabIndex        =   17
         Top             =   1740
         Width           =   900
      End
      Begin VB.Label label1 
         AutoSize        =   -1  'True
         Caption         =   "反记账日期"
         Height          =   180
         Index           =   7
         Left            =   840
         TabIndex        =   16
         Top             =   2115
         Width           =   900
      End
      Begin VB.Label label1 
         AutoSize        =   -1  'True
         Caption         =   "下面列出系统启用日期、已记账日期,请输入反记账日期。"
         Height          =   360
         Index           =   6
         Left            =   420
         TabIndex        =   13
         Top             =   450
         Width           =   4140
         WordWrap        =   -1  'True
      End
   End
   Begin VB.Image Image1 
      Height          =   4770
      Left            =   30
      Picture         =   "反记账.frx":0000
      Top             =   30
      Width           =   2685
   End
End
Attribute VB_Name = "frmUnBook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_dStartDate    As Date     '---启用日期
Private m_dBookedDate   As Date     '---已记账日期

Private m_iStage        As Integer
Private bSuccess        As Boolean

Private Const WZ_START = 1
Private Const WZ_SELECTDATE = 2
Private Const WZ_PROGRESS = 3
Private Const WZ_ERROR = 4
Private Const WZ_RESULT = 5

Private WithEvents moUnBook As CUnBook
Attribute moUnBook.VB_VarHelpID = -1

Private Sub cmdBack_Click()
   Select Case m_iStage
      Case WZ_START
         m_iStage = WZ_START
      Case WZ_SELECTDATE
         m_iStage = WZ_START
      Case WZ_ERROR
         m_iStage = WZ_SELECTDATE
      Case WZ_PROGRESS
         m_iStage = WZ_SELECTDATE
      Case WZ_RESULT
         m_iStage = WZ_SELECTDATE
   End Select
   
   ChangePanel
End Sub

Private Sub cmdcancel_Click()
   If m_iStage = WZ_START Or m_iStage = WZ_PROGRESS Then
      Unload Me
   Else
      If MsgBox("真的要退出吗?", vbQuestion + vbYesNo, "退出向导") = vbYes Then Unload Me
   End If
End Sub

Private Function IsDataValid() As Boolean
   proStatuse.Value = 0
   If Not IsDate(edtUnBook) Then
      MsgBox "请输入反记账日期!", vbInformation, zjGl_Name
      SetTxtFocus edtUnBook
      Exit Function
   End If
   
   'cuidong 2001.10.25
   '-----------------------------------------------
'   If CDate(edtUnBook) < CDate(edtStart) Then
'      MsgBox "反记账日期不能小于系统启用日期!", vbInformation, zjGl_Name
'      SetTxtFocus edtUnBook
'      Exit Function
'   End If
'
'   If edtBooked = "" Then
'      MsgBox "本日未记账,不能进行反记账!", vbInformation, zjGl_Name
'      Exit Function
'   End If
'
'   If CDate(edtUnBook) > CDate(edtBooked) Then
'      MsgBox "本日未记账,不能进行反记账!", vbInformation, zjGl_Name
'      Exit Function
'   End If
   '-----------------------------------------------
   
   IsDataValid = True
End Function

Private Sub FormatEdtBooked()
   Dim vBooked As Variant
   
   vBooked = moUnBook.BookedDate
   If Not IsEmpty(vBooked) Then
      If CDate(vBooked) < m_dStartDate Then
         edtBooked = ""
      Else
         edtBooked = FormatDate(CDate(vBooked))
      End If
   Else
      edtBooked = ""
   End If

End Sub

Private Sub cmdFinish_Click()
   Unload Me
End Sub

Private Sub cmdNext_Click()
   Select Case m_iStage
      Case WZ_START
         FormatEdtBooked
         m_iStage = WZ_SELECTDATE
      Case WZ_SELECTDATE
         If Not IsDataValid Then Exit Sub
         If moUnBook.ValidateData(CDate(edtUnBook)) Then
            m_iStage = WZ_PROGRESS
         Else
            m_iStage = WZ_ERROR
         End If
      Case WZ_PROGRESS
         m_iStage = WZ_PROGRESS
   End Select
   
   ChangePanel
End Sub

Private Sub cmdrq_Click()
   DisplayCalendar edtUnBook, Me.hwnd, fraSelectDate.left, fraSelectDate.top
End Sub

Private Sub edtUnBook_LostFocus()
   If IsDate(edtUnBook) Then edtUnBook = FormatDate(edtUnBook)
End Sub

Private Sub Form_Initialize()
   Set moUnBook = New CUnBook
End Sub

Private Sub Form_Load()
   LoadStatic
   initGrid
   
   moUnBook.Init wksZJ, dbsZJ
   edtUnBook = FormatDate(zjLogInfo.curDate)
   m_dStartDate = ZjAccInfo.zjStartdate
   
   CenterForm Me
   
   proStatuse.Max = 11
   proStatuse.Value = 0
   
   edtStart.Enabled = False
   edtBooked.Enabled = False
   
   m_iStage = WZ_START
   ChangePanel
End Sub

Private Sub LoadStatic()
   Me.Icon = LoadResPicture(109, vbResIcon)
   cmdRq.Picture = LoadResPicture(1108, vbResBitmap)
   
End Sub

Private Sub Form_Terminate()
   Set moUnBook = Nothing
End Sub

Private Sub moUnBook_DataValidated(sErrorMsg() As String)
   Dim i    As Long
   Dim sRow As String
   
   With flexError
      .Rows = 2
      For i = 1 To UBound(sErrorMsg)
         sRow = Ywbhtoname(left(sErrorMsg(i), 2)) & Chr(9) & right(sErrorMsg(i), 10)
         .AddItem sRow
      Next i
   End With
End Sub

Private Sub ChangePanel()
   Dim fraPanelToShow   As Frame
   
   Select Case m_iStage
      Case WZ_START
         Set fraPanelToShow = fraWelcome
         cmdBack.Enabled = False
         cmdNext.Enabled = True
         fraPanelToShow.ZOrder 0
      Case WZ_SELECTDATE
         Set fraPanelToShow = fraSelectDate
         cmdBack.Enabled = True
         cmdNext.Enabled = True
         cmdFinish.Enabled = False
         edtStart = FormatDate(m_dStartDate)
         FormatEdtBooked
         fraPanelToShow.ZOrder 0
      Case WZ_ERROR
         Set fraPanelToShow = fraError
         cmdNext.Enabled = False
         cmdFinish.Enabled = True
         fraPanelToShow.ZOrder 0
      Case WZ_PROGRESS
         Set fraPanelToShow = fraProgress
         cmdNext.Enabled = False
         cmdFinish.Enabled = True
         fraPanelToShow.ZOrder 0
         Screen.MousePointer = vbHourglass
         bSuccess = moUnBook.Start
         Screen.MousePointer = vbDefault
         m_iStage = WZ_RESULT
         ChangePanel
      Case WZ_RESULT
         Set fraPanelToShow = fraSuccess
         fraPanelToShow.ZOrder 0
         If bSuccess Then
            lblSuccess = "    成功完成反记账!"
         Else
            lblSuccess = "反记账未完成,稍后再试!"
         End If
         cmdFinish.SetFocus
   End Select
End Sub

Private Sub initGrid()
   With flexError
      .Cols = 2
      .Rows = 2
      .RowHeight(0) = 400
      .RowHeight(1) = 0
      .FixedRows = 1
      .RowHeightMin = 250
      
      .ColWidth(0) = 1400
      .ColWidth(1) = 1800
      .TextMatrix(0, 0) = "单据类别"
      .TextMatrix(0, 1) = "单据编号"
      .ColAlignment(0) = 0
      .ColAlignment(1) = 0
      
      .row = 0
      .col = 0
      .CellAlignment = 4
      .col = 1
      .CellAlignment = 4
   End With
End Sub

Private Sub moUnBook_FlashMessage(sMsg1 As String, sMsg2 As String)
   Dim iValue As Long
   
   lblStatus = sMsg1
   iValue = proStatuse.Value + 1
   If iValue > proStatuse.Max Then iValue = proStatuse.Max
   proStatuse.Value = iValue
End Sub

⌨️ 快捷键说明

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