Download Summary

Transcript
60
Source code
s e l e c t ( c o u r s e . CourseId ) }
l e t getAllocatedCourses =
query { f o r a l l o c a t i o n i n db . A l l o c a t i o n s do
j o i n c o u r s e i n db . C ou rse s on
( a l l o c a t i o n . CourseId = c o u r s e . CourseId )
s e l e c t ( c o u r s e . CourseId , c o u r s e . CourseName , c o u r s e . S t u d e n t s )
distinct }
let getAllAllocations =
query { f o r a l l o c a t i o n i n db . A l l o c a t i o n s do
s e l e c t ( a l l o c a t i o n . AllocNr , a l l o c a t i o n . RoomId ,
a l l o c a t i o n . CourseId , a l l o c a t i o n . T a b l e S e c t i o n ) }
l e t getAllocationsForCourse c =
query { f o r a l l o c a t i o n i n db . A l l o c a t i o n s do
where ( a l l o c a t i o n . CourseId = c )
s e l e c t ( a l l o c a t i o n . AllocNr , a l l o c a t i o n . RoomId ,
a l l o c a t i o n . CourseId , a l l o c a t i o n . T a b l e S e c t i o n ) }
l e t getAllocationsForRoom r =
query { f o r a l l o c a t i o n i n db . A l l o c a t i o n s do
where ( a l l o c a t i o n . RoomId = r )
s e l e c t ( a l l o c a t i o n . AllocNr , a l l o c a t i o n . RoomId ,
a l l o c a t i o n . CourseId , a l l o c a t i o n . T a b l e S e c t i o n ) }
let getAllLocations =
query { f o r l o c a t i o n i n db . L o c a t i o n s do
s e l e c t ( l o c a t i o n . BuildNr , l o c a t i o n . CoordinateX ,
l o c a t i o n . CoordinateX ) }
l e t g e t B u i l d i n g s = query { f o r room i n db . Rooms do
s e l e c t ( room . BuildNr )
distinct}
// c o n v e r t i n g s e q u e n c e s t o l i s t s f o r s i m p l i c i t y
l e t allRooms = Seq . t o L i s t getAllRooms
l e t a l l C o u r s e s = Seq . t o L i s t g e t A l l C o u r s e s
l e t a l l A l l o c a t i o n s = Seq . t o L i s t g e t A l l A l l o c a t i o n s
l e t a l l L o c a t i o n s = Seq . t o L i s t g e t A l l L o c a t i o n s