public void CreateReservation(int customerID, List<Battery> batteries)
        {
            try
            {
                Reservation res = new Reservation { Date = DateTime.Now, CustomerID = customerID };

                reservationRepository.InsertReservation(res);
                reservationRepository.Save();

                if (batteries != null)
                {
                    foreach (Battery battery in batteries)
                    {
                        battery.IsReserved = true;
                        battery.ReservationID = res.ID;
                        new BatteryCtr().UpdateBattery(battery);
                    }
                }

                reservationRepository.UpdateReservation(res);
                reservationRepository.Save();
            }
            catch (DbUpdateConcurrencyException e)
            {
                throw new FaultException(e.Message);
            }
            catch (Exception e)
            {
                throw new FaultException(e.Message);
            }
        }
 public void UpdateReservation(Reservation reservation)
 {
     this.context.Entry(reservation).State = EntityState.Modified;
 }
 public void InsertReservation(Reservation reservation)
 {
     this.context.Reservations.Add(reservation);
 }
 public void UpdateReservation(Reservation reservation)
 {
     reservationRepository.UpdateReservation(reservation);
     reservationRepository.Save();
 }
 public void UpdateReservation(Reservation reservation)
 {
     controller.UpdateReservation(reservation);
 }