Esempio n. 1
0
 public StopOverDTO GetByBooking(int idBooking)
 {
     using (CarRentalEntities context = new CarRentalEntities())
     {
         StopOver stopOver = context.usp_StopOver_Get_idBooking(idBooking).FirstOrDefault();
         return(stopOverMapping.MapToStopOverDTO(stopOver));
     }
 }
Esempio n. 2
0
 public StopOverDTO Add(StopOverDTO _stopOver)
 {
     using (CarRentalEntities context = new CarRentalEntities())
     {
         StopOver stopOver = context.usp_StopOver_Insert(_stopOver.Arrival_Date, _stopOver.Departure_Date, _stopOver.Id_Booking, _stopOver.Id_Stop_Over_Type).FirstOrDefault();
         return(stopOverMapping.MapToStopOverDTO(stopOver));
     }
 }
Esempio n. 3
0
 public StopOverDTO MapToStopOverDTO(StopOver stopOver)
 {
     if (stopOver != null)
     {
         return(new StopOverDTO
         {
             Arrival_Date = stopOver.Arrival_Date,
             Departure_Date = stopOver.Departure_Date,
             Id = stopOver.Id,
             Id_Booking = stopOver.Id_Booking,
             Id_Stop_Over_Type = stopOver.Id_Stop_Over_Type
         });
     }
     else
     {
         return(new StopOverDTO());
     }
 }