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

📄 frmxsthdar.frm

📁 制造业产供销与往来系统源码,包括进销存及全部控件!
💻 FRM
📖 第 1 页 / 共 4 页
字号:
   End Select
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Flex_RowColChange(Index As Integer)
On Error GoTo Errorhandle
      
   If Flex(FlexXsFhdAr).Row <> Flex(FlexXsFhdAr).Rows - 1 Then
      Set oXsFhdAr = oXsFhdArh.XsFhdArs(CStr(Flex(FlexXsFhdAr).RowData(Flex(FlexXsFhdAr).Row)))
   Else
      Set oXsFhdAr = Nothing
   End If
   
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub SetValueToControl()
On Error GoTo Errorhandle

   Text(TxtXsFhdArhDocno).Text = oXsFhdArh.XsFhdArhDocno
   Text(TxtXsFhdArhDat).Text = gPublicFunction.ConvStringToDate(oXsFhdArh.XsFhdArhDat)
   Text(TxtXsFhdArh_CwqjCode).Text = oXsFhdArh.XsFhdArh_CwQjCode
   Combo(CBxXsFhdArh_KhCode).Text = oXsFhdArh.Kh.KhCode
   Combo(CBxXsFhdArh_CwBzCode).Text = oXsFhdArh.CwBz.CwBzCode
   LoadDataIntoGrid
   
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Errorhandle

   Set oXsFhdArh = Nothing
   Set oXsFhdAr = Nothing
   
   gPublicFunction.SaveFormSet Me
    
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub muEdit_Click(Index As Integer)
   Dim mFrmXsFhdArGen As frmXsFhdArGen
On Error GoTo Errorhandle

Select Case muEdit(Index).Tag
Case "XSFHDARGEN"
      If Tlbaction(TlbXsFhdAr).Tag <> "" Then
         SetValueToObject
         Set mFrmXsFhdArGen = New frmXsFhdArGen
         Set mFrmXsFhdArGen.XsFhdArh = oXsFhdArh
         mFrmXsFhdArGen.Show vbModal
         Set mFrmXsFhdArGen = Nothing
         LoadDataIntoGrid
      End If
End Select

Exit Sub
Errorhandle:
   Set mFrmXsFhdArGen = Nothing
   MsgBox Err.Description
End Sub

Private Sub Text_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
On Error GoTo Errorhandle

gPublicFunction.FormKeyDown Me, KeyCode, Shift, Text(Index)

Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub Text_KeyPress(Index As Integer, KeyAscii As Integer)
On Error GoTo Errorhandle

   gPublicFunction.InputCheck Me, Text(Index), KeyAscii

Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub SetControlToFlex()
   Dim mCurCol As Integer
   Dim mCurRow As Integer
