Пример #1
0
        public void Delete(DeleteBookingRequest request)
        {
            DbBooking dbBooking = new DbBooking();

            if (request.Id.HasValue)
            {
                dbBooking.Delete(request.Id.Value);
            }
            else
            {
                throw new Exception("Please enter a valid ID");
            }
        }
Пример #2
0
        public ActionResult DeleteBooking([FromBody] DeleteBookingRequest request)
        {
            Console.WriteLine($"Deleting booking");
            if (request == null)
            {
                Console.WriteLine("Delete booking request was null or invalid");
                return(null);
            }

            _bookingService.DeleteBooking(request.BookingId, request.Operation);

            var result = "Request for delete was sent";

            return(Ok(result));
        }
Пример #3
0
        public async Task <DeleteBookingResponse> DeleteBooking(DeleteBookingRequest request)
        {
            bool deleted;

            using (var db = _provider.GetDatabase())
            {
                var bookings = db.GetCollection <BookingDetails>("bookings");

                deleted = bookings.Delete(request.Id);
            }

            return(await Task.FromResult(new DeleteBookingResponse
            {
                Deleted = deleted
            }));
        }
Пример #4
0
        public void Delete(DeleteBookingRequest request)
        {
            var bookingCtr = new BookingCtr();

            bookingCtr.Delete(request.ID);
        }