Floorplan Updated
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
open System
|
||||
open DredgeFramework
|
||||
open Dapper.FSharp
|
||||
|
||||
[<CLIMutable>]
|
||||
type reservation = {
|
||||
reservation_id: int
|
||||
id: int
|
||||
reservation_name: string
|
||||
reservation_time: int
|
||||
reservation_covers: int
|
||||
@@ -16,13 +16,21 @@ type reservation = {
|
||||
let GetReservationById (id: int) =
|
||||
select {
|
||||
table "reservations"
|
||||
where (eq "reservation_id" id)
|
||||
where (eq "id" id)
|
||||
}
|
||||
|> db.Select<reservation>
|
||||
|> first
|
||||
|
||||
let updateReservation (reservation: reservation) =
|
||||
update{
|
||||
table "reservations"
|
||||
set reservation
|
||||
where(eq "id" reservation.id)
|
||||
} |> db.Update |> ignore
|
||||
reservation
|
||||
|
||||
let DeleteReservation (tableId: int) =
|
||||
delete {
|
||||
table "reservations"
|
||||
where (eq "table_id" tableId)
|
||||
where (eq "reservation_table_id" tableId)
|
||||
} |> db.Delete |> ignore
|
||||
Reference in New Issue
Block a user