public void AddAccommodation(Accommodation accommodation) { if (accommodation.Id == null) { accommodation.SetId(); } Accommodation.Add(accommodation); }
/// <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); } }
public void EditAccommodation(Accommodation accommodation) { var editAccommodation = Accommodation.FirstOrDefault(x => x.Id == accommodation.Id); editAccommodation = accommodation; }