Exemplo n.º 1
0
        public bool SaveReservation([FromBody] ReservationData d)
        {
            if (!d.IsValid())
            {
                return(false);
            }

            Customer    c = d.ToCustomer();
            Reservation r = d.ToReservation(c);

            // TODO PG -> add test here to make sure a duplicate reservation is not made!

            // Send confirmation email if successful
            if (Database.AddReservation(d.ToLayout(), r, d.ToArea(), c))
            {
                SendConfirmationEmail(d, r.Id);
                return(true);
            }
            else
            {
                return(false);
            }
        }