On Error GoTo Errorhandle
   
   If Tlbaction(TlbXsFhdAr).Tag = "" Then
      Exit Sub
   End If

   mCurRow = Flex(FlexXsFhdAr).Row
   mCurCol = Flex(FlexXsFhdAr).Col
   
   Select Case Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col)
   Case "HWBMCODE"
         If oXsFhdAr Is Nothing Then
            AddNewRecord
         Else
            oXsFhdAr.XsFhdAr_HwBmCode = Trim(Flex(FlexXsFhdAr).TextMatrix(mCurRow, mCurCol))
            Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("HWBMMC")) = oXsFhdAr.XsFhdAr_HwBmMc
            Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("HWDWCODE")) = oXsFhdAr.XsFhdAr_HwDwCode
            Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("XSFHDAR_HWDWCONV")) = oXsFhdAr.XsFhdAr_HwDwConv
         End If
   
   Case "HWDWCODE"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdAr_HwDwCode = Trim(Flex(FlexXsFhdAr).TextMatrix(mCurRow, mCurCol))
         End If
         
   Case "XSFHDAR_HWDWCONV"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdAr_HwDwConv = Val(Flex(FlexXsFhdAr).TextMatrix(mCurRow, mCurCol))
         End If
         
   Case "HWCKMC"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdAr_HwCkMc = Trim(Flex(FlexXsFhdAr).TextMatrix(mCurRow, mCurCol))
         End If
   
   Case "XSFHDARQTY"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdArQty = Val(Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, mCurCol))
            Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, Flex(FlexXsFhdAr).ColIndex("XSFHDARAMT")) = oXsFhdAr.XsFhdArAmt
         End If
   
   Case "XSFHDARPRICE"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdArPrice = Val(Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, mCurCol))
            Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, Flex(FlexXsFhdAr).ColIndex("XSFHDARAMT")) = oXsFhdAr.XsFhdArAmt
         End If
   
   Case "XSFHDARAMT"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdArAmt = Val(Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, mCurCol))
         End If
   
   Case "CWSMCODE"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdAr_CwSmCode = Trim(Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, mCurCol))
         End If
   
   Case "XSFHDARBZ"
         If Not oXsFhdAr Is Nothing Then
            oXsFhdAr.XsFhdArBz = Trim(Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, mCurCol))
         End If
   
   End Select
   
   If UCase(Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col)) = "XSFHDARQTY" Or UCase(Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col)) = "XSFHDARPRICE" Or UCase(Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col)) = "XSFHDARAMT" Then
      gPublicFunction.SumFlexQtyAmt Flex(FlexXsFhdAr), "XSFHDARQTY,XSFHDARAMT", Text(TxtTotalQty), Text(TxtTotalAmt)
   End If

Exit Sub
Errorhandle:
   Flex(FlexXsFhdAr).TextMatrix(mCurRow, mCurCol) = mCurColOldValue
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub AddNewRecord()
   Dim mCurRow As Integer
On Error GoTo Errorhandle

   mCurRow = Flex(FlexXsFhdAr).Row

   If Trim(Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).Col)) <> "" Then
      Set oXsFhdAr = New XsFhdAr
      Set oXsFhdAr.XsFhdArh = oXsFhdArh
      oXsFhdAr.XsFhdAr_HwBmCode = Trim(Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).Col))
      Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("HWBMMC")) = oXsFhdAr.XsFhdAr_HwBmMc
      Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("HWDWCODE")) = oXsFhdAr.XsFhdAr_HwDwCode
      Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("XSFHDAR_HWDWCONV")) = oXsFhdAr.XsFhdAr_HwDwConv
      Flex(FlexXsFhdAr).TextMatrix(mCurRow, Flex(FlexXsFhdAr).ColIndex("CWSMCODE")) = oXsFhdArh.Kh.Kh_CwSmCode
      oXsFhdArh.XsFhdArs.Add oXsFhdAr, 0
      Flex(FlexXsFhdAr).RowData(Flex(FlexXsFhdAr).Rows - 1) = oXsFhdAr.XsFhdArKey
      Flex(FlexXsFhdAr).AddItem ""
   End If

Exit Sub
Errorhandle:
   Set oXsFhdAr = Nothing
   Err.Raise vbObjectError + 1, , Err.Description
End Sub

