1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
Public Function GetTIMESHEETsMonday() As Double Dim Monday As Date = GetThisMondayDate() Dim totalTime = From t In Me.ObjectContext.TIMESHEETs Where t.TaskDate = Monday Select t If totalTime.Count <> 0 Then Return Aggregate T In totalTime Into Sum(T.TaskTime) Else Return 0 End If End Function
1: 2: 3: 4: 5:
Dim query = From t In ObjectContext.TIMESHEETs _ Where t.TaskDate = Monday _ Select t.TaskTime Dim sum As Integer = IIf(query IsNot Nothing, query.Sum(), 0)