コード例 #1
0
 public void AddAccommodation(Accommodation accommodation)
 {
     if (accommodation.Id == null)
     {
         accommodation.SetId();
     }
     Accommodation.Add(accommodation);
 }
コード例 #2
0
 /// <summary>
 /// Удалить TravelAct вместе с сопутствующим ему трансфером или проживанием
 /// </summary>
 /// <param name="act"></param>
 public void DeleteTravelAct(TravelAct act)
 {
     if (act.TravelActType == TravelActType.Transfer)
     {
         Transfer transfer = this.Transfers.FirstOrDefault(x => x.Id == act.Id);
         this.Transfers.Remove(transfer);
     }
     else
     {
         Accommodation accommodation = this.Accommodation.FirstOrDefault(x => x.Id == act.Id);
         this.Accommodation.Remove(accommodation);
     }
 }
コード例 #3
0
        public void EditAccommodation(Accommodation accommodation)
        {
            var editAccommodation = Accommodation.FirstOrDefault(x => x.Id == accommodation.Id);

            editAccommodation = accommodation;
        }