Esempio n. 1
0
        public List <SearchResultDTO> GetSearchResult()
        {
            IEnumerable <EquipmentDto> searchResult              = new EquipmentServerController().GetEquipmentByRoomId(schedulingDto.SourceRoomId);
            List <SearchResultDTO>     retVal                    = new List <SearchResultDTO>();
            IMapObjectController       mapObjectController       = new MapObjectController();
            IEquipmentServerController equipmentServerController = new EquipmentServerController();

            for (int i = 0; i < searchResult.Count(); i++)
            {
                EquipmentDto           equipmentDto           = searchResult.ElementAt(i);
                MapObject              mo                     = mapObjectController.GetMapObjectById(equipmentDto.RoomId);
                string                 amount                 = "0";
                string                 timeInterval           = schedulingDto.TimeInterval.Start.ToString() + "-" + schedulingDto.TimeInterval.End.ToString();
                EquipmentSeparationDto equipmentSeparationDto = new EquipmentSeparationDto()
                {
                    SourceRoomId        = schedulingDto.SourceRoomId,
                    SourceQuantity      = equipmentDto.Quantity,
                    DestinationRoomId   = schedulingDto.DestinationRoomId,
                    DestinationQuantity = 0,
                    Name = equipmentDto.Name
                };
                EquipmentSeparationSearchResultDTO searchResultDTO = new EquipmentSeparationSearchResultDTO()
                {
                    Content = equipmentDto.Name + AllConstants.ContentSeparator
                              + equipmentDto.Quantity + AllConstants.ContentSeparator
                              + equipmentDto.Name + AllConstants.ContentSeparator
                              + amount,
                    EquipmentSeparationDto = equipmentSeparationDto
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }
Esempio n. 2
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);
        }
        public void Search_by_filled_combo_box()
        {
            IEquipmentServerController equipmentServerController = new EquipmentServerController();

            var equipment = equipmentServerController.GetEquipmentByType("computer");

            Assert.NotEmpty(equipment);
        }
        public void Search_by_empty_combo_box()
        {
            IEquipmentServerController equipmentServerController = new EquipmentServerController();

            var equipment = equipmentServerController.GetEquipmentByType(AllConstants.EmptyComboBox);

            Assert.Empty(equipment);
        }
        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
            });
        }
Esempio n. 6
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);
        }