public bool IsAutoAvailable(ReservationDto reservation) { { WriteActualMethod(); return(ServiceReservation.IsAutoAvailable(reservation.ConvertToEntity())); } }
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)); }
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); }
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)");//***** } }
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); } }
public ReservationDto GetReservationByReservationsNr(int reservationsnr) { WriteActualMethod(); return(DtoConverter.ConvertToDto(ServiceReservation.getReservationByReservationsNr(reservationsnr))); }
public void DeleteReservation(ReservationDto reservation) { WriteActualMethod(); ServiceReservation.DeleteReservation(DtoConverter.ConvertToEntity(reservation)); }