Module modQCSetting

    Public Function LoadQCObjectInfo(ByVal pQCObjectType As String,
                                     ByRef pRefTableName As String,
                                     ByRef pData As DataSet,
                                     Optional ByVal pQCObjectNo As String = defString,
                                     Optional ByRef pFindColumnNo As String = "",
                                     Optional ByRef pFindColumnName As String = "",
                                     Optional ByVal pLikeSymbo As String = "",
                                     Optional ByVal pQCObjectFrom As String = defString,
                                     Optional ByVal pQCObjectTo As String = defString,
                                     Optional ByVal pAdditional As String = "") As Boolean

        Dim strMethod As String
        Dim strNode As String
        Dim strConditionName As String = "QCObjectType"
        Dim strConditionValue As String = pQCObjectType

        pQCObjectNo = pQCObjectNo & pLikeSymbo

        Select Case pQCObjectType
            Case 0
                pFindColumnNo = "QCCategory"
                pFindColumnName = "QCCategoryName"

            Case 1
                pFindColumnNo = "ProductNo"
                pFindColumnName = "ProductName"

            Case 2
                pFindColumnNo = "QCCategory"
                pFindColumnName = "QCCategoryName"

            Case 3
                pFindColumnNo = "MaterialNo"
                pFindColumnName = "MaterialName"

        End Select

        If pQCObjectNo <> defString Then
            strConditionName = strConditionName & ",QCObjectNo"
            strConditionValue = strConditionValue & "," & pQCObjectNo
        End If

        If pQCObjectFrom <> defString Then
            strConditionName = strConditionName & ",QCObjectNoFrom"
            strConditionValue = strConditionValue & "," & pQCObjectFrom
        End If

        If pQCObjectTo <> defString Then
            strConditionName = strConditionName & ",QCObjectNoTo"
            strConditionValue = strConditionValue & "," & pQCObjectTo
        End If

        LoadQCObjectInfo = COM_Utility.clsUtility.InvokeLoadFunction(gComputerName, gUserNo, "wsQC.LoadQCObjectRefInfo", "loadqcobjectrefinfo",
                                Split(strConditionName, ","), Split(strConditionValue, ","),
                                pRefTableName, pData,, pAdditional)

    End Function

End Module
