public ScreeningTimeBuilder SetSeatsFromHall(int hallId) { Hall hall = hallRepository.GetByID(hallId); screeningTime.Hall = hall; CopySeatsFromHall(screeningTime, hall); return(this); }
public bool UpdateHall(UpdateHallDTO updateHall) { Hall hall = hallRepository.GetByID(updateHall.Id); if (hall == null) { return(false); } hall.HallName = updateHall.HallName; hall.Rows = updateHall.Rows.Select(r => new Row { RowIndex = r.RowIndex, Seats = r.Seats.Select(s => new Seat { ColumnIndex = s.ColumnIndex, Status = s.Status }).ToList() }).ToList(); return(hallRepository.SaveChanges() > 0); }