예제 #1
0
        //ParkingPlaceRepository parkingPlaceRepository = new ParkingPlaceRepository();
        public ParkingPlaceDTO ParkingPlaceToParkingPlaceDTO(ParkingPlace parkingPlace)
        {
            ParkingPlaceDTO parkingPlaceDTO = new ParkingPlaceDTO();

            parkingPlaceDTO.Number = parkingPlace.Number;
            ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper();

            parkingPlaceDTO.Ticket = parkingTicketMapper.ParkingTicketToParkingTicketDTO(parkingPlace.Ticket);
            return(parkingPlaceDTO);
        }
예제 #2
0
        //CarRepository carRepository = new CarRepository();
        public CarDTO CarToCarDTO(Car car)
        {
            CarDTO carDTO = new CarDTO();

            carDTO.Name = car.Name;
            //carDTO.id = car.id;
            carDTO.Tickets = new List <ParkingTicketDTO>();
            ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper();

            foreach (var i in car.Tickets)
            {
                carDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i));
            }

            return(carDTO);
        }
예제 #3
0
        //ClientRepository clientRepository = new ClientRepository();
        public ClientDTO ClientToClientDTO(Client client)
        {
            ClientDTO clientDTO = new ClientDTO();

            clientDTO.Name = client.Name;
            //clientDTO.id = client.id;
            clientDTO.Tickets = new List <ParkingTicketDTO>();
            ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper();

            //foreach (var i in client.Tickets)
            //{
            //    clientDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i));
            //}

            return(clientDTO);
        }
예제 #4
0
        //ParkingRepository parkingRepository = new ParkingRepository();
        public ParkingDTO ParkingToParkingDTO(Parking parking)
        {
            ParkingDTO parkingDTO = new ParkingDTO();

            parkingDTO.ParkingName = parking.ParkingName;
            //parkingDTO.id = parking.id;
            parkingDTO.Tickets = new List <ParkingTicketDTO>();
            parkingDTO.Places  = new List <ParkingPlaceDTO>();
            ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper();
            ParkingPlaceMapper  parkingPlaceMapper  = new ParkingPlaceMapper();

            foreach (var i in parking.Tickets)
            {
                parkingDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i));
            }

            foreach (var i in parking.Places)
            {
                parkingDTO.Places.Add(parkingPlaceMapper.ParkingPlaceToParkingPlaceDTO(i));
            }

            return(parkingDTO);
        }