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); }
public AdditionalInformationDTO GetContentRows() { IEquipmentServerController equipmentServerController = new EquipmentServerController(); IEnumerable <EquipmentDto> allEquipment = equipmentServerController.GetEquipmentByRoomId(id); string[] equipmentContentRows = new string[allEquipment.Count()]; for (int i = 0; i < allEquipment.Count(); i++) { equipmentContentRows[i] = allEquipment.ElementAt(i).Name + AllConstants.ContentSeparator + allEquipment.ElementAt(i).Quantity; } return(new AdditionalInformationDTO() { MapObjectId = id, ContentRows = equipmentContentRows }); }