예제 #1
0
        public static FloorDTO convertToDto(Floor f)
        {
            FloorDTO floor = new FloorDTO();

            floor.id          = f.FloorID;
            floor.descrizione = f.Descrizione;
            floor.nomeFloor   = f.Nome;
            floor.building    = BuildingConverter.convertToDto(f.Building);
            return(floor);
        }
예제 #2
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);
        }