public Battery ConvertBattery(ReservationCtrServiceReference.Battery battery)
 {
     if (battery == null)
     {
         return null;
     }
     return new Battery
     {
         Id = battery.Id,
         Date = battery.Date,
         BatteryTypeID = battery.BatteryTypeID,
         BatteryStationID = battery.BatteryStationID,
         IsReserved = battery.IsReserved,
         PercentCharged = battery.PercentCharged,
         RowVersion = battery.RowVersion,
     };
 }
        private Customer ConvertCustomer(ReservationCtrServiceReference.Customer customer)
        {
            if (customer == null)
            {
                return null;
            }

            return new Customer
            {
                Id = customer.Id,
                Name = customer.Name,
                PhoneNr = customer.PhoneNr,
                BatteryID = customer.BatteryId,
                StreetAddress = customer.StreetAddress,
                ZipCodeNumber = customer.ZipCodeNumber,
            };
        }
        public Reservation ConvertReservation(ReservationCtrServiceReference.Reservation res)
        {
            if (res == null)
            {
                return null;
            }

            return new Reservation
            {
                ID = res.ID,
                Date = res.Date,
                CustomerID = res.CustomerID,
                Customer = ConvertCustomer(res.Customer),
                Batteries = ConvertBatteries(res.Batteries),
            };
        }