refactor
This commit is contained in:
161
src/sh/tuk/module/Common_Selector.bas
Normal file
161
src/sh/tuk/module/Common_Selector.bas
Normal file
@@ -0,0 +1,161 @@
|
||||
Attribute VB_Name = "Common_Selector"
|
||||
Option Explicit
|
||||
' ============================================================
|
||||
' Module Name: Build_Select
|
||||
' Module Desc: Commuter allowance editing sheet (no CSV import)
|
||||
' Module Methods:
|
||||
' - Tukin_ValidateRow
|
||||
' - FillTransportFromM1KukanD
|
||||
' - FillDepartureFromM1KukanD
|
||||
' - FillArrivalFromM1KukanD
|
||||
' - FillKukanFromM1
|
||||
' - FillKanshuFromM2
|
||||
' - FillCodeFromM2
|
||||
' - FillAddressFromO1
|
||||
' - FillZ1Dropdown
|
||||
' ============================================================
|
||||
|
||||
' Create transport (T) dropdown from Z1 cache
|
||||
Public Function BuildTransportList()
|
||||
Dim z1Cache As Object: Set z1Cache = GetCache("Z1")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In z1Cache.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, z1Cache(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
|
||||
BuildTransportList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create todoke (G) dropdown
|
||||
Public Function BuildTodokeList()
|
||||
Dim z4Cache As Object: Set z4Cache = GetCache("Z4")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In z4Cache.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, z4Cache(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildTodokeList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create oufuku (M) dropdown
|
||||
Public Function BuildOufukuList()
|
||||
Dim oufukuList As Object: Set oufukuList = GetCache("oufukuList")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In oufukuList.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, oufukuList(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildOufukuList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create Koutai (N) dropdown
|
||||
Public Function BuildKoutaiList()
|
||||
Dim koutaiList As Object: Set koutaiList = GetCache("koutaiList")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In koutaiList.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, koutaiList(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildKoutaiList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create Kettei (AU) dropdown
|
||||
Public Function BuildKetteiList()
|
||||
Dim z2Cache As Object: Set z2Cache = GetCache("Z2")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In z2Cache.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, z2Cache(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildKetteiList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create Higaitou (AW) dropdown
|
||||
Public Function BuildHigaitouList()
|
||||
Dim higaitouList As Object: Set higaitouList = GetCache("higaitouList")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In higaitouList.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, higaitouList(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildHigaitouList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create MonthAmountKbn (AX) dropdown
|
||||
Public Function BuildMonthAmountKbnList()
|
||||
Dim z3Cache As Object: Set z3Cache = GetCache("Z3")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In z3Cache.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, z3Cache(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildMonthAmountKbnList = dropdownList
|
||||
End Function
|
||||
|
||||
' Create Kanshoku (BC) dropdown
|
||||
Public Function BuildKanshokuList()
|
||||
Dim o2Cache As Object: Set o2Cache = GetCache("O2")
|
||||
|
||||
Dim dropdownList As String
|
||||
Dim key As Variant
|
||||
For Each key In o2Cache.Keys
|
||||
Dim displayText As String
|
||||
displayText = MakeSelect(key, o2Cache(key)(0))
|
||||
If dropdownList = "" Then
|
||||
dropdownList = displayText
|
||||
Else
|
||||
dropdownList = dropdownList & "," & displayText
|
||||
End If
|
||||
Next key
|
||||
BuildKanshokuList = dropdownList
|
||||
End Function
|
||||
Reference in New Issue
Block a user