public static ItemType ConvertToItemType(ItemTypeDTO item) { ItemType ItemType = new ItemType(); ItemType.ItemTypeID = item.id; ItemType.Categoria = item.categoria; ItemType.Marca = item.marca; ItemType.Modello = item.modello; ItemType.Descrizione = item.descrizione; if (item.customer != null) { ItemType.Customer = CustomerConverter.convertToCustomer(item.customer); } return(ItemType); }
public static Listino convertToListino(ListinoDTO lDTO) { Listino l = new Listino(); l.ListinoID = lDTO.id; l.Anno = lDTO.anno; l.Nome = lDTO.nomeListino; if (lDTO.installer != null) { l.Installer = CustomerConverter.convertToCustomer(lDTO.installer); } if (lDTO.idManufacturer != null) { l.Manufacturer = CustomerConverter.convertToCustomer(lDTO.idManufacturer); } return(l); }
public static Thing convertToThing(ThingDTO tDTO) { Thing thing = new Thing(); thing.ThingID = tDTO.id; thing.Num_Uscite = tDTO.numUscite; thing.Prezzo = tDTO.prezzo; if (tDTO.customer != null) { thing.Customer = CustomerConverter.convertToCustomer(tDTO.customer); } else { thing.Customer = null; } thing.Building = BuildingConverter.convertToBuilding(tDTO.building); return(thing); }
public static Building convertToBuilding(BuildingDTO b) { Building building = new Building(); building.BuildingID = b.id; building.Cap = b.cap; building.Citta = b.city; building.Indirizzo = b.address; building.Interno = b.interno; /* * if (b.getOwner() != null) * building.setOwner(CustomerConverter.convertToCustomer(b.getOwner())); */ if (b.customer != null) { building.Customer = CustomerConverter.convertToCustomer(b.customer); } return(building); }