public void CreateTimeSlot(TimeSlotDTO newTimeSlot)
        {
            //Prepare sql query
            string sql = @"insert into dbo.TimeSlot (BusinessId, DayOTWeek, StartTime, EndTime, NumberOfSpots) 
                           values(@BusinessId, @DayOTWeek, @StartTime, @EndTime, @NumberOfSpots);";

            _dBManager.SaveData(sql, newTimeSlot);
        }
Example #2
0
        public void CreateTimeSlot(TimeSlotModel newTimeSlot)
        {
            // map Logic model to DTO
            TimeSlotDTO newTimeSlotDTO = new TimeSlotDTO
            {
                BusinessId    = newTimeSlot.BusinessId,
                DayOTWeek     = newTimeSlot.DayOTWeek,
                StartTime     = newTimeSlot.StartTime,
                EndTime       = newTimeSlot.EndTime,
                NumberOfSpots = newTimeSlot.NumberOfSpots
            };


            _timeSlotCollectionDAL.CreateTimeSlot(newTimeSlotDTO);
        }
        private static BookingDTO ItemToDTO(Booking booking)
        {
            var seatDTOs = booking.Seats.Select(seat => new SeatDTO {
                ID = seat.ID, Nr = seat.Nr, Row = seat.Row
            }).ToList();
            var timeSlotDTO = new TimeSlotDTO {
                ID = booking.TimeSlot.ID, Time = booking.TimeSlot.Time, CinemaRoom = booking.TimeSlot.CinemaRoom, Movie = booking.TimeSlot.Movie
            };

            return(new BookingDTO
            {
                Email = booking.Email,
                ID = booking.ID,
                Seats = seatDTOs,
                TimeSlot = timeSlotDTO
            });
        }
Example #4
0
 public bool Update(TimeSlotDTO account)
 {
     return(API.PUT <string>($"api/{controlerAPI}/{account.IDTimeSlot}", account).Key);
 }
Example #5
0
 public bool Create(TimeSlotDTO account)
 {
     return(API.POST <object>($"api/{controlerAPI}", account).Key);
 }