Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }