Exemplo n.º 1
0
 public bool IsAutoAvailable(ReservationDto reservation)
 {
     {
         WriteActualMethod();
         return(ServiceReservation.IsAutoAvailable(reservation.ConvertToEntity()));
     }
 }
Exemplo n.º 2
0
            private static DossierReservation ChoisirDossier()
            {
                Console.WriteLine("Choisissez votre numero de dossier");
                var idDossier = int.Parse(Console.ReadLine());

                var serviceReservation = new ServiceReservation();

                return(serviceReservation.GetDossier(idDossier));
            }
Exemplo n.º 3
0
            private static void SupprimerReservation()
            {
                Console.WriteLine();
                Console.WriteLine(">SUPPRESSION D'UNE RESERVATION");

                DossierReservation dossier = ChoisirDossier();

                var serviceResa = new ServiceReservation();

                serviceResa.SupprimerDossierReservation(dossier);
            }
        //public async Task<bool> MarkReservationAsDone(Guid id)
        //{
        //    ar reservations = await _context.ServiceReservations
        //        .Where(x => x.Done == false && x.EmployeeId == user.Id)
        //        .ToArrayAsync();
        //}

        public async Task <bool> AddServiceReservationAsync(ServiceReservation reservation, IdentityUser user)
        {
            reservation.Id         = Guid.NewGuid();
            reservation.Done       = false;
            reservation.CustomerId = user.Id;

            _context.ServiceReservations.Add(reservation);

            var saveResult = await _context.SaveChangesAsync();

            return(saveResult == 1);
        }
Exemplo n.º 5
0
            private static void AfficherDossiersReservation()
            {
                Console.WriteLine();
                Console.WriteLine("> Dossiers :");

                var servicedossier = new ServiceReservation();//aporter correction**
                var dossier        = serviceVoiture.ListerMarques();

                foreach (var marque in marques)
                {
                    Console.Write($"{marque.Nom} ({marque.Id})");
                    Console.WriteLine($" :{marque.Modeles.Count} modèle(s)");//*****
                }
            }
Exemplo n.º 6
0
 public ReservationDto InsertReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(ServiceReservation.InstertReservation(DtoConverter.ConvertToEntity(reservation))));
     }
     catch (OptimisticConcurrencyException <Reservation> ex)
     {
         throw new FaultException <ReservationDto>(ex.MergedEntity.ConvertToDto(), ex.Message);
     }
     catch (BusinessLayer.Exceptions.InvalidDateRangeException ex)
     {
         var invEx = new Common.Interfaces.Faults.InvalidDateRangeException(ex.Message);
         throw new FaultException <Common.Interfaces.Faults.InvalidDateRangeException>(invEx);
     }
     catch (BusinessLayer.Exceptions.AutoUnavailableException ex)
     {
         var unavEx = new Common.Interfaces.Faults.AutoUnavailableException(ex.Message);
         throw new FaultException <Common.Interfaces.Faults.AutoUnavailableException>(unavEx);
     }
 }
Exemplo n.º 7
0
 public ReservationDto GetReservationByReservationsNr(int reservationsnr)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(ServiceReservation.getReservationByReservationsNr(reservationsnr)));
 }
Exemplo n.º 8
0
 public void DeleteReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     ServiceReservation.DeleteReservation(DtoConverter.ConvertToEntity(reservation));
 }