Exemplo n.º 1
0
        public static PrezzoDTO convertToDTO(Prezzo p)
        {
            PrezzoDTO pDTO = new PrezzoDTO();

            pDTO.id       = p.PrezzoID;
            pDTO.prezzo   = p.Price;
            pDTO.itemType = ItemTypeConverter.ConverToDTO(p.ItemType);
            pDTO.listino  = ListinoConverter.convertToDTO(p.Listino);
            return(pDTO);
        }
Exemplo n.º 2
0
        public static ItemDTO convertToDTO(Item item)
        {
            ItemDTO itemDTO = new ItemDTO();

            itemDTO.id = item.ItemID;
            itemDTO.consumoEnergetico = item.ConsumoEnergetico;
            itemDTO.seriale           = item.Seriale;
            if (item.Room != null)
            {
                itemDTO.room = RoomConverter.convertToDto(item.Room);
            }
            if (item.ItemType != null)
            {
                itemDTO.itemType = ItemTypeConverter.ConverToDTO(item.ItemType);
            }
            if (item.Thing != null)
            {
                itemDTO.thing = ThingConverter.convertToDto(item.Thing);
            }
            return(itemDTO);
        }