コード例 #1
0
        public List <SearchResultDTO> GetSearchResult()
        {
            IMedicationServerController medicationServerController = new MedicationServerController();
            IMapObjectController        mapObjectController        = new MapObjectController();
            List <MedicationDto>        searchResults = medicationServerController.GetAllMedicationByName(name).ToList();
            List <SearchResultDTO>      retVal        = new List <SearchResultDTO>();

            MapObject mo = mapObjectController.GetMapObjectById(AllConstants.StorageRoomId);

            for (int i = 0; i < searchResults.Count(); i++)
            {
                MedicationDto   medicationDto   = searchResults.ElementAt(i);
                SearchResultDTO searchResultDTO = new SearchResultDTO()
                {
                    MapObjectId = mo.Id,
                    Content     = medicationDto.Quantity + AllConstants.ContentSeparator + MapObjectSearchResult.MapObjectToRow(mo)
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }
コード例 #2
0
        public List <SearchResultDTO> GetSearchResult()
        {
            IEquipmentServerController equipmentServerController = new EquipmentServerController();
            IMapObjectController       mapObjectController       = new MapObjectController();
            List <EquipmentDto>        searchResult = equipmentServerController.GetEquipmentByType(type).ToList();
            List <SearchResultDTO>     retVal       = new List <SearchResultDTO>();

            for (int i = 0; i < searchResult.Count(); i++)
            {
                EquipmentDto    equipmentDto    = searchResult.ElementAt(i);
                MapObject       mo              = mapObjectController.GetMapObjectById(equipmentDto.RoomId);
                SearchResultDTO searchResultDTO = new SearchResultDTO()
                {
                    MapObjectId = mo.Id,
                    Content     = equipmentDto.Quantity + AllConstants.ContentSeparator + MapObjectSearchResult.MapObjectToRow(mo)
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }