Exemple #1
0
        public OrderViewModel Get(int id, bool WithRooms)
        {
            OrderDTO       orderDTO;
            OrderViewModel orderViewModel;

            if (WithRooms)
            {
                orderDTO       = OrdersBLRepository.FindByIdWithEverything(id);
                orderViewModel = configsGenerator.DTOToOrderViewModel().Map <OrderViewModel>(orderDTO);
                orderViewModel.OrderedRooms = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(orderDTO.IncludedRooms);
            }
            else
            {
                orderDTO       = OrdersBLRepository.FindById(id);
                orderViewModel = configsGenerator.DTOToOrderViewModel().Map <OrderViewModel>(orderDTO);
            }
            return(orderViewModel);
        }
        public EquipmentViewModel Get(int id, bool WithRooms)
        {
            EquipmentDTO       equipmentDTO;
            EquipmentViewModel equipmentViewModel;

            if (WithRooms)
            {
                equipmentDTO       = EquipmentBLRepository.FindByIdWithEverything(id);
                equipmentViewModel = configsGenerator.DTOToEquipmentViewModel().Map <EquipmentViewModel>(equipmentDTO);
                equipmentViewModel.RoomsThatHaveIt = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(equipmentDTO.IncludedRooms);
            }
            else
            {
                equipmentDTO       = EquipmentBLRepository.FindById(id);
                equipmentViewModel = configsGenerator.DTOToEquipmentViewModel().Map <EquipmentViewModel>(equipmentDTO);
            }
            return(equipmentViewModel);
        }
Exemple #3
0
        public ActivityViewModel Get(int id, bool WithRooms)
        {
            ActivityDTO       activityDTO;
            ActivityViewModel activityViewModel;

            if (WithRooms)
            {
                activityDTO = ActivitiesBLRepository.FindByIdWithEverything(id);
                List <RoomViewModel> rooms = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(activityDTO.IncludedRooms);
                activityViewModel = configsGenerator.DTOToActivityViewModel().Map <ActivityViewModel>(activityDTO);
                activityViewModel.PosibleRooms = rooms;
            }
            else
            {
                activityDTO       = ActivitiesBLRepository.FindById(id);
                activityViewModel = configsGenerator.DTOToActivityViewModel().Map <ActivityViewModel>(activityDTO);
            }
            return(activityViewModel);
        }
        public RoomViewModel Get(int id, bool WithEverything)
        {
            RoomDTO       roomDTO;
            RoomViewModel roomViewModel;

            if (WithEverything)
            {
                roomDTO       = RoomsBLRepository.FindByIdWithEverything(id);
                roomViewModel = configsGenerator.DTOToRoomViewModel().Map <RoomViewModel>(roomDTO);
                roomViewModel.PosibleActivities = configsGenerator.DTOToActivityViewModel().Map <List <ActivityViewModel> >(roomDTO.IncludedActivities);
                roomViewModel.RoomEquipment     = configsGenerator.DTOToEquipmentViewModel().Map <List <EquipmentViewModel> >(roomDTO.IncludedEquipment);
                roomViewModel.RoomOrders        = configsGenerator.DTOToOrderViewModel().Map <List <OrderViewModel> >(roomDTO.IncludedOrders);
            }
            else
            {
                roomDTO       = RoomsBLRepository.FindById(id);
                roomViewModel = configsGenerator.DTOToRoomViewModel().Map <RoomViewModel>(roomDTO);
            }
            return(roomViewModel);
        }