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); }
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 }); }
public bool Update(TimeSlotDTO account) { return(API.PUT <string>($"api/{controlerAPI}/{account.IDTimeSlot}", account).Key); }
public bool Create(TimeSlotDTO account) { return(API.POST <object>($"api/{controlerAPI}", account).Key); }