Private Sub Form_Resize()
On Error GoTo Errorhandle
   gPublicFunction.ResizeForm Me
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub Text_LostFocus(Index As Integer)
On Error GoTo Errorhandle

   Select Case Index
   Case TxtXsFhdArhDat
         
         If Tlbaction(TlbXsFhdAr).Tag <> "" And Trim(Text(TxtXsFhdArhDat).Text) <> "" Then
            Text(TxtXsFhdArhDat).Text = gPublicFunction.SetDateFormat(Text(TxtXsFhdArhDat).Text)
            oXsFhdArh.XsFhdArhDat = gPublicFunction.ConvDateToString(Text(TxtXsFhdArhDat).Text)
            Text(TxtXsFhdArh_CwqjCode).Text = oXsFhdArh.XsFhdArh_CwQjCode
         End If
         
   Case TxtXsFhdArhDocno
   
           If Tlbaction(TlbXsFhdAr).Tag = "" Then
               If Trim(Text(Index).Text) = "" Then
                  Exit Sub
               End If
               
               If Not oXsFhdArh Is Nothing Then
                  If oXsFhdArh.XsFhdArhDocno = Text(TxtXsFhdArhDocno).Text Then
                     Exit Sub
                  End If
               End If
   
               Set oXsFhdArh = New XsFhdArh
               If oXsFhdArh.Requery(Text(TxtXsFhdArhDocno).Text) = 1 Then
                   SetValueToControl
               Else
                   Set oXsFhdArh = Nothing
                   Dim vXsFhdArdocno As String
                   vXsFhdArdocno = Text(TxtXsFhdArhDocno).Text
                   AddRecord "ADD"
                   Text(TxtXsFhdArhDocno).Text = vXsFhdArdocno
               End If
        End If

   End Select

Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub Tlbaction_ButtonClick(Index As Integer, ByVal Button As MSComctlLib.Button)
    Dim Action, RecordName As String
On Error GoTo Errorhandle

    Action = (Mid(Button.Key, 1, 3))
    RecordName = Button.Key
    
   If Trim(Flex(FlexXsFhdAr).EditText) <> "" Then
      Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, Flex(FlexXsFhdAr).Col) = Trim(Flex(FlexXsFhdAr).EditText)
   End If
   
    Select Case Action
        Case "ADD"
             AddRecord RecordName
        Case "CHG"
             ChgRecord RecordName
        Case "CAN"
             CancelRecord RecordName
        Case "SAV"
             SaveRecord RecordName
        Case "DEL", "DEF"
             DelRecord RecordName
        Case "EXI"
             Unload Me
        Case "FIN"
             ShowBmQuery
        Case Else
            
    End Select
    Exit Sub
Errorhandle:
    MsgBox Err.Description
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
   Dim mButton As Button
On Error GoTo Errorhandle

   Set mButton = gPublicFunction.GetToolBarButton(Me, KeyCode)
   
   If Not mButton Is Nothing Then
      Tlbaction_ButtonClick TlbXsFhdAr, mButton
   End If
  
Exit Sub
Errorhandle:
   MsgBox Err.Description
End Sub

Private Sub ShowBmQuery()
   Dim mCodeType As String
   Dim mQueryValue As String
On Error GoTo Errorhandle

   If Tlbaction(TlbXsFhdAr).Tag = "" Then
      Exit Sub
   End If
   
   If Me.ActiveControl Is Nothing Then
      Exit Sub
   End If
   
   
   If Me.ActiveControl Is Flex(FlexXsFhdAr) Then
      
      Select Case UCase(Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col))
      Case "HWBMCODE", "HWDWCODE", "HWCKMC", "CWSMCODE"
            mCodeType = UCase(Flex(FlexXsFhdAr).ColKey(Flex(FlexXsFhdAr).Col))
      End Select
      
      If mCodeType <> "" Then
         mQueryValue = gPublicFunction.GetBmQueryValue(Me, mCodeType)
         If mQueryValue <> "" Then
            Flex(FlexXsFhdAr).TextMatrix(Flex(FlexXsFhdAr).Row, Flex(FlexXsFhdAr).Col) = mQueryValue
            Flex(FlexXsFhdAr).EditCell
            SetControlToFlex
         End If
      End If
   
   Else
   
      Select Case Mid(UCase(Me.ActiveControl.Tag), 4)
      Case "CWQJCODE", "KHCODE", "CWBZCODE"
            mCodeType = Mid(UCase(Me.ActiveControl.Tag), 4)
      End Select
   
      If mCodeType <> "" Then
         mQueryValue = gPublicFunction.GetBmQueryValue(Me, mCodeType)
         If mQueryValue <> "" Then
            Me.ActiveControl.Text = mQueryValue
         End If
      End If
   
   End If
  
Exit Sub
Errorhandle:
   Err.Raise vbObjectError + 1, , Err.Description
End Sub





⌨️ 快捷键说明

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