public MakeReservationTicketSummary Make(IReservationCreation ticket)
        {
            if (DateTime.Compare(ticketsRepo.TicketStartTime(ticket.ProjId), DateTime.Now) < 0)
            {
                return(new MakeReservationTicketSummary(false, $"Can't make reservation. Projection {ticket.ProjId} has already started."));
            }

            return(new MakeReservationTicketSummary(true, ticketsRepo.MakeReservation(ticket)));
        }
Beispiel #2
0
        public MakeReservationTicketSummary Make(IReservationCreation ticket)
        {
            // global constant for timespan
            if (ticketsRepo.TicketStartTime(ticket.ProjId) - DateTime.Now <= new TimeSpan(0, 10, 0))
            {
                return new MakeReservationTicketSummary(false, $"Can't make reservation. Projection {ticket.ProjId} is about to start.");
            }

            return new MakeReservationTicketSummary(true, ticketsRepo.MakeReservation(ticket));
        }