Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.38 KB | None | 0 0
  1. public Accommodation(AccommodationType accType, int category, AdditionalService[] additionalService, bool freeCancelation, int cancelationDays, string description,
  2.             string[] images, int numberOfPersons, long agentID, decimal defaultPrice, PeriodPrice[] periodPrice, Location location, Unavailability[] unavailability,
  3.             long[] reservationIds)
  4.         {
  5.             this.AccommodationType = accType;
  6.             this.Category = category;
  7.             AdditionalService addService = new AdditionalService();
  8.             for(int i = 0; i < additionalService.Length; ++i)
  9.             {
  10.                 addService.AdditionalServiceName = additionalService[i].AdditionalServiceName;
  11.                 addService.Id = additionalService[i].Id;
  12.                 this.AdditionalService[i] = addService;
  13.             }
  14.             this.FreeCancellation = freeCancelation;
  15.             this.CancellationDays = cancelationDays;
  16.             this.Description = description;
  17.             this.Images = images;
  18.             this.NumberOfPersons = numberOfPersons;
  19.             this.AgentID = agentID;
  20.             this.DefaultPrice = defaultPrice;
  21.             PeriodPrice periodP = new PeriodPrice();
  22.             for(int i = 0; i < periodPrice.Length; ++i)
  23.             {
  24.                 periodP.Id = periodPrice[i].Id;
  25.                 periodP.Price = periodPrice[i].Price;
  26.                 periodP.StartDate = periodPrice[i].StartDate;
  27.                 periodP.EndDate = periodPrice[i].EndDate;
  28.                 this.PeriodPrice[i] = periodP;
  29.             }
  30.  
  31.             this.Location = new Location(location.Country, location.City, location.Address, location.Latitude, location.Longitude, location.Id);
  32.  
  33.             Unavailability unav = new Unavailability();
  34.             for(int i = 0; i < unavailability.Length; ++i)
  35.             {
  36.                 unav.Id = unavailability[i].Id;
  37.                 unav.StartDate = unavailability[i].StartDate;
  38.                 unav.EndDate = unavailability[i].EndDate;
  39.                 this.Unavailability[i] = unav;
  40.             }
  41.            
  42.             ReservationLong reservationLong = new ReservationLong();
  43.             for(int i = 0; i < reservationIds.Length; ++i)
  44.             {
  45.                 reservationLong.Id = i + 1;
  46.                 reservationLong.Value = reservationIds[i];
  47.                 this.ReservationIds.Add(reservationLong);
  48.             }
  49.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement