Imports IntraSell_DLL

Public Module ModuleLieferanten

    Public Function LieferantAnlegen(lieferantFirmaName As String) As Integer
        Dim existsLagerNr = FirstRow("select IDNR from lieferantenadressen where Firma = '" & lieferantFirmaName & "'")
        If IsNumeric(existsLagerNr) Then
            Return existsLagerNr
        Else
            Dim nId = NextId("`lieferantenadressen`", "IDNR")
            RunSQL("insert into lieferantenadressen (IDNR, Firma) Values (" & nId & ",'" & lieferantFirmaName & "')")
            Return nId
        End If
    End Function

End Module
