Exemplo n.º 1
0
        public List <SearchResultDTO> GetSearchResult()
        {
            List <EquipmentRelocationDto> searchResult        = new SchedulingServerController().GetEquipmentRelocationAppointments(eqRequest);
            IMapObjectController          mapObjectController = new MapObjectController();
            List <SearchResultDTO>        retVal = new List <SearchResultDTO>();
            IEquipmentServerController    equipmentServerController = new EquipmentServerController();

            for (int i = 0; i < searchResult.Count(); i++)
            {
                EquipmentRelocationDto equipmentRelocationDto = searchResult.ElementAt(i);
                MapObject mo         = mapObjectController.GetMapObjectById(equipmentRelocationDto.SourceRoomId);
                var       equipments = equipmentServerController.GetEquipmentByRoomId(mo.Id);
                string    amount     = "";
                foreach (EquipmentDto eq in equipments)
                {
                    if (eq.Name.Equals(equipment))
                    {
                        amount = eq.Quantity.ToString();
                        break;
                    }
                }
                string timeInterval = equipmentRelocationDto.TimeInterval.Start.ToString() + "-" + equipmentRelocationDto.TimeInterval.End.ToString();
                EquipmentRelocationSearchResultDTO searchResultDTO = new EquipmentRelocationSearchResultDTO()
                {
                    Content = equipmentRelocationDto.SourceRoomId.ToString() + AllConstants.ContentSeparator
                              + equipmentRelocationDto.DestinationRoomId.ToString() + AllConstants.ContentSeparator
                              + amount + AllConstants.ContentSeparator
                              + timeInterval,
                    EquipmentRelocationDto = equipmentRelocationDto
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }
Exemplo n.º 2
0
        public List <SearchResultDTO> GetSearchResult()
        {
            List <RenovationDto>   searchResult        = new SchedulingServerController().GetRenovationAppointments(scheduling);
            IMapObjectController   mapObjectController = new MapObjectController();
            List <SearchResultDTO> retVal = new List <SearchResultDTO>();

            for (int i = 0; i < searchResult.Count(); i++)
            {
                RenovationDto             renovationDto   = searchResult.ElementAt(i);
                MapObject                 mo              = mapObjectController.GetMapObjectById(renovationDto.SourceRoomId);
                string                    timeInterval    = renovationDto.TimeInterval.Start.ToString() + "-" + renovationDto.TimeInterval.End.ToString();
                RenovationSearchResultDTO searchResultDTO = new RenovationSearchResultDTO()
                {
                    Content = renovationDto.SourceRoomId.ToString() + AllConstants.ContentSeparator
                              + timeInterval,
                    RenovationDto = renovationDto
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }