public static PassngerDTO GetPassengerDTO(Passenger passenger) { if (passenger == null) { return(null); } User user = UserConverters.GetUser(UserBL.GetUser(passenger.Identity)); passenger.User = user; PassngerDTO passengerDTO = new PassngerDTO() { Id = passenger.Id, Identity = passenger.Identity, Name = passenger.User.Name, Mail = passenger.User.Mail, Gender = passenger.User.Gender, }; return(passengerDTO); }
public static DriverDTO GetDriverDTO(Driver driver) { if (driver == null) { return(null); } User user = UserConverters.GetUser(UserBL.GetUser(driver.Identity)); driver.User = user; DriverDTO driverDto = new DriverDTO() { Id = driver.Id, Identity = driver.Identity, Name = driver.User.Name, Mail = driver.User.Mail, Gender = driver.User.Gender, NumberOfSeats = driver.NumberOfSeats, CarDescription = driver.CarDescription }; return(driverDto); }