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); }
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); }
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); }
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); }