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 ItemTypeDTO ConverToDTO(ItemType item)
        {
            ItemTypeDTO ItemType = new ItemTypeDTO();

            ItemType.id          = item.ItemTypeID;
            ItemType.categoria   = item.Categoria;
            ItemType.marca       = item.Marca;
            ItemType.modello     = item.Modello;
            ItemType.descrizione = item.Descrizione;
            if (item.Customer != null)
            {
                ItemType.customer = CustomerConverter.convertToDto(item.Customer);
            }
            return(ItemType);
        }
Beispiel #3
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 #4
0
        public static ListinoDTO convertToDTO(Listino l)
        {
            ListinoDTO lDTO = new ListinoDTO();

            lDTO.id          = l.ListinoID;
            lDTO.anno        = l.Anno;
            lDTO.nomeListino = l.Nome;
            if (l.Installer != null)
            {
                lDTO.installer = CustomerConverter.convertToDto(l.Installer);
            }
            if (l.Manufacturer != null)
            {
                lDTO.idManufacturer = CustomerConverter.convertToDto(l.Manufacturer);
            }
            return(lDTO);
        }
Beispiel #5
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 #6
0
        public static ThingDTO convertToDto(Thing t)
        {
            ThingDTO thingDTO = new ThingDTO();

            thingDTO.id        = t.ThingID;
            thingDTO.numUscite = t.Num_Uscite;
            thingDTO.prezzo    = t.Prezzo;
            if (t.Customer != null)
            {
                thingDTO.customer = CustomerConverter.convertToDto(t.Customer);
            }
            else
            {
                thingDTO.customer = null;
            }
            thingDTO.building = BuildingConverter.convertToDto(t.Building);
            return(thingDTO);
        }
Beispiel #7
0
        public static BuildingDTO convertToDto(Building b)
        {
            BuildingDTO building = new BuildingDTO();

            building.id      = b.BuildingID;
            building.cap     = b.Cap;
            building.city    = b.Citta;
            building.address = b.Indirizzo;
            building.interno = b.Interno;
            if (b.Customer != null)
            {
                building.customer = CustomerConverter.convertToDto(b.Customer);
            }

            /*
             * if (b.getOwner() != null)
             *  building.setOwner(CustomerConverter.convertToDto(b.getOwner()));
             */
            return(building);
        }
Beispiel #8
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);
        }