public List <ActivityViewModel> Get(bool WithRooms, bool IncludeSpecial) { List <ActivityDTO> activities; if (WithRooms) { if (IncludeSpecial) { activities = ActivitiesBLRepository.GetWithEverything(); } else { activities = ActivitiesBLRepository.GetWithEverything().Where(a => a.IsSpecialActivity == false).ToList(); } } else { if (IncludeSpecial) { activities = ActivitiesBLRepository.Get(); } else { activities = ActivitiesBLRepository.GetWithEverything().Where(a => a.IsSpecialActivity == false).ToList(); } } List <ActivityViewModel> activityViewModels = configsGenerator.DTOToActivityViewModel().Map <List <ActivityViewModel> >(activities); for (int i = 0; i < activityViewModels.Count; i++) { activityViewModels[i].PosibleRooms = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(activities[i].IncludedRooms); } return(activityViewModels); }
public List <RoomViewModel> Get(bool WithActivities, bool WithEquipment, bool WithOrders) { List <RoomDTO> roomDTOs; if (WithActivities || WithEquipment || WithOrders) { roomDTOs = RoomsBLRepository.GetWithEverything(); } else { roomDTOs = RoomsBLRepository.Get(); } List <RoomViewModel> roomViewModels = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(roomDTOs); for (int i = 0; i < roomViewModels.Count; i++) { if (WithActivities) { roomViewModels[i].PosibleActivities = configsGenerator.DTOToActivityViewModel().Map <List <ActivityViewModel> >(roomDTOs[i].IncludedActivities); } if (WithEquipment) { roomViewModels[i].RoomEquipment = configsGenerator.DTOToEquipmentViewModel().Map <List <EquipmentViewModel> >(roomDTOs[i].IncludedEquipment); } if (WithOrders) { roomViewModels[i].RoomOrders = configsGenerator.DTOToOrderViewModel().Map <List <OrderViewModel> >(roomDTOs[i].IncludedOrders); } } return(roomViewModels); }
public List <OrderViewModel> Get(bool WithRooms) { List <OrderDTO> orderDTOs; if (WithRooms) { orderDTOs = OrdersBLRepository.GetWithEverything(); } else { orderDTOs = OrdersBLRepository.Get(); } List <OrderViewModel> orderViewModels = configsGenerator.DTOToOrderViewModel().Map <List <OrderViewModel> >(orderDTOs); for (int i = 0; i < orderViewModels.Count; i++) { orderViewModels[i].OrderedRooms = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(orderDTOs[i].IncludedRooms); } return(orderViewModels); }
public List <EquipmentViewModel> Get(bool WithRooms) { List <EquipmentDTO> equipmentDTOs; if (WithRooms) { equipmentDTOs = EquipmentBLRepository.GetWithEverything(); } else { equipmentDTOs = EquipmentBLRepository.Get(); } List <EquipmentViewModel> equipmentViewModels = configsGenerator.DTOToEquipmentViewModel().Map <List <EquipmentViewModel> >(equipmentDTOs); for (int i = 0; i < equipmentDTOs.Count; i++) { equipmentViewModels[i].RoomsThatHaveIt = configsGenerator.DTOToRoomViewModel().Map <List <RoomViewModel> >(equipmentDTOs[i].IncludedRooms); } return(equipmentViewModels); }