You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
3.4 KiB

Imports System.Data
Imports System.Data.SqlClient
Imports EDOKALib.Common
'''<summary>Diese klasse beinhaltet die Logik für die Teams</summary>
Public Class Team
#Region "Members"
Private _teamNr As Integer
Private _bezeichnung As String
Private _kostenstellenNr As Integer
Private _mandantNr As Integer
Private _isAktiv As Boolean
Private _erstelltAm As DateTime
Private _mutiertAm As DateTime
Private _mutiererMitarbeiter As BusinessFacade.Mitarbeiter
#End Region
#Region "Constructor"
'''<summary>Erstellt eine neue Instanz für ein bestehendes Team</summary>
'''<param name="teamNr"></param>
Public Sub New(ByVal teamNr As Integer)
Try
Dim ds As New DataSet()
DataAccess.Team.GetById(teamNr, ds)
If ds.Tables.Count > 0 Then
If ds.Tables(0).Rows.Count > 0 Then
_teamNr = teamNr
_bezeichnung = Tools.CToString(ds.Tables(0).Rows(0)("bezeichnung"))
_kostenstellenNr = Tools.CToInt32(ds.Tables(0).Rows(0)("kostenstellenr"))
_mandantNr = Tools.CToInt32(ds.Tables(0).Rows(0)("mandantnr"))
_isAktiv = Common.Tools.CToBool(ds.Tables(0).Rows(0)("aktiv"))
_erstelltAm = Tools.CToDateTime(ds.Tables(0).Rows(0)("erstellt_am"))
_mutiertAm = Tools.CToDateTime(ds.Tables(0).Rows(0)("mutiert_am"))
_mutiererMitarbeiter = New BusinessFacade.Mitarbeiter(Tools.CToInt32(ds.Tables(0).Rows(0)("mutierer")))
End If
End If
Catch ex As Exception
Throw ex
End Try
End Sub
#End Region
#Region "Public methods"
'''<summary>Gibt eine Liste mit allen Teams zurück</summary>
'''<param name="ds">Das DataSet welches gefüllt werden soll</param>
Public Overloads Shared Sub GetListe(ByRef ds As DataSet)
Try
DataAccess.Team.GetListe(ds)
Catch ex As Exception
Throw ex
End Try
End Sub
'''<summary>Gibt eine Liste mit allen Teams denen ein Mitarbeiter zugewiesen ist zurück</summary>
'''<param name="ds">Das DataSet welches gefüllt werden soll</param>
Public Overloads Shared Sub GetListeByMitarbeiterNr(ByVal mitarbeiterNr As Integer, ByRef ds As DataSet)
Try
DataAccess.Team.GetListeByMitarbeiterNr(mitarbeiterNr, ds)
Catch ex As Exception
Throw ex
End Try
End Sub
#End Region
#Region "Properties"
Public ReadOnly Property TeamNr() As Integer
Get
Return _teamNr
End Get
End Property
Public Property Bezeichnung() As String
Get
Return _bezeichnung
End Get
Set(ByVal Value As String)
_bezeichnung = Value
End Set
End Property
Public Property KostenstellenNr() As Integer
Get
Return _kostenstellenNr
End Get
Set(ByVal Value As Integer)
_kostenstellenNr = Value
End Set
End Property
Public Property MandantNr() As Integer
Get
Return _mandantNr
End Get
Set(ByVal Value As Integer)
_mandantNr = Value
End Set
End Property
Public Property IsAktiv() As Boolean
Get
Return _isAktiv
End Get
Set(ByVal Value As Boolean)
_isAktiv = Value
End Set
End Property
Public Property ErstelltAm() As DateTime
Get
Return _erstelltAm
End Get
Set(ByVal Value As DateTime)
_erstelltAm = Value
End Set
End Property
Public ReadOnly Property MutiertAm() As DateTime
Get
Return _mutiertAm
End Get
End Property
Public ReadOnly Property MutiererMitarbeiter() As BusinessFacade.Mitarbeiter
Get
Return _mutiererMitarbeiter
End Get
End Property
#End Region
End Class