1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Public Class Marque
Inherits ANTI_MALI_DTO.Marque
Public Sub New(id As Integer, name As String)
MyBase.New(id, name)
End Sub
Public Function GetFournisseurs() As List(Of Fournisseur)
Return Fournisseur.SelectFournisseur(, Me.Id)
End Function
Public Function GetStores() As List(Of Store)
Return Store.SelectStore(, , , Me.Id)
End Function
Public Function GetDemos() As List(Of Demo)
Return Demo.SelectDemo()
End Function
Public Shared Function SelectMarque(Optional ByVal id As Integer = -1, Optional ByVal idFournisseur As Integer = -1) As List(Of Marque)
Dim result As New List(Of Marque)
For Each m As ANTI_MALI_DTO.Marque In ANTI_MALI_DAL.Marque.SelectMarque(id, idFournisseur)
result.Add(New Marque(m.Id, m.Name))
Next
Return result
End Function
End Class
Public Class Fournisseur
Inherits ANTI_MALI_DTO.Fournisseur
Public Sub New()
MyBase.New()
End Sub
Public Sub New(id As Integer, name As String)
MyBase.New(id, name)
End Sub
Public Function GetMarques() As List(Of Marque)
Return Marque.SelectMarque(, Me.Id)
End Function
Public Shared Function SelectFournisseur(Optional ByVal id As Integer = -1, Optional ByVal idMarque As Integer = -1) As List(Of Fournisseur)
Dim result As New List(Of Fournisseur)
For Each f As ANTI_MALI_DTO.Fournisseur In ANTI_MALI_DAL.Fournisseur.SelectFournisseur(id, idMarque)
result.Add(New Fournisseur(f.Id, f.Name))
Next
Return result
End Function
End Class |
Partager