Exemple #1
0
        public static Prezzo convertToPrezzo(PrezzoDTO pDTO)
        {
            Prezzo p = new Prezzo();

            p.PrezzoID = pDTO.id;
            p.Price    = pDTO.prezzo;
            p.ItemType = ItemTypeConverter.ConvertToItemType(pDTO.itemType);
            p.Listino  = ListinoConverter.convertToListino(pDTO.listino);
            return(p);
        }
Exemple #2
0
        public static Item convertToItem(ItemDTO itemDTO)
        {
            Item item = new Item();

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